Forking TuxGuitar into a 17-EDO tab editor

Hacker News by 13 min read 508x views
Forking TuxGuitar into a 17-EDO tab editor

Share Post

18 Nov, 2026

TuxGuitar 17EDO is a fork of TuxGuitar 2.1.0 for guitars alongside 17 equal divisions of the octave. Stock TuxGuitar assumes 12 notes per octave in the tab, the staff, the fretboard and the synth. The fork changes all four to 17-EDO and has no 12-EDO mode. This leaf describes the changes in adequate item that a coding delegate can reapply them to a inventory checkout without the fork's source.

e |-----0------| B |-----0.1----| G |-----0------| D |-----0.3----| A |-----3------| E |------------| 

That is C important (C E G C E). The raw frets stored in the document are 0, 1, 0, 3, 4.

Model

Nothing in the opus example or any document format changes. A note is motionless an entire figure fret and a cord is motionless an entire figure value. The fork reinterprets the two as 17-EDO steps:

  • The MIDI key played is cord value + fret, as in stock.
  • Key k appears at 440 * 2^((k - 69) / 17) Hz. Key 69 is A4, key 56 is C4, 17 keys are one octave.
  • A document saved by the fork opens in inventory TuxGuitar and shows plain entire figure frets. Do not contact the readers or writers for this.
  • Files from inventory TuxGuitar or Guitar Pro are not converted on open. Their numbers are peruse as steps and audio wrong. This is deliberate.

The EDO is a constant, 17. An before type had an EDO setting, allow flags and a configurable citation key. All were removed. Do not add them.

Fret labels

Every location that prints a fret figure prints a dot-relative tag instead. A fret that carries a fretboard dot is labelled alongside the figure that dot has on a 12-EDO neck. Frets former a dot are <dot>.<k>, alongside k the steps former it. The nut acts as a dot named 0.

Default dots: for all 12-EDO dot c in 3, 5, 7, 9, 12, 15, 17, 19, 21, 24, the dot sits on fret round(c * 17 / 12) and is named c:

4:3, 7:5, 10:7, 13:9, 17:12, 21:15, 24:17, 27:19, 30:21, 34:24 

Formatting a fret f:

  1. f < 0: the plain integer.
  2. f == 0: 0.
  3. Otherwise obtain the final dot alongside dot.fret <= f (the nut if none), k = f - dot.fret. Return the dot name if k == 0, alternatively name.k.
Fret 0 1 2 3 4 5 6 7 8 9 10 13 16 17 19 34 40
Label 0 0.1 0.2 0.3 3 3.1 3.2 5 5.1 5.2 7 9 9.3 12 12.2 24 24.6

The dot catalog is the lone setting. It is the config key edo.labels.dots, default empty, edited in Tools > Settings on a new leaf titled "Fret labels" alongside a content field, a "Reset to default" clasp and a live preview of the labels for frets 0 to 19.

  • Format: fret:name pairs divided by commas, semicolons or whitespace. Names are liberated text.
  • A blank cord method the default dots.
  • Entries alongside no colon, an bare side, a non-numeric fret or a fret <= 0 are skipped alongside a alert on stderr.
  • The catalog is sorted by fret. When two entries portion a fret the archetypal one wins, alongside a warning.
  • On save, shop the normalized list, or the bare cord if the site was blank.
  • Saving goes through the existing settings reload, so open tabs repaint at once.

With dots 5:A, 2:B, fret 3 is B.1 and fret 35 is A.30.

Where the tag is used:

Place Note
Tab staff, content renderer The tag replaces the integer. Tied notes remain L, deceased notes X, shade notes get parentheses about the label.
Tab staff, vector numeral renderer Digits use the existing glyphs. A dot is a filled quadrate of flank 0.18 * size on the baseline, alongside the identical 0.1 * size gap as between digits.
Chord diagram first-fret number Widen the reserved area to max(configured spacing, content width + spacing / 4) and discard the cached diagram depiction whenever the tag or the width changes.
Chord publishing company dialog Same label. Its fret bounds rises from 24 to 99.
Print, PDF, PNG/JPG, SVG, ASCII tab Same label.
Caret Next to the caret box, whenever a note is selected, diagram <raw> = <label> on a background-coloured rectangle, for example 19 = 12.2. The raw figure is what the person types.

The layout manner entity carries the formatter and defaults to the default dots. The desktop builds it from config in one function, and that function additionally publishes the formatter on the use context. The SVG writer, the ASCII author and the headless PDF styles have no config admission and peruse it from the context, falling rear to the default. Without this, exports disregard a tradition dot list.

Width. Stock spacing ignores the width of the fret text, so sixteenth notes labelled 24.4 overlap. No artist exists during measure widths are computed, so the width is estimated: all character is 0.9 * note font height * font scale, a . is fractional that. The note asks for additional area of max(0, evaluation + 6 * measure - duration width) through the hook bends already use for additional width, blended alongside the curve width by max. Ghost notes add 6 * scale. Tied and deceased notes ask for nothing, and nothing is asked whenever the tab personnel is hidden. At 0.8 the labels touched.

The per-track max fret spinner in Track > Properties goes to 99, up from 39. Typing frets is unchanged: two digits inside a second combine, clamped to the track's max fret.

Note names and the staff

Pitches are named in Superpyth notation, the sequence of fifths. A entire spirit is 3 steps, E-F and B-C are 1 step, and a keen or flat is 2 steps. C# is one stage complete Db.

Pitch category is floorMod(key - 56, 17):

pc 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Name C Db C# D Eb D# E F Gb F# G Ab G# A Bb A# B
  • Naturals sit on throw classes 0, 3, 6, 7, 10, 13, 16.
  • Octave is floorDiv(key - 56, 17) + 4.
  • A personnel stance and octave map rear to 56 + 17 * (octave - 4) + natural step.
  • Valid keys are 0 to 127. Key 0 is G#0.

Four throw classes have a second name. Key signatures use TuxGuitar's encoding: 0 is none, 1 to 7 are sharps, 8 to 14 are 1 to 7 flats.

pc Default Second name Second name is in the key signature for
1 Db B# 7
5 D# Fb 14
8 Gb E# 6, 7
15 A# Cb 13, 14

A note uses its second name whenever exactly one of these holds: the key signature contains it, or the note's "alternative enharmonic" emblem is set. The emblem does nothing on the another 13 throw classes. B# belongs to the octave below the computed one and Cb to the octave above.

An unintended is drawn whenever the note's modification differs from what the key signature gives its personnel position. All of this replaces the internals of the one usefulness category that names notes, alongside its community method signatures kept, so the mark renderer, fretboard, matrix editor, imprint header and tuning dialogs prosecute without edits. Its sharp-name and flat-name functions come back the identical name, since sharps and flats are distinct pitches.

Other personnel changes:

  • Clicking the personnel to act a note adds or subtracts 2 steps for a keen or flat, anywhere inventory used 1.
  • Tools > Transpose offers -17 to +17 and is labelled in steps.
  • ASCII export names the strings alongside the identical namer.
  • Guessing a key signature from a measure keeps personal 12-EDO tables. Scales are motionless 12-EDO data.

Playback

Note numbers are remaining solitary and the synth is retuned. At the end of all conduit update the player:

  1. Sends a MIDI Tuning Standard bulk tuning dump for all 128 keys.
  2. On all non-percussion channel, sends RPN 0,3 (tuning program select) alongside data admission MSB 0, afterward reselects RPN 0,0 so afterward data admission motionless method throw curve range.

The dump is 408 bytes:

F0 7E 7F 08 01 00 <16-byte name> 128 x (xx yy zz) <checksum> F7 
  • Name: 17-EDO padded alongside spaces.
  • Per key: mark throw in 12-EDO semitones is p = 69 + (k - 69) * 12 / 17. xx = floor(p), and yy zz is round((p - xx) * 16384) as 14 bits, elevated 7 first. If the fraction rounds to 16384, transport into xx.
  • Checksum: XOR of all byte following F0 up to the final key byte, masked to 7 bits.

Key 69 encodes as 45 00 00. Key 70 is semitone 69 alongside fraction 11565. Key 52 is exactly semitone 57, so 220 Hz. Key 35 is 110 Hz.

Stock has no sysex path. Add a sendSysex(byte[]) method alongside a no-op default to the synthesizer and receiver interfaces and execute it in three ports:

Port How
Java Sound (Gervill) Wrap the bytes in a SysexMessage and dispatch to a receiver.
TuxGuitar Synth, Gervill processor Same, forwarded to all channel's processor.
FluidSynth New JNI call to fluid_synth_sysex, passing the payload without the foremost F0 and trailing F7.

The Java Sound plugin has two harbor classes. The one for Synthesizer devices drives the synth through the MidiChannel API, which cannot transport sysex. It has to fetch Synthesizer.getReceiver() and dispatch there. Cache the receiver and autumn it on error. The Gervill harbor is this class, so patching lone the external-device harbor leaves the default synth in 12-EDO.

ALSA, JACK, WinMM, AudioUnit and another external ports keep the no-op. Android shares the library, so it shows 17-EDO labels and names but plays untuned.

Tunings

Converting a 12-EDO MIDI note to a stage value rounds related to A4, so all A cord is exact:

step = 69 + round((note - 69) * 17 / 12) clamped to 0..127 
Tuning 12-EDO Steps Between strings
E standard, low to high 40 45 50 55 59 64 28 35 42 49 55 62 7-7-7-6-7
D standard 38 43 48 53 57 62 25 32 39 46 52 59 7-7-7-6-7
4-string bass 28 33 38 43 11 18 25 32 7-7-7

A caller track motionless starts from the inventory 12-EDO defaults and is afterward converted: all cord to its stage value, max fret to at smallest 34. Run that conversion following exactly these events, on non-percussion tracks only:

  • File > New.
  • Loading a template. The template records remain stock.
  • Adding a track.
  • Changing a track's cord count, lone if the figure really changed.
  • Switching a track from a percussion conduit to a melodic one.

Do not alter the opus manager's default tuning constant. The Guitar Pro writers use it too.

Track > Tuning:

  • Every built-in preset is offered converted. Its label, the strings array and the "which preset matches the current tuning" inspect all use the converted values. tunings.xml stays stock.
  • Presets in the user's tradition collection are stored and applied raw.
  • Two new buttons, "-1 step" and "+1 step", move the selected string, clamped to 0..127.
  • If the highest cord affirmative the track's max fret exceeds 127, display a alert that names how many frets fit (127 - highest). It is a tag inner the dialog. A modal opened from the preset drop-down's choice event froze the SWT dialog.
  • The single-string chooser lists all 128 keys by name alongside octave and has a spinner for the raw stage value, labelled "Step value (17-EDO step, 69 = A4)".
  • Stock has a bug current that breaks preset matching in nested groups: the recursive collection hunt passes the dialog's site anywhere it should continue its parameter.

Fretboard view

  • Draws 34 frets, two octaves.
  • Fret n sits at S * (1 - 2^(-n / 17)), alongside S chosen so the final fret lands on the correct edge. This replaces stock's linear-ish spacing. Mirror it for the left-handed direction.
  • Double dot on multiples of 17. Single dot on the formatter's another dot frets.
  • Click hit-testing already plant from the fret stance gathering and needs no change.

Editing changes

These are unrelated to tuning.

Sticky duration. When the caret lands on a beat, inventory copies that beat's duration into the selected duration. The fork copies lone if the sound has notes. Otherwise typing sixteenths and strolling into a new measure resets the choice to a entire note, since the new measure holds a entire rest.

Move selection. Ctrl + drag alongside the remaining clasp on an energetic choice moves the selected beats.

  1. Mouse events acquire a control-down emblem (SWT.MOD1 in the SWT toolkit, false elsewhere).
  2. While dragging, the caret follows the mouse and the choice is kept.
  3. On release, if the mouse really dragged and the autumn attack is not the archetypal selected beat: shop the selected beats, apparent them (notes of all voice, chord, text), compose the stored strikes at the autumn beat's exact commencement alongside the identical regular paste uses, reselect them, and put the caret on the archetypal one.
  4. Refused between percussion and non-percussion tracks.
  5. The clipboard is untouched. It is one undo step, alongside whole-song undo.

Reuse the paste code path, since it already extends the opus whenever the destination runs former the end.

Del on rests and bare measures. A measure is bare when, in all track, all its strikes are rests alongside no content and no chord.

  • Del alongside the caret in an bare measure removes the measure. With a selection, all bare measure the choice touches is removed and the remaining strikes get the inventory delete.
  • The opus continually keeps one measure.
  • Elsewhere the inventory behavior stays: deleting a remainder pulls the following strikes left.
  • When measures were removed, refresh the entire song, apparent the choice and clamp the caret to the final measure.
  • Undo for this act becomes whole-song. A beat-range undo cannot reconstruct a removed measure.

Repeat near without reiterate open. In inventory playback, a reiterate near that follows a completed reiterate alongside no definitive reiterate open in between is ignored. Fix: whenever a reiterate finishes, set the implied reiterate commencement to the next measure (its indicator and commencement time) and keep the repeat-open state.

Tremolo picking triplets. The tremolo picking dialog gets a triplet checkbox that sets the consequence duration's division to 3:2.

  • In the staff, the figure 3 is drawn next to the tremolo slashes.
  • In .tg records it is an optional kid of the tremolo picking element, written lone whenever not normal: <divisionType enters="3" times="2"/>. Files without it peruse as before.
  • A sixteenth-triplet tremolo lasts one sixth of a quarter.

Removed

These inventory tools lone cognize 12 notes and are hidden. Their actions remain registered and their sources remain in the tree.

Tool Removed from
Chord editor Chord list entry, edit toolbar button, chief toolbar item map. Saved tradition chords can motionless be inserted from the Chord menu.
Scale tool Tools menu, the fretboard's measure button, name tag and measure overlay.
Piano view View menu, chief toolbar item map.
Tuner, LilyPond and MusicXML plugins The component and relic lists of all desktop build script.

The use name is TuxGuitar 17EDO, in the app name changeless and the macOS bundle name.

Things that interrupt quietly

  • No java.util.logging. The macOS bundle ships a JRE made alongside jlink --add-modules java.desktop, which has no java.logging module. A archive category that imported it hung the app at the scatter screen. Warnings go to System.err.
  • Extra width must be zero for labels that fit. Otherwise all measure reflows compared to stock.
  • Send the tuning following the channels are set up. The dump and the RPN go at the end of the conduit update, formerly all conduit has been configured.

Checks

  • Unit: the tag array complete for frets 0 to 40; the dump bytes listed under Playback; the three tuning rows.
  • Round trip: preserve in the fork, open in stock, see plain integers.
  • ASCII export of a low E cord at raw fret 5 followed by fret 4 prints 3.1 afterward 3.
  • By ear or by throw finding on rendered audio: open A strings at 110 and 220 Hz, low E at 82.7 Hz.

Known limits

  • Natural harmonics, the tonic color in chord diagrams and chord names from imported records motionless assume 12 notes.
  • Two distinct accidentals on one personnel stance in one measure (C# afterward Cb) are not told apart.
  • LilyPond and MusicXML export have no 17-EDO support, which is why they are unpackaged.
  • The dot catalog is global, not per track or per file. A per-track environment would need a new document attribute.
  • Only the SWT desktop build was tested.

#java #microtonal #midi #spec #tuxguitar

Other Article Hacker News
↑
Close Right Ads
Close Left Ads