@yam8d/m8-sdk 0.3.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5,496 +5,998 @@ var r = {
5
5
  notes: {
6
6
  fontMode: "All x/width values assume font mode 0 (standard, 12×14 px cells, 40 cols × ~22 rows). Font modes 1 (bold uppercase) and 2 (large) may shift column positions.",
7
7
  playbackIndicator: "The M8 renders a '>' character one column to the left of the first data column when that step/row/track is currently playing. This character is part of the text stream; the editing cursor is a separate rect overlay.",
8
+ screenGeometry: "The screen is 40 columns x 24 rows. Every row has a one-column left margin (the playback marker is drawn in it), so x positions in this schema count from column 1 of the raw screen and cursorPos.x is the schema x + 1. Titles are on row 3, content starts on row 5. The text stream is lower case ('tempo', 'b-4', 'ff').",
8
9
  emptyCell: "An empty or unused cell displays '--' (2 chars) or '---' (3 chars) or '---00' (command+value). Parsed hexValue will be null for these.",
9
10
  relativeHex: "Transpose and some FX values use relative hex: 00 = no change, 01-7F = +1-127, FF-80 = -1-128. See 'Relative and Absolute FX Commands' in the manual.",
10
- rowIndex: "Row/step indices are parsed from the leftmost characters of currentLine. They are hex for all grid views."
11
+ rowIndex: "Row/step indices are parsed from the leftmost characters of currentLine. They are hex for all grid views.",
12
+ titleAsterisk: "A '*' next to the item ID in the screen title (e.g. 'PHRASE 03*') indicates the item is used elsewhere in the chain or song (phrase view); on other views it marks unsaved changes. See 'An asterisk next to the phrase number' in the manual."
11
13
  },
12
14
  fieldTypes: {
13
15
  chainRef: "Reference to a chain number (hex 00-FF). '--' means empty/unused.",
14
16
  phraseRef: "Reference to a phrase number (hex 00-FF). '--' means empty/unused.",
15
17
  note: "Musical note in M8 format: [A-G][#|-][0-9] e.g. 'C-4', 'A#3'. '---' = empty. 'OFF' = note-off.",
16
- velocity: "Note velocity 00-7F (hex). Default is 64 (hex). '--' = inherit.",
18
+ velocity: "Note velocity 00-7F (hex), from 00 (silence) to 7F (maximum). Default is 64 (hex). '--' = inherit.",
17
19
  instrumentRef: "Instrument number 00-7F (hex). '--' = no retrigger (keep current instrument).",
18
20
  fxCommand: "3-character sequencer or instrument FX command name, e.g. 'KIL', 'ARP', 'DEL'. '---' = none.",
19
21
  fxValue: "2-char hex value 00-FF accompanying an FX command. Interpretation depends on the command.",
20
22
  transpose: "Semitone or tick transpose. Relative: 00=none, 01-7F=+1-+127, FF-80=-1--128.",
21
23
  ticks: "Number of ticks this step consumes in a groove (hex 01-FF). '00' skips the step. '--' = empty (groove loops at this point).",
22
24
  volume: "Volume multiplier 00-FF (hex). Multiplied with the phrase-row velocity. '--' = no override.",
23
- ppq: "Pulses Per Quarter note: resolution of the groove clock (decimal). Only editable on groove row 0.",
25
+ ppq: "Pulses Per Quarter note: resolution of the groove clock (decimal). One of 24 (default), 48, 96 or 192. Only present on groove row 0; absent on all other rows.",
24
26
  instrumentName: "Instrument name string (up to 12 characters). Text field, no hex value.",
25
27
  eqSlot: "EQ slot assignment (hex). '--' = no EQ applied to this instrument.",
26
- rowIndex: "The positional index of this row in the current view (song row, chain position, phrase step, etc.)."
28
+ rowIndex: "The positional index of this row in the current view (song row, chain position, phrase step, etc.).",
29
+ noteInterval: "Scale row label: one of the 12 note intervals C, C#, D, D#, E, F, F#, G, G#, A, A#, B (sharps use '#', naturals may render a dim '-' pad, e.g. 'C-').",
30
+ onOff: "Toggle field displayed as 'ON' or 'OFF' ('--' = unset). Used by the scale view 'EN' column.",
31
+ semitoneOffset: "Signed semitone offset in decimal notation with two decimals (-24.00 to +24.00), e.g. '00.00', '-00.50', '12.00'. Used by the scale view 'OFFSET' column.",
32
+ swing: "Groove swing amount as a percentage with one decimal, e.g. '50.0%' = straight timing, higher = swung. Shown on every second groove row (0, 2, 4, …): the swing of that pair of steps (ticks 07,05 → 58.3%).",
33
+ instrumentType: "Instrument engine chosen with the TYPE field of the Instrument view: WAVSYNTH, MACROSYN, SAMPLER, FMSYNTH, HYPERSYNTH, EXTERNAL INST, MIDI OUT (NONE for an unused slot). Text value; changes which parameters the view shows.",
34
+ name: "Free-text name field (instrument, song, sample, directory). Up to 12 characters; a row of dashes means unnamed.",
35
+ parameter: "Editable value of a named parameter (CUTOFF, TEMPO, GAIN, …). Its 'format' says how to read it: hex byte, 'XX:YY' pair, decimal, decimal with a fraction, or free text.",
36
+ option: "Choice from a list, shown as its name, optionally preceded by its index in hex (e.g. '00CHORUS', 'STEREO', 'BELL'). hexValue holds the index when there is one, text holds the name.",
37
+ action: "Button-like text that does something when [EDIT] is pressed on it (LOAD, SAVE, RENDER, SETTINGS, VIEW INST. POOL, EQ, …). The text is the caption.",
38
+ fileEntry: "Row of a file browser: '/name' is a directory, '/..' the parent directory, anything else a file (e.g. 'Bass.m8i')."
27
39
  },
28
- views: {
29
- song: {
30
- title: "Song View",
31
- type: "grid",
32
- description: "Arranges chains across 8 independent tracks to form the song structure. Each row is a song position; each column is a track.",
33
- rowField: {
34
- x: 0,
35
- width: 2,
36
- parse: "hex",
37
- type: "rowIndex",
38
- key: "songRow",
39
- description: "Song row 00-FF. Each track loops back to row 00 when it reaches '--'."
40
+ views: /* @__PURE__ */ JSON.parse("{\"song\":{\"title\":\"Song View\",\"type\":\"grid\",\"description\":\"Arranges chains across 8 independent tracks to form the song structure. Each row is a song position (up to 256 rows); each column is a track. Each track advances vertically until it reaches an empty column ('--'), then loops back to row 00. Chains containing no notes are grayed out; chains '00' or 'FE' are commonly used as silent spacers. On row '00', [UP][UP] enters track reordering mode.\",\"rowField\":{\"x\":0,\"width\":2,\"parse\":\"hex\",\"type\":\"rowIndex\",\"key\":\"songRow\",\"description\":\"Song row 00-FF. Each track loops back to row 00 when it reaches '--'.\"},\"columns\":[{\"x\":3,\"width\":2,\"key\":\"track1\",\"type\":\"chainRef\",\"label\":\"Track 1\",\"meta\":{\"trackIndex\":1}},{\"x\":6,\"width\":2,\"key\":\"track2\",\"type\":\"chainRef\",\"label\":\"Track 2\",\"meta\":{\"trackIndex\":2}},{\"x\":9,\"width\":2,\"key\":\"track3\",\"type\":\"chainRef\",\"label\":\"Track 3\",\"meta\":{\"trackIndex\":3}},{\"x\":12,\"width\":2,\"key\":\"track4\",\"type\":\"chainRef\",\"label\":\"Track 4\",\"meta\":{\"trackIndex\":4}},{\"x\":15,\"width\":2,\"key\":\"track5\",\"type\":\"chainRef\",\"label\":\"Track 5\",\"meta\":{\"trackIndex\":5}},{\"x\":18,\"width\":2,\"key\":\"track6\",\"type\":\"chainRef\",\"label\":\"Track 6\",\"meta\":{\"trackIndex\":6}},{\"x\":21,\"width\":2,\"key\":\"track7\",\"type\":\"chainRef\",\"label\":\"Track 7\",\"meta\":{\"trackIndex\":7}},{\"x\":24,\"width\":2,\"key\":\"track8\",\"type\":\"chainRef\",\"label\":\"Track 8\",\"meta\":{\"trackIndex\":8}}]},\"chain\":{\"title\":\"Chain View\",\"type\":\"grid\",\"description\":\"An ordered list of up to 16 phrases (256 steps). The first '--' phrase ends the chain and the song continues on to the next chain in the song view. The 'TSP' column optionally transposes every note in the phrase in semitones (relative hex).\",\"rowField\":{\"x\":0,\"width\":1,\"parse\":\"hex\",\"type\":\"rowIndex\",\"key\":\"chainPos\",\"description\":\"Position within the chain (0-F, max 16 entries).\"},\"columns\":[{\"x\":2,\"width\":2,\"key\":\"phrase\",\"type\":\"phraseRef\",\"label\":\"Phrase (PH)\",\"description\":\"Phrase number to play at this chain position.\"},{\"x\":5,\"width\":2,\"key\":\"transpose\",\"type\":\"transpose\",\"label\":\"Transpose (TSP)\",\"description\":\"Optional note transpose in semitones applied to every note in the phrase (relative hex).\"}]},\"phrase\":{\"title\":\"Phrase View\",\"type\":\"grid\",\"description\":\"A 16-step sequence. Each step holds a note, velocity, instrument assignment, and up to 3 FX command+value pairs. Notes cover 11 octaves (the full 128 MIDI note range); velocity defaults to 64 (hex); an empty instrument column plays the note without retriggering the instrument. A '*' next to the phrase number indicates the phrase is used elsewhere in the chain or song.\",\"rowField\":{\"x\":0,\"width\":1,\"parse\":\"hex\",\"type\":\"rowIndex\",\"key\":\"step\",\"description\":\"Step index 0-F (16th note by default; altered by groove).\"},\"columns\":[{\"x\":2,\"width\":3,\"key\":\"note\",\"type\":\"note\",\"label\":\"Note (N)\"},{\"x\":6,\"width\":2,\"key\":\"vel\",\"type\":\"velocity\",\"label\":\"Velocity (V)\"},{\"x\":9,\"width\":2,\"key\":\"inst\",\"type\":\"instrumentRef\",\"label\":\"Instrument (I)\"},{\"x\":12,\"width\":3,\"key\":\"fx1cmd\",\"type\":\"fxCommand\",\"label\":\"FX1 Command\"},{\"x\":15,\"width\":2,\"key\":\"fx1val\",\"type\":\"fxValue\",\"label\":\"FX1 Value\"},{\"x\":18,\"width\":3,\"key\":\"fx2cmd\",\"type\":\"fxCommand\",\"label\":\"FX2 Command\"},{\"x\":21,\"width\":2,\"key\":\"fx2val\",\"type\":\"fxValue\",\"label\":\"FX2 Value\"},{\"x\":24,\"width\":3,\"key\":\"fx3cmd\",\"type\":\"fxCommand\",\"label\":\"FX3 Command\"},{\"x\":27,\"width\":2,\"key\":\"fx3val\",\"type\":\"fxValue\",\"label\":\"FX3 Value\"}]},\"table\":{\"title\":\"Table View\",\"type\":\"grid\",\"description\":\"A 16-step mini-sequencer that runs alongside an instrument. Used for arpeggios, multi-stage envelopes, and automated FX. The 'N' column transposes the instrument for the step (relative hex); 'V' multiplies with the phrase-row velocity. Each instrument has a dedicated table plus 128 assignable tables (TBL command). FX columns can run at independent speeds via TIC; a TIC on the last table row affects all rows. HOP shortens or loops the table.\",\"rowField\":{\"x\":0,\"width\":1,\"parse\":\"hex\",\"type\":\"rowIndex\",\"key\":\"step\",\"description\":\"Table step 0-F. Loops from bottom unless a HOP command redirects.\"},\"columns\":[{\"x\":2,\"width\":2,\"key\":\"transpose\",\"type\":\"transpose\",\"label\":\"Transpose (N)\",\"description\":\"Transposes the instrument for this step (relative hex). '--' = no transpose.\"},{\"x\":5,\"width\":2,\"key\":\"volume\",\"type\":\"volume\",\"label\":\"Volume (V)\",\"description\":\"Volume multiplier applied on top of the phrase velocity (hex). '--' = no override.\"},{\"x\":8,\"width\":3,\"key\":\"fx1cmd\",\"type\":\"fxCommand\",\"label\":\"FX1 Command\",\"description\":\"3-char command name for table FX slot 1.\"},{\"x\":11,\"width\":2,\"key\":\"fx1val\",\"type\":\"fxValue\",\"label\":\"FX1 Value\",\"description\":\"Value for table FX1.\"},{\"x\":14,\"width\":3,\"key\":\"fx2cmd\",\"type\":\"fxCommand\",\"label\":\"FX2 Command\",\"description\":\"3-char command name for table FX slot 2.\"},{\"x\":17,\"width\":2,\"key\":\"fx2val\",\"type\":\"fxValue\",\"label\":\"FX2 Value\",\"description\":\"Value for table FX2.\"},{\"x\":20,\"width\":3,\"key\":\"fx3cmd\",\"type\":\"fxCommand\",\"label\":\"FX3 Command\",\"description\":\"3-char command name for table FX slot 3.\"},{\"x\":23,\"width\":2,\"key\":\"fx3val\",\"type\":\"fxValue\",\"label\":\"FX3 Value\",\"description\":\"Value for table FX3.\"}]},\"groove\":{\"title\":\"Groove View\",\"type\":\"grid\",\"description\":\"Defines the timing of each phrase step in ticks. Used to create swing, shuffle, triplets, and other rhythmic feels. At the default 24 PPQ a step is 6 ticks and a full phrase totals 96 ticks. The groove loops when a '--' entry is reached; a '00' entry skips the phrase step. Row 0 also holds the PPQ resolution (24/48/96/192) and the SWING percentage; editing the row 0 tick value alters rows 0 and 1 together (a common swing setting is 07,05 or 08,04).\",\"rowField\":{\"x\":0,\"width\":1,\"parse\":\"hex\",\"type\":\"rowIndex\",\"key\":\"step\",\"description\":\"Groove step 0-F. The groove loops when a '--' entry is reached.\"},\"columns\":[{\"x\":2,\"width\":2,\"key\":\"ticks\",\"type\":\"ticks\",\"label\":\"Ticks (TIC)\",\"description\":\"Number of ticks this step takes. Default is 06 (at 24 PPQN = 1 sixteenth note). '00' skips the step.\"},{\"x\":6,\"width\":2,\"key\":\"ppq\",\"type\":\"ppq\",\"label\":\"PPQ\",\"description\":\"Pulses Per Quarter note: 24, 48, 96 or 192. Only present on groove row 0; absent on all other rows.\"},{\"x\":10,\"width\":5,\"key\":\"swing\",\"type\":\"swing\",\"label\":\"Swing\",\"description\":\"Swing amount as a percentage (e.g. '50.0%' = straight). Shown on every second row (0, 2, 4, …) for that pair of steps; empty on the others.\"}]},\"scale\":{\"title\":\"Scale View\",\"type\":\"grid\",\"description\":\"Defines and quantizes note-related events (project/chain transpose, note entry, ARP, PIT, and the MIDIOUT instrument CHD and ADD commands). Up to 16 user-defined scales per project; scale '00' is the default for all 8 tracks and can be overridden per track with SCA/SCG FX commands. Each of the 12 note intervals can be enabled ('EN' = ON) with an optional detuning offset (-24.00 to +24.00 semitones). Rows below the 12 intervals (not column-mapped) hold: KEY (global root note for the default scale), TUNE (A4 reference in Hz, e.g. '440.00'), NAME (up to 16 characters, 92 factory scales load from /Scales/Factory), and the LOAD/SAVE actions.\",\"columns\":[{\"x\":0,\"width\":2,\"key\":\"interval\",\"type\":\"noteInterval\",\"label\":\"Note Interval\",\"description\":\"Note interval row label: C, C#, D, D#, E, F, F#, G, G#, A, A#, B.\"},{\"x\":3,\"width\":3,\"key\":\"en\",\"type\":\"onOff\",\"label\":\"Enabled (EN)\",\"description\":\"Enables this note interval in the scale: 'ON' or 'OFF' ('--' = unset).\"},{\"x\":6,\"width\":6,\"key\":\"offset\",\"type\":\"semitoneOffset\",\"label\":\"Offset (OFFSET)\",\"description\":\"Detune offset in semitones, decimal with two decimals (-24.00 to +24.00), e.g. '00.00'.\"}]},\"instrumentpool\":{\"title\":\"Instrument Pool\",\"type\":\"grid\",\"description\":\"Lists all 128 instrument slots with their mix routing. Each row shows the instrument name (up to 12 chars, '------------' = empty slot) and its dry/FX send levels. Mixer-related settings can be adjusted per instrument here; [EDIT] on an empty slot loads an instrument or sample.\",\"rowField\":{\"x\":0,\"width\":2,\"parse\":\"hex\",\"type\":\"rowIndex\",\"key\":\"instIndex\",\"description\":\"Instrument slot index 00-7F.\"},\"columns\":[{\"x\":3,\"width\":12,\"key\":\"name\",\"type\":\"instrumentName\",\"label\":\"Instrument Name\",\"description\":\"Name of the instrument in this slot (up to 12 chars). '------------' = empty slot.\"},{\"x\":16,\"width\":2,\"key\":\"dry\",\"type\":\"volume\",\"label\":\"Dry (DRY)\",\"description\":\"Direct output volume for this instrument (hex 00-FF).\"},{\"x\":19,\"width\":2,\"key\":\"mx\",\"type\":\"volume\",\"label\":\"ModFX (MX)\",\"description\":\"ModFX send level (hex 00-FF).\"},{\"x\":22,\"width\":2,\"key\":\"de\",\"type\":\"volume\",\"label\":\"Delay (DE)\",\"description\":\"Delay send level (hex 00-FF).\"},{\"x\":25,\"width\":2,\"key\":\"rv\",\"type\":\"volume\",\"label\":\"Reverb (RV)\",\"description\":\"Reverb send level (hex 00-FF).\"},{\"x\":28,\"width\":2,\"key\":\"eq\",\"type\":\"eqSlot\",\"label\":\"EQ Slot (EQ)\",\"description\":\"EQ slot assignment. '--' = no EQ.\"}]},\"inst\":{\"title\":\"Instrument View\",\"type\":\"parameter\",\"description\":\"Per-instrument parameters for the selected slot: TYPE (Wavsynth, Macrosynth, Sampler, FM Synth, Hypersynth, External Instrument, MIDI Out), LOAD/SAVE presets, NAME, TRANSP. (enable/disable transposition from scales and transpose columns), TABLE TIC (default table speed), and EQ slot, plus the synth engine parameters. Almost every parameter has an associated FX command; highlighting a parameter and navigating to the phrase or table view sets that parameter's FX command as default.\"},\"instmods\":{\"title\":\"Instrument Modulation View\",\"type\":\"parameter\",\"description\":\"Four configurable modulation slots per instrument: AHD envelope, ADSR envelope, DRUM envelope, LFO, TRIG envelope, or TRACKING, each with a destination parameter (DEST) and optional source (SRC).\"},\"mixer\":{\"title\":\"Mixer View\",\"type\":\"parameter\",\"description\":\"Mix levels for the 8 tracks, the 3 send effects (MX/DE/RE), the analog input (INPUT, with dual-mono mode) and USB input, the DJ filter (DJF), OTT compression, main EQ, limiter (LIM) and main volume (MIX). All signals are summed through OTT, main EQ, limiter, DJ filter and main volume. Most values are also exposed as FX commands (VMV, VMX, VDE, VRE, VT1-8, DJC/DJR/DJT, IVO/IMX/IDE/IRV, USB, ...).\"},\"project\":{\"title\":\"Project View\",\"type\":\"parameter\",\"description\":\"Song-wide settings such as tempo, project transpose (identical to the TSP FX command), and LIVE QUANTIZE behavior for cueing tracks in live mode. [SHIFT]+[OPTION] stores a song snapshot; [SHIFT]+[EDIT] recalls it.\"},\"effectsettings\":{\"title\":\"Effect Settings View\",\"type\":\"parameter\",\"description\":\"Settings for the 3 send effects: ModFX type/depth/frequency/width, Delay time/feedback/width, and Reverb size/decay/modulation/width/freeze — all addressable via the XMT-XMW, XDT-XDR and XRS-XRZ FX commands.\"},\"mixeq\":{\"title\":\"Mix EQ View\",\"type\":\"parameter\",\"description\":\"EQ editor for the main mix EQ slot (assign with the EQM FX command). Selecting EQ in the Mixer view and pressing [EDIT] or [SHIFT]+[RIGHT] opens this view.\"},\"modfxeq\":{\"title\":\"ModFX EQ View\",\"type\":\"parameter\",\"description\":\"EQ editor for the ModFX send path.\"},\"delayeq\":{\"title\":\"Delay EQ View\",\"type\":\"parameter\",\"description\":\"EQ editor for the Delay send path.\"},\"reverbeq\":{\"title\":\"Reverb EQ View\",\"type\":\"parameter\",\"description\":\"EQ editor for the Reverb send path.\"},\"mixscope\":{\"title\":\"Mix Scope View\",\"type\":\"parameter\",\"description\":\"Graphical scope of the main mix activity. Opened from the Mixer view with MIX selected via [EDIT] or [SHIFT]+[RIGHT].\"},\"limiterscope\":{\"title\":\"Limiter Scope View\",\"type\":\"parameter\",\"description\":\"Graphical scope of the limiter's compression activity (the white line on the MIX indicator). Opened from the Mixer view with LIM selected via [EDIT] or [SHIFT]+[RIGHT].\"},\"systemsettings\":{\"title\":\"System Settings View\",\"type\":\"parameter\",\"description\":\"System-level settings for the device.\"},\"loadinstrument\":{\"title\":\"Load Instrument\",\"type\":\"parameter\",\"description\":\"File browser for loading an instrument preset from the SD card ([EDIT] on an empty instrument slot, or LOAD in the Instrument view).\"},\"selectsavedirectory\":{\"title\":\"Select Save Directory\",\"type\":\"parameter\",\"description\":\"File browser directory-selection step when saving a preset or project.\"},\"createdirectory\":{\"title\":\"Create Directory\",\"type\":\"parameter\",\"description\":\"File browser dialog for creating a new directory on the SD card.\"}}"),
41
+ fxCommands: /* @__PURE__ */ JSON.parse("{\"sequencer\":{\"ARP\":{\"description\":\"Arpeggio: plays 3 notes rapidly. X=first interval semitones, Y=second interval semitones.\"},\"ARC\":{\"description\":\"Arpeggio Config: X=direction and number of octaves, Y=speed in ticks.\"},\"CHA\":{\"description\":\"Chance: X=probability left of command (0=never, F=always), Y=probability right. In a table: probability for everything to the left of CHA from 00 (never) to FF (always).\"},\"DEL\":{\"description\":\"Delay: in phrase delays entire row by XX ticks; in table delays table playhead.\"},\"GRV\":{\"description\":\"Groove: sets groove number XX for the current track.\"},\"GGR\":{\"description\":\"Global Groove: sets groove XX for all tracks.\"},\"HOP\":{\"description\":\"Hop: in phrase jumps to row Y of next phrase; HOPFF stops track. In table loops to row Y X times.\"},\"INS\":{\"description\":\"Instrument: changes active instrument to XX as an FX command.\"},\"KIL\":{\"description\":\"Kill: stops the playing instrument after XX ticks.\"},\"RND\":{\"description\":\"Random: randomises the preceding FX command. X=left range, Y=right range (0=none, F=full).\"},\"RNL\":{\"description\":\"Randomise Left: randomises the FX command to the left (X=left range, Y=right range). In the first column RNL randomises the note and instrument number in phrase, or note and velocity in table.\"},\"RET\":{\"description\":\"Retrig: retriggers current row. Y≠0: retrig every Y ticks with X volume ramp. Y=0: single retrig after X ticks.\"},\"REP\":{\"description\":\"Repeat: repeats and increments the last FX command by XX each step. Active until a new command or REP00 stops it; it does not need to appear on every row. In a table: loops the last row XX times. A double-caret '^^' appears next to an FX lane while a REP from a previous phrase is active.\"},\"RTO\":{\"description\":\"Repeat To: use after REP to hold at the given value (the min/max REP stops at). In a table, used alone: loops until the relative value is reached.\"},\"RMX\":{\"description\":\"Remix: repositions the phrase playhead (Y) on tracks to the left (selected by X).\"},\"NTH\":{\"description\":\"Nth Trigger: conditional trigger on the loop count. X=affects what is left of the command, Y=what is right (in a table: what is left).\"},\"PSL\":{\"description\":\"Pitch Slide (portamento): slides to the given note over XX ticks.\"},\"PBN\":{\"description\":\"Pitch Bend: continuous pitch slide up (00-7F) or down (80-FF).\"},\"PVB\":{\"description\":\"Vibrato: X=speed, Y=depth.\"},\"PVX\":{\"description\":\"Extreme Vibrato: like PVB but with higher range.\"},\"SCA\":{\"description\":\"Track Scale: X=key signature, Y=scale number for this track.\"},\"SCG\":{\"description\":\"Global Scale: X=key, Y=scale number for the whole song.\"},\"SNG\":{\"description\":\"Song Hop: moves this track's song position by XX rows relative to current. Ignored if the resulting song position is not playable.\"},\"SED\":{\"description\":\"Random Seed: sets the random seed XX for this track.\"},\"TBL\":{\"description\":\"Table: assigns table number XX to the current instrument.\"},\"THO\":{\"description\":\"Table Hop: jumps all table columns to position 0X.\"},\"TIC\":{\"description\":\"Table Tick: sets the table tick rate. 00 = increment row on each instrument trigger; 01-FB = ticks per row; FC = Octave Map (playing octave maps to table row); FD = Velocity Map; FE = Note Map (pair with HOP00 on row 0C to limit to 12 notes/octave); FF = increment at 200 Hz. In a table each FX column can run independently; a TIC on the last table row affects all rows.\"},\"TBX\":{\"description\":\"Aux Table: runs table XX in parallel with the instrument table. 00=stop aux table. A TIC in the same row as a TBX affects the auxiliary table's tick rate.\"},\"TPO\":{\"description\":\"Tempo: sets song BPM to XX. In a table the tempo is relative.\"},\"TSP\":{\"description\":\"Global Song Transpose: transposes the entire song by XX semitones. Identical to the transpose value in the Project View.\"},\"NXT\":{\"description\":\"Next Track Trigger: plays instrument XX on the track to the right using the current note/velocity. Does not work on track 8.\"},\"OFF\":{\"description\":\"Note Off: stops the playing instrument after XX ticks. Triggers ADSR release stage.\"},\"MTT\":{\"description\":\"Micro Time: adjusts row playback timing in positive or negative sub-tick (1/8 tick) amounts. Negative amounts do not work on the first phrase row. Currently has no action in tables.\"}},\"instrument\":{\"VOL\":{\"description\":\"Volume (relative).\",\"relative\":true},\"PIT\":{\"description\":\"Pitch in semitones (relative).\",\"relative\":true},\"FIN\":{\"description\":\"Fine tune: pitch shift of up to about one semitone (relative).\",\"relative\":true},\"PLY\":{\"description\":\"Sampler play mode (FWD, REV, loop modes…).\"},\"STA\":{\"description\":\"Sampler start position.\"},\"LOP\":{\"description\":\"Sampler loop start (relative).\",\"relative\":true},\"LEN\":{\"description\":\"Sampler length (relative).\",\"relative\":true},\"DEG\":{\"description\":\"Degrade amount (relative).\",\"relative\":true},\"SLI\":{\"description\":\"Sampler slice to play.\"},\"ERR\":{\"description\":\"Error: randomizes pitch and parameters by the given amount.\"},\"FLT\":{\"description\":\"Filter type.\"},\"FIL\":{\"description\":\"Filter type.\"},\"ALG\":{\"description\":\"FM algorithm.\"},\"FM1\":{\"description\":\"FM modulation amount 1 (relative).\",\"relative\":true},\"FM2\":{\"description\":\"FM modulation amount 2 (relative).\",\"relative\":true},\"FM3\":{\"description\":\"FM modulation amount 3 (relative).\",\"relative\":true},\"FM4\":{\"description\":\"FM modulation amount 4 (relative).\",\"relative\":true},\"SNC\":{\"description\":\"Sync: on an FM synth the FM sync phase position; on a Hypersynth it offsets the sync of the oscillators by the given amount.\"},\"CRD\":{\"description\":\"Hypersynth chord set.\"},\"CVO\":{\"description\":\"Hypersynth chord voice offset: X=voice, Y=offset.\"},\"SWM\":{\"description\":\"Hypersynth oscillator swarm (relative).\",\"relative\":true},\"WID\":{\"description\":\"Hypersynth stereo width (relative).\",\"relative\":true},\"SUB\":{\"description\":\"Hypersynth sub-oscillator amount (relative).\",\"relative\":true},\"OSC\":{\"description\":\"Macrosynth oscillator shape.\"},\"TBR\":{\"description\":\"Macrosynth timbre (relative).\",\"relative\":true},\"COL\":{\"description\":\"Macrosynth color (relative).\",\"relative\":true},\"RED\":{\"description\":\"Macrosynth bit reduction (relative).\",\"relative\":true},\"TRG\":{\"description\":\"Macrosynth trigger/strike.\"},\"CUT\":{\"description\":\"Filter cutoff (relative).\",\"relative\":true},\"RES\":{\"description\":\"Filter resonance (relative).\",\"relative\":true},\"AMP\":{\"description\":\"Amp level (relative).\",\"relative\":true},\"LIM\":{\"description\":\"Limit mode: how the amp stage clips.\"},\"PAN\":{\"description\":\"Pan (relative).\",\"relative\":true},\"DRY\":{\"description\":\"Dry volume: the instrument's level in the main mix.\"},\"SMX\":{\"description\":\"Send to ModFX.\"},\"SDL\":{\"description\":\"Send to Delay.\"},\"SRV\":{\"description\":\"Send to Reverb.\"},\"CHD\":{\"description\":\"Chord (MIDIOUT instrument): triggers a chord. Quantized by the active scale.\"},\"ADD\":{\"description\":\"Add Note (MIDIOUT instrument): adds a note to the chord. Quantized by the active scale.\"}},\"modulation\":{\"EA\":{\"description\":\"Envelope amount of modulator N (relative).\",\"relative\":true},\"AT\":{\"description\":\"Envelope attack of modulator N.\"},\"HO\":{\"description\":\"Envelope hold of modulator N.\"},\"DE\":{\"description\":\"Envelope decay of modulator N.\"},\"ET\":{\"description\":\"Envelope trigger of modulator N: retriggers the envelope.\"},\"LA\":{\"description\":\"LFO amount of modulator N (relative).\",\"relative\":true},\"LO\":{\"description\":\"LFO oscillator shape of modulator N.\"},\"LS\":{\"description\":\"LFO trigger settings of modulator N.\"},\"LF\":{\"description\":\"LFO frequency of modulator N.\"},\"LT\":{\"description\":\"LFO trigger of modulator N: at the given offset, resets the LFO to that position.\"}},\"mixer\":{\"VMV\":{\"description\":\"Main Volume: sets the main song output volume.\"},\"VMX\":{\"description\":\"ModFX Volume.\"},\"VDE\":{\"description\":\"Delay Volume.\"},\"VRE\":{\"description\":\"Reverb Volume.\"},\"VT1\":{\"description\":\"Track 1 Volume.\"},\"VT2\":{\"description\":\"Track 2 Volume.\"},\"VT3\":{\"description\":\"Track 3 Volume.\"},\"VT4\":{\"description\":\"Track 4 Volume.\"},\"VT5\":{\"description\":\"Track 5 Volume.\"},\"VT6\":{\"description\":\"Track 6 Volume.\"},\"VT7\":{\"description\":\"Track 7 Volume.\"},\"VT8\":{\"description\":\"Track 8 Volume.\"},\"DJC\":{\"description\":\"DJ Filter Cutoff.\"},\"DJR\":{\"description\":\"DJ Filter Resonance.\"},\"DJT\":{\"description\":\"DJ Filter Type.\"},\"EQM\":{\"description\":\"Assign main mix EQ slot.\"},\"EQI\":{\"description\":\"Assign current instrument EQ slot.\"},\"XMT\":{\"description\":\"Send Effect: ModFX mod type and phase position (Effect Settings view).\"},\"XMM\":{\"description\":\"Send Effect: ModFX mod depth (Effect Settings view).\"},\"XMF\":{\"description\":\"Send Effect: ModFX mod frequency (Effect Settings view).\"},\"XMW\":{\"description\":\"Send Effect: ModFX stereo width (Effect Settings view).\"},\"XMR\":{\"description\":\"Send Effect: ModFX to reverb mix (Effect Settings view).\"},\"XDT\":{\"description\":\"Send Effect: Delay time — X = left, Y = right, in large increments (Effect Settings view).\"},\"XDF\":{\"description\":\"Send Effect: Delay feedback (Effect Settings view).\"},\"XDW\":{\"description\":\"Send Effect: Delay stereo width (Effect Settings view).\"},\"XDR\":{\"description\":\"Send Effect: Delay to reverb mix (Effect Settings view).\"},\"XRS\":{\"description\":\"Send Effect: Reverb room size (Effect Settings view).\"},\"XRD\":{\"description\":\"Send Effect: Reverb decay (Effect Settings view).\"},\"XRM\":{\"description\":\"Send Effect: Reverb mod depth (Effect Settings view).\"},\"XRF\":{\"description\":\"Send Effect: Reverb mod frequency (Effect Settings view).\"},\"XRW\":{\"description\":\"Send Effect: Reverb stereo width (Effect Settings view).\"},\"XRZ\":{\"description\":\"Send Effect: Reverb freeze — enabled with a value greater than 00, disabled at 00.\"},\"VIN\":{\"description\":\"Line Input Mixer: analog input volume (Mixer view).\"},\"XRH\":{\"description\":\"Send Effect: Reverb shimmer (Effect Settings view).\"},\"OTT\":{\"description\":\"OTT mix amount (Mixer OTT settings; OTC and OTI default to 80).\"},\"OTC\":{\"description\":\"OTT color (default 80).\"},\"OTI\":{\"description\":\"OTT time (default 80).\"},\"IVO\":{\"description\":\"Alias of VIN as named in the manual: analog input volume (Mixer view).\"},\"IMX\":{\"description\":\"Line Input Mixer: analog input ModFX send (Mixer view).\"},\"IDE\":{\"description\":\"Line Input Mixer: analog input delay send (Mixer view).\"},\"IRV\":{\"description\":\"Line Input Mixer: analog input reverb send (Mixer view). Also referenced as 'IRE' in the manual text.\"},\"IRE\":{\"description\":\"Alias of IRV: analog input reverb send (Mixer view).\"},\"IV2\":{\"description\":\"Line Input Mixer: volume for the 2nd input (right channel in dual-mono input mode, set in the Mixer view).\"},\"IM2\":{\"description\":\"Line Input Mixer: ModFX send for the 2nd input (right channel in dual-mono input mode).\"},\"ID2\":{\"description\":\"Line Input Mixer: delay send for the 2nd input (right channel in dual-mono input mode).\"},\"IR2\":{\"description\":\"Line Input Mixer: reverb send for the 2nd input (right channel in dual-mono input mode).\"},\"USB\":{\"description\":\"USB input volume (Mixer view).\"}}}"),
42
+ instrumentFx: {
43
+ _note: "Instrument commands offered by [EDIT]+[UP/DOWN] (Effect Command Help view) in the Current Instrument section depend on the instrument type; the Instrument Mods section depends on the modulators of that instrument, and Sequencer FX and Mixer/Effects are the same for every type. Lists marked verified were read from a real M8 (Model:02). Wavsynth, External and MIDI Out were not available on that device: their lists are not known here.",
44
+ types: {
45
+ sampler: {
46
+ verified: !0,
47
+ commands: [
48
+ "VOL",
49
+ "PIT",
50
+ "FIN",
51
+ "PLY",
52
+ "STA",
53
+ "LOP",
54
+ "LEN",
55
+ "DEG",
56
+ "FLT",
57
+ "CUT",
58
+ "RES",
59
+ "AMP",
60
+ "LIM",
61
+ "PAN",
62
+ "SLI",
63
+ "ERR",
64
+ "DRY",
65
+ "SMX",
66
+ "SDL",
67
+ "SRV"
68
+ ]
40
69
  },
41
- columns: [
42
- {
43
- x: 3,
44
- width: 2,
45
- key: "track1",
46
- type: "chainRef",
47
- label: "Track 1",
48
- meta: { trackIndex: 1 }
49
- },
50
- {
51
- x: 6,
52
- width: 2,
53
- key: "track2",
54
- type: "chainRef",
55
- label: "Track 2",
56
- meta: { trackIndex: 2 }
57
- },
58
- {
59
- x: 9,
60
- width: 2,
61
- key: "track3",
62
- type: "chainRef",
63
- label: "Track 3",
64
- meta: { trackIndex: 3 }
65
- },
66
- {
67
- x: 12,
68
- width: 2,
69
- key: "track4",
70
- type: "chainRef",
71
- label: "Track 4",
72
- meta: { trackIndex: 4 }
73
- },
74
- {
75
- x: 15,
76
- width: 2,
77
- key: "track5",
78
- type: "chainRef",
79
- label: "Track 5",
80
- meta: { trackIndex: 5 }
81
- },
82
- {
83
- x: 18,
84
- width: 2,
85
- key: "track6",
86
- type: "chainRef",
87
- label: "Track 6",
88
- meta: { trackIndex: 6 }
89
- },
90
- {
91
- x: 21,
92
- width: 2,
93
- key: "track7",
94
- type: "chainRef",
95
- label: "Track 7",
96
- meta: { trackIndex: 7 }
97
- },
98
- {
99
- x: 24,
100
- width: 2,
101
- key: "track8",
102
- type: "chainRef",
103
- label: "Track 8",
104
- meta: { trackIndex: 8 }
105
- }
106
- ]
107
- },
108
- chain: {
109
- title: "Chain View",
110
- type: "grid",
111
- description: "An ordered list of up to 16 phrases. The first '--' phrase ends the chain and loops back to the song.",
112
- rowField: {
113
- x: 0,
114
- width: 1,
115
- parse: "hex",
116
- type: "rowIndex",
117
- key: "chainPos",
118
- description: "Position within the chain (0-F, max 16 entries)."
70
+ macrosynth: {
71
+ verified: !0,
72
+ commands: [
73
+ "VOL",
74
+ "PIT",
75
+ "FIN",
76
+ "OSC",
77
+ "TBR",
78
+ "COL",
79
+ "DEG",
80
+ "RED",
81
+ "FIL",
82
+ "CUT",
83
+ "RES",
84
+ "AMP",
85
+ "LIM",
86
+ "PAN",
87
+ "TRG",
88
+ "ERR",
89
+ "DRY",
90
+ "SMX",
91
+ "SDL",
92
+ "SRV"
93
+ ]
119
94
  },
120
- columns: [{
121
- x: 2,
122
- width: 2,
123
- key: "phrase",
124
- type: "phraseRef",
125
- label: "Phrase (PH)",
126
- description: "Phrase number to play at this chain position."
127
- }, {
128
- x: 5,
129
- width: 2,
130
- key: "transpose",
131
- type: "transpose",
132
- label: "Transpose (TSP)",
133
- description: "Optional note transpose in semitones applied to every note in the phrase (relative hex)."
134
- }]
135
- },
136
- phrase: {
137
- title: "Phrase View",
138
- type: "grid",
139
- description: "A 16-step sequence. Each step holds a note, velocity, instrument assignment, and up to 3 FX command+value pairs.",
140
- rowField: {
141
- x: 0,
142
- width: 1,
143
- parse: "hex",
144
- type: "rowIndex",
145
- key: "step",
146
- description: "Step index 0-F (16th note by default; altered by groove)."
95
+ fmsynth: {
96
+ verified: !0,
97
+ commands: [
98
+ "VOL",
99
+ "PIT",
100
+ "FIN",
101
+ "ALG",
102
+ "FM1",
103
+ "FM2",
104
+ "FM3",
105
+ "FM4",
106
+ "FIL",
107
+ "CUT",
108
+ "RES",
109
+ "AMP",
110
+ "LIM",
111
+ "PAN",
112
+ "SNC",
113
+ "ERR",
114
+ "DRY",
115
+ "SMX",
116
+ "SDL",
117
+ "SRV"
118
+ ]
147
119
  },
148
- columns: [
149
- {
150
- x: 2,
151
- width: 3,
152
- key: "note",
153
- type: "note",
154
- label: "Note (N)"
155
- },
156
- {
157
- x: 6,
158
- width: 2,
159
- key: "vel",
160
- type: "velocity",
161
- label: "Velocity (V)"
162
- },
163
- {
164
- x: 9,
165
- width: 2,
166
- key: "inst",
167
- type: "instrumentRef",
168
- label: "Instrument (I)"
169
- },
170
- {
171
- x: 12,
172
- width: 3,
173
- key: "fx1cmd",
174
- type: "fxCommand",
175
- label: "FX1 Command"
176
- },
177
- {
178
- x: 15,
179
- width: 2,
180
- key: "fx1val",
181
- type: "fxValue",
182
- label: "FX1 Value"
183
- },
184
- {
185
- x: 18,
186
- width: 3,
187
- key: "fx2cmd",
188
- type: "fxCommand",
189
- label: "FX2 Command"
190
- },
191
- {
192
- x: 21,
193
- width: 2,
194
- key: "fx2val",
195
- type: "fxValue",
196
- label: "FX2 Value"
197
- },
198
- {
199
- x: 24,
200
- width: 3,
201
- key: "fx3cmd",
202
- type: "fxCommand",
203
- label: "FX3 Command"
204
- },
205
- {
206
- x: 27,
207
- width: 2,
208
- key: "fx3val",
209
- type: "fxValue",
210
- label: "FX3 Value"
211
- }
212
- ]
213
- },
214
- table: {
215
- title: "Table View",
216
- type: "grid",
217
- description: "A 16-step mini-sequencer that runs alongside an instrument. Used for arpeggios, multi-stage envelopes, and automated FX.",
218
- rowField: {
219
- x: 0,
220
- width: 1,
221
- parse: "hex",
222
- type: "rowIndex",
223
- key: "step",
224
- description: "Table step 0-F. Loops from bottom unless a HOP command redirects."
120
+ hypersynth: {
121
+ verified: !0,
122
+ commands: [
123
+ "VOL",
124
+ "PIT",
125
+ "FIN",
126
+ "CRD",
127
+ "CVO",
128
+ "SWM",
129
+ "WID",
130
+ "SUB",
131
+ "FIL",
132
+ "CUT",
133
+ "RES",
134
+ "AMP",
135
+ "LIM",
136
+ "PAN",
137
+ "SNC",
138
+ "ERR",
139
+ "DRY",
140
+ "SMX",
141
+ "SDL",
142
+ "SRV"
143
+ ]
225
144
  },
226
- columns: [
227
- {
228
- x: 2,
229
- width: 2,
230
- key: "transpose",
231
- type: "transpose",
232
- label: "Transpose (N)",
233
- description: "Transposes the instrument for this step (relative hex). '--' = no transpose."
234
- },
235
- {
236
- x: 5,
237
- width: 2,
238
- key: "volume",
239
- type: "volume",
240
- label: "Volume (V)",
241
- description: "Volume multiplier applied on top of the phrase velocity (hex). '--' = no override."
242
- },
243
- {
244
- x: 8,
245
- width: 3,
246
- key: "fx1cmd",
247
- type: "fxCommand",
248
- label: "FX1 Command",
249
- description: "3-char command name for table FX slot 1."
250
- },
251
- {
252
- x: 11,
253
- width: 2,
254
- key: "fx1val",
255
- type: "fxValue",
256
- label: "FX1 Value",
257
- description: "Value for table FX1."
258
- },
259
- {
260
- x: 14,
261
- width: 3,
262
- key: "fx2cmd",
263
- type: "fxCommand",
264
- label: "FX2 Command",
265
- description: "3-char command name for table FX slot 2."
266
- },
267
- {
268
- x: 17,
269
- width: 2,
270
- key: "fx2val",
271
- type: "fxValue",
272
- label: "FX2 Value",
273
- description: "Value for table FX2."
274
- },
275
- {
276
- x: 20,
277
- width: 3,
278
- key: "fx3cmd",
279
- type: "fxCommand",
280
- label: "FX3 Command",
281
- description: "3-char command name for table FX slot 3."
282
- },
283
- {
284
- x: 23,
285
- width: 2,
286
- key: "fx3val",
287
- type: "fxValue",
288
- label: "FX3 Value",
289
- description: "Value for table FX3."
290
- }
145
+ midiout: {
146
+ verified: !1,
147
+ commands: ["CHD", "ADD"]
148
+ }
149
+ },
150
+ modulation: {
151
+ _note: "Modulator slot N (1-4) offers the commands of its kind. Seen: an envelope slot (AHD) offers EA AT HO DE ET, an LFO slot offers LA LO LS LF LT. Slot kinds vary per instrument (e.g. Sampler 00: env, env, LFO, LFO; Hypersynth 01: env, LFO, LFO, LFO). Other modulator kinds were not captured.",
152
+ envelope: [
153
+ "EA",
154
+ "AT",
155
+ "HO",
156
+ "DE",
157
+ "ET"
158
+ ],
159
+ lfo: [
160
+ "LA",
161
+ "LO",
162
+ "LS",
163
+ "LF",
164
+ "LT"
291
165
  ]
292
166
  },
293
- groove: {
294
- title: "Groove View",
295
- type: "grid",
296
- description: "Defines the timing of each phrase step in ticks. Used to create swing, shuffle, triplets, and other rhythmic feels.",
297
- rowField: {
298
- x: 0,
299
- width: 1,
300
- parse: "hex",
301
- type: "rowIndex",
302
- key: "step",
303
- description: "Groove step 0-F. The groove loops when a '--' entry is reached."
304
- },
305
- columns: [{
306
- x: 2,
307
- width: 2,
308
- key: "ticks",
309
- type: "ticks",
310
- label: "Ticks (TIC)",
311
- description: "Number of ticks this step takes. Default is 06 (at 24 PPQN = 1 sixteenth note). '00' skips the step."
312
- }, {
313
- x: 6,
314
- width: 2,
315
- key: "ppq",
316
- type: "ppq",
317
- label: "PPQ",
318
- description: "Pulses Per Quarter note. Only present on groove row 0; absent on all other rows."
167
+ relativeCommands: { description: "Relative commands add to the instrument parameter's current value (01-7F add, 80-FF subtract) and keep accumulating until a note is triggered with a RET command or with an instrument number in the I column; that resets every parameter to the instrument's own value." }
168
+ }
169
+ }, i = {
170
+ version: "1.0",
171
+ description: "Layouts of the non-grid ('parameter') views: which text at which column is an instrument type, name, parameter, option or action. Column positions were measured on the manual's screenshots (font mode 0, 40 columns) and cross-checked with the phrase view grid; descriptions come from the manual.",
172
+ notes: {
173
+ rows: "A row is recognised by 'match' conditions on the line text (x = column, text = exact text, regex = pattern on the value.width chars). The first matching row wins; its cells give the field columns.",
174
+ zones: "Views whose labels change (instrument parameters depend on the instrument type, modulation slots on the modulation type) use two label/value zones instead: the label text is read at labelX and the value at x. The label is then looked up in the vocabulary.",
175
+ formats: "hex = 2 hex digits; hexOption = 2 hex digits followed by the option name ('00CHORUS'); hexPair = 'XX:YY'; decimal / decimalPair = base-10 numbers ('120', '150:45'); float = decimal with a fraction ('-05.00'); text = free text or option name; auto = detect from the text.",
176
+ unverified: "Positions are read off the manual's screenshots, not from a device capture. Instrument-type specific layouts other than the Wavsynth header/parameter grid (Sampler SAMPLE row, FM operators, Hypersynth chord, MIDI CC rows) are only reached through the generic label/value zones."
177
+ },
178
+ views: /* @__PURE__ */ JSON.parse("{\"project\":{\"rows\":[{\"id\":\"tempo\",\"match\":[{\"x\":0,\"text\":\"TEMPO\"}],\"cells\":[{\"x\":13,\"width\":6,\"key\":\"tempo\",\"type\":\"parameter\",\"format\":\"float\",\"unit\":\" BPM\",\"label\":\"Tempo (TEMPO)\",\"description\":\"Song speed in beats per minute. [EDIT] pressed rhythmically sets the tempo by tapping.\"}]},{\"id\":\"transpose\",\"match\":[{\"x\":0,\"text\":\"TRANSPOSE\"}],\"cells\":[{\"x\":13,\"width\":2,\"key\":\"transpose\",\"type\":\"transpose\",\"format\":\"hex\",\"label\":\"Project Transpose (TRANSPOSE)\",\"description\":\"Transposes the whole song in semitones (same as the TSP command). Only affects instruments with TRANSP. enabled; applied when [EDIT] is released.\"}]},{\"id\":\"groove\",\"match\":[{\"x\":0,\"text\":\"GROOVE\"}],\"cells\":[{\"x\":13,\"width\":14,\"key\":\"groove\",\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"Default Groove (GROOVE)\",\"description\":\"Groove used when the song plays (number and name); applied when [EDIT] is released. See Groove View.\"}]},{\"id\":\"scale\",\"match\":[{\"x\":0,\"text\":\"SCALE\"}],\"cells\":[{\"x\":13,\"width\":16,\"key\":\"scale\",\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"Default Scale (SCALE)\",\"description\":\"Scale (number, key and name) used when the song plays; applied when [EDIT] is released. See Scale View.\"}]},{\"id\":\"liveQuantize\",\"match\":[{\"x\":0,\"text\":\"LIVE QUANTIZ\"}],\"cells\":[{\"x\":13,\"width\":14,\"key\":\"liveQuantize\",\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"Live Quantize (LIVE QUANTIZE)\",\"description\":\"How long a cued chain waits before starting when playing in live mode.\"}]},{\"id\":\"midi\",\"match\":[{\"x\":0,\"text\":\"MIDI\"},{\"x\":13,\"text\":\"SETTINGS\"}],\"cells\":[{\"x\":13,\"width\":8,\"key\":\"midiSettings\",\"type\":\"action\",\"format\":\"text\",\"label\":\"MIDI Settings\",\"description\":\"Open the MIDI Settings View.\"},{\"x\":22,\"width\":8,\"key\":\"midiMappings\",\"type\":\"action\",\"format\":\"text\",\"label\":\"MIDI Mappings\",\"description\":\"Open the MIDI Mappings View.\"}]},{\"id\":\"name\",\"match\":[{\"x\":0,\"text\":\"NAME\"}],\"cells\":[{\"x\":13,\"width\":12,\"key\":\"name\",\"type\":\"name\",\"format\":\"text\",\"label\":\"Song Name (NAME)\",\"description\":\"Name of the current song, entered before saving.\"}]},{\"id\":\"file\",\"match\":[{\"x\":0,\"text\":\"PROJECT\"},{\"x\":13,\"text\":\"LOAD\"}],\"cells\":[{\"x\":13,\"width\":4,\"key\":\"load\",\"type\":\"action\",\"format\":\"text\",\"label\":\"Load Song\",\"description\":\"Load a song from the SD card.\"},{\"x\":18,\"width\":4,\"key\":\"save\",\"type\":\"action\",\"format\":\"text\",\"label\":\"Save Song\",\"description\":\"Save the current song.\"},{\"x\":23,\"width\":3,\"key\":\"new\",\"type\":\"action\",\"format\":\"text\",\"label\":\"New Song\",\"description\":\"Create a new song.\"}]},{\"id\":\"export\",\"match\":[{\"x\":0,\"text\":\"EXPORT/SHARE\"}],\"cells\":[{\"x\":13,\"width\":6,\"key\":\"render\",\"type\":\"action\",\"format\":\"text\",\"label\":\"Render\",\"description\":\"Open the Render View to render audio.\"},{\"x\":20,\"width\":6,\"key\":\"bundle\",\"type\":\"action\",\"format\":\"text\",\"label\":\"Bundle\",\"description\":\"Bundle the song with the instruments and samples it uses.\"}]},{\"id\":\"clearUnused\",\"match\":[{\"x\":0,\"text\":\"CLEAR UNUSED\"}],\"cells\":[{\"x\":13,\"width\":7,\"key\":\"clearPhrases\",\"type\":\"action\",\"format\":\"text\",\"label\":\"Clear Unused Phrases\",\"description\":\"Frees chains and phrases that are not used in the song.\"},{\"x\":21,\"width\":8,\"key\":\"clearInstTbl\",\"type\":\"action\",\"format\":\"text\",\"label\":\"Clear Unused Instruments/Tables\",\"description\":\"Frees instruments, EQs and tables that are not used in the song.\"}]},{\"id\":\"instPool\",\"match\":[{\"x\":0,\"text\":\"INST. POOL\"}],\"cells\":[{\"x\":13,\"width\":15,\"key\":\"viewInstPool\",\"type\":\"action\",\"format\":\"text\",\"label\":\"View Instrument Pool\",\"description\":\"Go to the Instrument Pool View.\"}]},{\"id\":\"timeStats\",\"match\":[{\"x\":0,\"text\":\"TIME STATS\"}],\"cells\":[{\"x\":13,\"width\":15,\"key\":\"viewTimeStats\",\"type\":\"action\",\"format\":\"text\",\"label\":\"View Time Stats\",\"description\":\"Open the Time Stats View (time spent on the song).\"}]},{\"id\":\"system\",\"match\":[{\"x\":0,\"text\":\"SYSTEM\"},{\"x\":13,\"text\":\"SETTINGS\"}],\"cells\":[{\"x\":13,\"width\":8,\"key\":\"systemSettings\",\"type\":\"action\",\"format\":\"text\",\"label\":\"System Settings\",\"description\":\"Go to the System Settings View.\"},{\"x\":22,\"width\":9,\"key\":\"usbDrive\",\"type\":\"action\",\"format\":\"text\",\"label\":\"USB Drive\",\"description\":\"Puts the M8 in USB drive mode so SD card files can be transferred to a computer.\"}]}]},\"systemsettings\":{\"rows\":[{\"id\":\"backlight\",\"match\":[{\"x\":0,\"text\":\"BACKLIGHT\"}],\"cells\":[{\"x\":15,\"width\":2,\"key\":\"backlight\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Backlight (BACKLIGHT)\",\"description\":\"Backlight LED brightness of the display.\"}]},{\"id\":\"fontOptions\",\"match\":[{\"x\":0,\"text\":\"FONT OPTIONS\"}],\"cells\":[{\"x\":15,\"width\":15,\"key\":\"fontOptions\",\"type\":\"option\",\"format\":\"text\",\"label\":\"Font Options (FONT OPTIONS)\",\"description\":\"Font settings, including a large font mode for readability.\"}]},{\"id\":\"theme\",\"match\":[{\"x\":0,\"text\":\"THEME\"}],\"cells\":[{\"x\":15,\"width\":10,\"key\":\"editTheme\",\"type\":\"action\",\"format\":\"text\",\"label\":\"Theme (EDIT THEME)\",\"description\":\"Open the Theme View.\"}]},{\"id\":\"notePreview\",\"match\":[{\"x\":0,\"text\":\"NOTE PREVIEW\"}],\"cells\":[{\"x\":15,\"width\":3,\"key\":\"notePreview\",\"type\":\"onOff\",\"format\":\"text\",\"label\":\"Note Preview (NOTE PREVIEW)\",\"description\":\"Plays the note when editing notes in the phrase view.\"}]},{\"id\":\"recCountIn\",\"match\":[{\"x\":0,\"regex\":\"^REC\\\\.\\\\s?(COUNT IN|METRONOME)\\\\s*$\",\"width\":13}],\"cells\":[{\"x\":15,\"width\":6,\"key\":\"recCountIn\",\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"Recording Count-in (REC. COUNT IN)\",\"description\":\"Number of phrases/measures of metronome count-in before recording audio in the Sample Editor or Selection to Sample.\"}]},{\"id\":\"metronomeVol\",\"match\":[{\"x\":0,\"text\":\"METRONOME VOL\"}],\"cells\":[{\"x\":15,\"width\":2,\"key\":\"metronomeVol\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Metronome Volume (METRONOME VOL)\",\"description\":\"Volume of the metronome sound (edit /System/Metronome.m8i to change the sound).\"}]},{\"id\":\"songTemplate\",\"match\":[{\"x\":0,\"text\":\"SONG TEMPLATE\"}],\"cells\":[{\"x\":15,\"width\":4,\"key\":\"songTemplateSave\",\"type\":\"action\",\"format\":\"text\",\"label\":\"Song Template (SAVE)\",\"description\":\"Use the currently opened song as the template for new songs.\"},{\"x\":20,\"width\":5,\"key\":\"songTemplateClear\",\"type\":\"action\",\"format\":\"text\",\"label\":\"Song Template (CLEAR)\",\"description\":\"Clear the song template.\"}]},{\"id\":\"usbAudioMode\",\"match\":[{\"x\":0,\"text\":\"USB AUDIO MODE\"}],\"cells\":[{\"x\":15,\"width\":14,\"key\":\"usbAudioMode\",\"type\":\"option\",\"format\":\"text\",\"label\":\"USB Audio Mode (USB AUDIO MODE)\",\"description\":\"USB output as stereo or multi-channel (multi-channel sends all 8 tracks and the effects individually, 12 stereo channels).\",\"options\":{\"STEREO OUT\":\"Stereo mix over USB.\"}}]},{\"id\":\"usbMainOut\",\"match\":[{\"x\":0,\"text\":\"USB MAIN OUT\"}],\"cells\":[{\"x\":15,\"width\":6,\"key\":\"usbMainOut\",\"type\":\"option\",\"format\":\"text\",\"label\":\"USB Main Out (USB MAIN OUT)\",\"description\":\"Routing behaviour of USB audio (see the USB audio routing options).\"}]},{\"id\":\"lineInGate\",\"match\":[{\"x\":0,\"text\":\"LINE-IN GATE\"}],\"cells\":[{\"x\":15,\"width\":6,\"key\":\"lineInGate\",\"type\":\"option\",\"format\":\"text\",\"label\":\"Line-in Gate (LINE-IN GATE)\",\"description\":\"Noise gate threshold for the line input, adjustable from -70 dB to -10 dB (OFF disables it).\"}]},{\"id\":\"splashScreen\",\"match\":[{\"x\":0,\"text\":\"SPLASH SCREEN\"}],\"cells\":[{\"x\":15,\"width\":3,\"key\":\"splashScreen\",\"type\":\"onOff\",\"format\":\"text\",\"label\":\"Splash Screen (SPLASH SCREEN)\",\"description\":\"Show the M8 logo and play the start-up sound when turning on the device.\"}]},{\"id\":\"hpProtection\",\"match\":[{\"x\":0,\"text\":\"HP PROTECTION\"}],\"cells\":[{\"x\":15,\"width\":3,\"key\":\"hpProtection\",\"type\":\"onOff\",\"format\":\"text\",\"label\":\"Headphone Protection (HP PROTECTION)\",\"description\":\"Limits the headphone output volume to F0 when a pack is unplugged and re-inserted.\"}]},{\"id\":\"keyDelayRep\",\"match\":[{\"x\":0,\"text\":\"KEY DELAY:REP\"}],\"cells\":[{\"x\":15,\"width\":7,\"key\":\"keyDelayRep\",\"type\":\"parameter\",\"format\":\"decimalPair\",\"unit\":\" ms\",\"parts\":[\"delay\",\"repeat\"],\"label\":\"Key Delay:Repeat (KEY DELAY:REP)\",\"description\":\"Key repeat timing in milliseconds: delay before a held key starts repeating, then the time between repeats.\"}]},{\"id\":\"battCharging\",\"match\":[{\"x\":0,\"regex\":\"^BATT\\\\.\\\\s?(CHARGING|STATUS)\\\\s*$\",\"width\":14}],\"cells\":[{\"x\":15,\"width\":14,\"key\":\"battCharging\",\"type\":\"option\",\"format\":\"text\",\"label\":\"Battery Charging (BATT. CHARGING / STATUS)\",\"description\":\"Whether the battery charges while the M8 is on and USB is connected (turn off to reduce power drawn from the host); also shows the current charging status.\"}]}]},\"effectsettings\":{\"sections\":[\"MODFX\",\"DELAY\",\"REVERB\"],\"rows\":[{\"id\":\"modfxType\",\"section\":\"MODFX\",\"match\":[{\"x\":7,\"text\":\"MOD TYPE\"}],\"cells\":[{\"x\":21,\"width\":10,\"key\":\"modfxType\",\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"ModFX Type (MOD TYPE)\",\"description\":\"ModFX effect: Chorus, Phaser or Flanger (also sets the phase position).\",\"options\":{\"CHORUS\":\"Stereo chorus.\",\"PHASER\":\"Stereo phaser.\",\"FLANGER\":\"Stereo flanger.\"}}]},{\"id\":\"modfxInputEq\",\"section\":\"MODFX\",\"match\":[{\"x\":7,\"text\":\"INPUT EQ\"}],\"cells\":[{\"x\":21,\"width\":2,\"key\":\"modfxInputEq\",\"type\":\"action\",\"format\":\"text\",\"label\":\"Input EQ (INPUT EQ)\",\"description\":\"Open the EQ editor for this effect's input.\"}]},{\"id\":\"modfxDepthFreq\",\"section\":\"MODFX\",\"match\":[{\"x\":7,\"text\":\"MOD DEPTH:FRQ\"}],\"cells\":[{\"x\":21,\"width\":5,\"key\":\"modfxDepthFreq\",\"type\":\"parameter\",\"format\":\"hexPair\",\"parts\":[\"mod depth\",\"mod frequency\"],\"label\":\"ModFX Mod Depth:Frequency (MOD DEPTH:FRQ)\",\"description\":\"Amount of modulation in the stereo signal (first value) and speed of the modulation (second value).\"}]},{\"id\":\"modfxWidth\",\"section\":\"MODFX\",\"match\":[{\"x\":7,\"text\":\"STEREO WIDTH\"}],\"cells\":[{\"x\":21,\"width\":2,\"key\":\"modfxWidth\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Stereo Width (STEREO WIDTH)\",\"description\":\"Stereo width: 00 is mono, FF is stereo.\"}]},{\"id\":\"modfxReverbSend\",\"section\":\"MODFX\",\"match\":[{\"x\":7,\"text\":\"REVERB SEND\"}],\"cells\":[{\"x\":21,\"width\":2,\"key\":\"modfxReverbSend\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Reverb Send (REVERB SEND)\",\"description\":\"Amount of this effect sent to the reverb.\"}]},{\"id\":\"delayInputEq\",\"section\":\"DELAY\",\"match\":[{\"x\":7,\"text\":\"INPUT EQ\"}],\"cells\":[{\"x\":21,\"width\":2,\"key\":\"delayInputEq\",\"type\":\"action\",\"format\":\"text\",\"label\":\"Input EQ (INPUT EQ)\",\"description\":\"Open the EQ editor for this effect's input.\"}]},{\"id\":\"delayTime\",\"section\":\"DELAY\",\"match\":[{\"x\":7,\"text\":\"TIME L:R\"}],\"cells\":[{\"x\":21,\"width\":5,\"key\":\"delayTime\",\"type\":\"parameter\",\"format\":\"hexPair\",\"parts\":[\"left time\",\"right time\"],\"label\":\"Delay Time L:R (TIME L:R)\",\"description\":\"Delay time for the left and right channels: first digit in beats, second digit in fractions of a beat (40 is 4 beats).\"}]},{\"id\":\"delayFeedback\",\"section\":\"DELAY\",\"match\":[{\"x\":7,\"text\":\"FEEDBACK\"}],\"cells\":[{\"x\":21,\"width\":2,\"key\":\"delayFeedback\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Feedback (FEEDBACK)\",\"description\":\"Amount of the delayed signal fed back into the delay.\"}]},{\"id\":\"delayWidth\",\"section\":\"DELAY\",\"match\":[{\"x\":7,\"text\":\"STEREO WIDTH\"}],\"cells\":[{\"x\":21,\"width\":2,\"key\":\"delayWidth\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Stereo Width (STEREO WIDTH)\",\"description\":\"Stereo width: 00 is mono, FF is stereo.\"}]},{\"id\":\"delayReverbSend\",\"section\":\"DELAY\",\"match\":[{\"x\":7,\"text\":\"REVERB SEND\"}],\"cells\":[{\"x\":21,\"width\":2,\"key\":\"delayReverbSend\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Reverb Send (REVERB SEND)\",\"description\":\"Amount of this effect sent to the reverb.\"}]},{\"id\":\"reverbInputEq\",\"section\":\"REVERB\",\"match\":[{\"x\":7,\"text\":\"INPUT EQ\"}],\"cells\":[{\"x\":21,\"width\":2,\"key\":\"reverbInputEq\",\"type\":\"action\",\"format\":\"text\",\"label\":\"Input EQ (INPUT EQ)\",\"description\":\"Open the EQ editor for this effect's input.\"}]},{\"id\":\"reverbRoomSize\",\"section\":\"REVERB\",\"match\":[{\"x\":7,\"text\":\"ROOM SIZE\"}],\"cells\":[{\"x\":21,\"width\":2,\"key\":\"reverbRoomSize\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Room Size (ROOM SIZE)\",\"description\":\"Size of the reverb room.\"}]},{\"id\":\"reverbDecayShimmer\",\"section\":\"REVERB\",\"match\":[{\"x\":7,\"text\":\"DECAY:SHIMMER\"}],\"cells\":[{\"x\":21,\"width\":5,\"key\":\"reverbDecayShimmer\",\"type\":\"parameter\",\"format\":\"hexPair\",\"parts\":[\"decay\",\"shimmer\"],\"label\":\"Reverb Decay:Shimmer (DECAY:SHIMMER)\",\"description\":\"Reverb decay time (first value) and shimmer amount (second value).\"}]},{\"id\":\"reverbDepthFreq\",\"section\":\"REVERB\",\"match\":[{\"x\":7,\"text\":\"MOD DEPTH:FRQ\"}],\"cells\":[{\"x\":21,\"width\":5,\"key\":\"reverbDepthFreq\",\"type\":\"parameter\",\"format\":\"hexPair\",\"parts\":[\"mod depth\",\"mod frequency\"],\"label\":\"Reverb Mod Depth:Frequency (MOD DEPTH:FRQ)\",\"description\":\"Reverb modulation depth (first value) and frequency (second value).\"}]},{\"id\":\"reverbWidth\",\"section\":\"REVERB\",\"match\":[{\"x\":7,\"text\":\"STEREO WIDTH\"}],\"cells\":[{\"x\":21,\"width\":2,\"key\":\"reverbWidth\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Stereo Width (STEREO WIDTH)\",\"description\":\"Stereo width: 00 is mono, FF is stereo.\"}]}]},\"mixer\":{\"rows\":[{\"id\":\"speaker\",\"match\":[{\"x\":0,\"text\":\"SPEAKER\"}],\"cells\":[{\"x\":12,\"width\":2,\"key\":\"speakerVol\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Speaker Volume (SPEAKER VOL)\",\"description\":\"Volume of the built-in speaker.\"}]},{\"id\":\"outputVol\",\"match\":[{\"x\":0,\"text\":\"OUTPUT VOL\"}],\"cells\":[{\"x\":12,\"width\":2,\"key\":\"outputVol\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Output Volume (OUTPUT VOL)\",\"description\":\"Volume of the audio output (headphones / line out).\"}]},{\"id\":\"tracks\",\"match\":[{\"x\":0,\"regex\":\"^[0-9A-F]{2}$\",\"width\":2},{\"x\":21,\"regex\":\"^[0-9A-F]{2}$\",\"width\":2}],\"cells\":[{\"x\":0,\"width\":2,\"key\":\"track1\",\"type\":\"volume\",\"format\":\"hex\",\"label\":\"Track 1 Volume\",\"meta\":{\"trackIndex\":1},\"description\":\"Volume of track 1. Instrument volumes are applied on top; the track's send levels are set in the instruments.\"},{\"x\":3,\"width\":2,\"key\":\"track2\",\"type\":\"volume\",\"format\":\"hex\",\"label\":\"Track 2 Volume\",\"meta\":{\"trackIndex\":2},\"description\":\"Volume of track 2.\"},{\"x\":6,\"width\":2,\"key\":\"track3\",\"type\":\"volume\",\"format\":\"hex\",\"label\":\"Track 3 Volume\",\"meta\":{\"trackIndex\":3},\"description\":\"Volume of track 3.\"},{\"x\":9,\"width\":2,\"key\":\"track4\",\"type\":\"volume\",\"format\":\"hex\",\"label\":\"Track 4 Volume\",\"meta\":{\"trackIndex\":4},\"description\":\"Volume of track 4.\"},{\"x\":12,\"width\":2,\"key\":\"track5\",\"type\":\"volume\",\"format\":\"hex\",\"label\":\"Track 5 Volume\",\"meta\":{\"trackIndex\":5},\"description\":\"Volume of track 5.\"},{\"x\":15,\"width\":2,\"key\":\"track6\",\"type\":\"volume\",\"format\":\"hex\",\"label\":\"Track 6 Volume\",\"meta\":{\"trackIndex\":6},\"description\":\"Volume of track 6.\"},{\"x\":18,\"width\":2,\"key\":\"track7\",\"type\":\"volume\",\"format\":\"hex\",\"label\":\"Track 7 Volume\",\"meta\":{\"trackIndex\":7},\"description\":\"Volume of track 7.\"},{\"x\":21,\"width\":2,\"key\":\"track8\",\"type\":\"volume\",\"format\":\"hex\",\"label\":\"Track 8 Volume\",\"meta\":{\"trackIndex\":8},\"description\":\"Volume of track 8.\"}]},{\"id\":\"eq\",\"match\":[{\"x\":27,\"text\":\"EQ\"}],\"cells\":[{\"x\":27,\"width\":2,\"key\":\"mixEq\",\"type\":\"action\",\"format\":\"text\",\"label\":\"Main Mix EQ (EQ)\",\"description\":\"Open the main mix EQ editor ([EDIT] or [SHIFT]+[RIGHT]).\"}]},{\"id\":\"levels\",\"match\":[{\"x\":0,\"regex\":\"^[0-9A-F]{2}$\",\"width\":2},{\"x\":3,\"regex\":\"^[0-9A-F]{2}$\",\"width\":2},{\"x\":6,\"regex\":\"^[0-9A-F]{2}$\",\"width\":2},{\"x\":12,\"regex\":\"^[0-9A-F]{2}$\",\"width\":2}],\"cells\":[{\"x\":0,\"width\":2,\"key\":\"modfxVol\",\"type\":\"volume\",\"format\":\"hex\",\"label\":\"ModFX Volume (MX)\",\"description\":\"Output level of the ModFX send effect.\"},{\"x\":3,\"width\":2,\"key\":\"delayVol\",\"type\":\"volume\",\"format\":\"hex\",\"label\":\"Delay Volume (DE)\",\"description\":\"Output level of the delay send effect.\"},{\"x\":6,\"width\":2,\"key\":\"reverbVol\",\"type\":\"volume\",\"format\":\"hex\",\"label\":\"Reverb Volume (RE)\",\"description\":\"Output level of the reverb send effect.\"},{\"x\":12,\"width\":2,\"key\":\"inputVol\",\"type\":\"volume\",\"format\":\"hex\",\"label\":\"Analog Input Volume (INPUT)\",\"description\":\"Volume of the analog input for monitoring. In dual-mono mode this is the left channel.\"},{\"x\":15,\"width\":2,\"key\":\"inputVol2\",\"type\":\"volume\",\"format\":\"hex\",\"label\":\"Analog Input Volume, 2nd channel\",\"description\":\"Enables dual-mono input mode when set (right channel volume); clear with [EDIT]+[OPTION] to disable.\"},{\"x\":18,\"width\":2,\"key\":\"usbVol\",\"type\":\"volume\",\"format\":\"hex\",\"label\":\"USB Input Volume (USB)\",\"description\":\"Volume of anything the USB host computer sends to the M8.\"},{\"x\":27,\"width\":2,\"key\":\"mainVol\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Main Volume (MIX)\",\"description\":\"Main song volume, applied after the limiter, DJ filter and OTT. [EDIT] or [SHIFT]+[RIGHT] opens the Mix Scope.\"}]},{\"id\":\"limiter\",\"match\":[{\"x\":0,\"text\":\"MX\"},{\"x\":3,\"text\":\"DE\"},{\"x\":6,\"text\":\"RE\"}],\"cells\":[{\"x\":27,\"width\":2,\"key\":\"limiter\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Limiter (LIM)\",\"description\":\"Main mix limiter amount; the limiter is engaged when the value is above 00. [EDIT] or [SHIFT]+[RIGHT] opens the Limiter Scope.\"}]},{\"id\":\"sendModfx\",\"match\":[{\"x\":9,\"text\":\"MX\"}],\"cells\":[{\"x\":12,\"width\":2,\"key\":\"inputModfx\",\"type\":\"volume\",\"format\":\"hex\",\"label\":\"Analog Input ModFX Send (INPUT MX)\",\"description\":\"How much of the analog input goes to the ModFX effect.\"},{\"x\":18,\"width\":2,\"key\":\"usbModfx\",\"type\":\"volume\",\"format\":\"hex\",\"label\":\"USB Input ModFX Send (USB MX)\",\"description\":\"How much of the USB input goes to the ModFX effect.\"},{\"x\":27,\"width\":2,\"key\":\"djFilter\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"DJ Filter (DJF)\",\"description\":\"DJ filter cutoff: 80 is off, below 80 low-pass (or band-stop), above 80 high-pass. Mode and options are in the Scope View.\"}]},{\"id\":\"sendDelay\",\"match\":[{\"x\":9,\"text\":\"DE\"}],\"cells\":[{\"x\":12,\"width\":2,\"key\":\"inputDelay\",\"type\":\"volume\",\"format\":\"hex\",\"label\":\"Analog Input Delay Send (INPUT DE)\",\"description\":\"How much of the analog input goes to the delay effect.\"},{\"x\":18,\"width\":2,\"key\":\"usbDelay\",\"type\":\"volume\",\"format\":\"hex\",\"label\":\"USB Input Delay Send (USB DE)\",\"description\":\"How much of the USB input goes to the delay effect.\"},{\"x\":27,\"width\":2,\"key\":\"ott\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"OTT (OTT)\",\"description\":\"Over The Top multi-band compression mixed in parallel: 00 to 80 mixes it in; from 80 and above the main mix is faded out.\"}]},{\"id\":\"sendReverb\",\"match\":[{\"x\":9,\"text\":\"RE\"}],\"cells\":[{\"x\":12,\"width\":2,\"key\":\"inputReverb\",\"type\":\"volume\",\"format\":\"hex\",\"label\":\"Analog Input Reverb Send (INPUT RE)\",\"description\":\"How much of the analog input goes to the reverb effect.\"},{\"x\":18,\"width\":2,\"key\":\"usbReverb\",\"type\":\"volume\",\"format\":\"hex\",\"label\":\"USB Input Reverb Send (USB RE)\",\"description\":\"How much of the USB input goes to the reverb effect.\"}]}]},\"mixeq\":{\"rows\":[{\"id\":\"gain\",\"match\":[{\"x\":0,\"text\":\"GAIN\"}],\"cells\":[{\"x\":5,\"width\":6,\"key\":\"lowGain\",\"type\":\"parameter\",\"format\":\"float\",\"unit\":\" dB\",\"label\":\"LOW Gain\",\"description\":\"Boost (positive) or cut (negative) applied by the LOW band, in decibels.\"},{\"x\":16,\"width\":6,\"key\":\"midGain\",\"type\":\"parameter\",\"format\":\"float\",\"unit\":\" dB\",\"label\":\"MID Gain\",\"description\":\"Boost (positive) or cut (negative) applied by the MID band, in decibels.\"},{\"x\":27,\"width\":6,\"key\":\"highGain\",\"type\":\"parameter\",\"format\":\"float\",\"unit\":\" dB\",\"label\":\"HIGH Gain\",\"description\":\"Boost (positive) or cut (negative) applied by the HIGH band, in decibels.\"}]},{\"id\":\"freq\",\"match\":[{\"x\":0,\"text\":\"FREQ\"}],\"cells\":[{\"x\":6,\"width\":5,\"key\":\"lowFreq\",\"type\":\"parameter\",\"format\":\"decimal\",\"unit\":\" Hz\",\"label\":\"LOW Frequency\",\"description\":\"Centre (or corner) frequency of the LOW band.\"},{\"x\":17,\"width\":5,\"key\":\"midFreq\",\"type\":\"parameter\",\"format\":\"decimal\",\"unit\":\" Hz\",\"label\":\"MID Frequency\",\"description\":\"Centre (or corner) frequency of the MID band.\"},{\"x\":28,\"width\":5,\"key\":\"highFreq\",\"type\":\"parameter\",\"format\":\"decimal\",\"unit\":\" Hz\",\"label\":\"HIGH Frequency\",\"description\":\"Centre (or corner) frequency of the HIGH band.\"}]},{\"id\":\"q\",\"match\":[{\"x\":0,\"text\":\"Q\"},{\"x\":1,\"regex\":\"^\\\\s?$\",\"width\":1}],\"cells\":[{\"x\":6,\"width\":3,\"key\":\"lowQ\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"LOW Q\",\"description\":\"Quality factor (bandwidth) of the LOW band: higher values narrow it.\"},{\"x\":17,\"width\":3,\"key\":\"midQ\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"MID Q\",\"description\":\"Quality factor (bandwidth) of the MID band: higher values narrow it.\"},{\"x\":28,\"width\":3,\"key\":\"highQ\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"HIGH Q\",\"description\":\"Quality factor (bandwidth) of the HIGH band: higher values narrow it.\"}]},{\"id\":\"type\",\"match\":[{\"x\":0,\"text\":\"TYPE\"}],\"cells\":[{\"x\":6,\"width\":9,\"key\":\"lowType\",\"type\":\"option\",\"format\":\"text\",\"label\":\"LOW Type\",\"description\":\"Filter shape of the LOW band.\",\"options\":{\"LOWCUT\":\"Removes frequencies below the cutoff.\",\"LOWSHELF\":\"Boosts or cuts frequencies below the shelf frequency.\",\"BELL\":\"Peaking filter: boosts or cuts around the centre frequency.\",\"BANDPASS\":\"Passes frequencies around the centre frequency, attenuating both sides.\",\"HI.SHELF\":\"Boosts or cuts frequencies above the shelf frequency.\",\"HI.CUT\":\"Attenuates or removes frequencies above the cutoff.\",\"ALLPASS\":\"Passes all frequencies at equal gain while shifting their phase.\"}},{\"x\":17,\"width\":9,\"key\":\"midType\",\"type\":\"option\",\"format\":\"text\",\"label\":\"MID Type\",\"description\":\"Filter shape of the MID band.\",\"options\":{\"LOWCUT\":\"Removes frequencies below the cutoff.\",\"LOWSHELF\":\"Boosts or cuts frequencies below the shelf frequency.\",\"BELL\":\"Peaking filter: boosts or cuts around the centre frequency.\",\"BANDPASS\":\"Passes frequencies around the centre frequency, attenuating both sides.\",\"HI.SHELF\":\"Boosts or cuts frequencies above the shelf frequency.\",\"HI.CUT\":\"Attenuates or removes frequencies above the cutoff.\",\"ALLPASS\":\"Passes all frequencies at equal gain while shifting their phase.\"}},{\"x\":28,\"width\":9,\"key\":\"highType\",\"type\":\"option\",\"format\":\"text\",\"label\":\"HIGH Type\",\"description\":\"Filter shape of the HIGH band.\",\"options\":{\"LOWCUT\":\"Removes frequencies below the cutoff.\",\"LOWSHELF\":\"Boosts or cuts frequencies below the shelf frequency.\",\"BELL\":\"Peaking filter: boosts or cuts around the centre frequency.\",\"BANDPASS\":\"Passes frequencies around the centre frequency, attenuating both sides.\",\"HI.SHELF\":\"Boosts or cuts frequencies above the shelf frequency.\",\"HI.CUT\":\"Attenuates or removes frequencies above the cutoff.\",\"ALLPASS\":\"Passes all frequencies at equal gain while shifting their phase.\"}}]},{\"id\":\"mode\",\"match\":[{\"x\":0,\"text\":\"MODE\"}],\"cells\":[{\"x\":6,\"width\":6,\"key\":\"lowMode\",\"type\":\"option\",\"format\":\"text\",\"label\":\"LOW Mode\",\"description\":\"How the LOW band is applied to the stereo signal.\",\"options\":{\"STEREO\":\"Processes left and right identically.\",\"MID\":\"Affects only the mid (centre) information.\",\"SIDE\":\"Affects only the side information (difference between left and right).\",\"LEFT\":\"Affects only the left channel.\",\"RIGHT\":\"Affects only the right channel.\"}},{\"x\":17,\"width\":6,\"key\":\"midMode\",\"type\":\"option\",\"format\":\"text\",\"label\":\"MID Mode\",\"description\":\"How the MID band is applied to the stereo signal.\",\"options\":{\"STEREO\":\"Processes left and right identically.\",\"MID\":\"Affects only the mid (centre) information.\",\"SIDE\":\"Affects only the side information (difference between left and right).\",\"LEFT\":\"Affects only the left channel.\",\"RIGHT\":\"Affects only the right channel.\"}},{\"x\":28,\"width\":6,\"key\":\"highMode\",\"type\":\"option\",\"format\":\"text\",\"label\":\"HIGH Mode\",\"description\":\"How the HIGH band is applied to the stereo signal.\",\"options\":{\"STEREO\":\"Processes left and right identically.\",\"MID\":\"Affects only the mid (centre) information.\",\"SIDE\":\"Affects only the side information (difference between left and right).\",\"LEFT\":\"Affects only the left channel.\",\"RIGHT\":\"Affects only the right channel.\"}}]}]},\"modfxeq\":{\"extends\":\"mixeq\"},\"delayeq\":{\"extends\":\"mixeq\"},\"reverbeq\":{\"extends\":\"mixeq\"},\"mixscope\":{\"rows\":[{\"id\":\"limiterAtkRel\",\"match\":[{\"x\":9,\"text\":\"ATK\"},{\"x\":16,\"text\":\"REL\"},{\"x\":23,\"text\":\"LIM\"}],\"cells\":[{\"x\":13,\"width\":2,\"key\":\"attack\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Limiter Attack (ATK)\",\"description\":\"Limiter attack time from 0 to 100 ms (see the on-screen help text for the conversion to milliseconds).\"},{\"x\":20,\"width\":2,\"key\":\"release\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Limiter Release (REL)\",\"description\":\"Limiter release time from 4 to 1000 ms; 00 activates AUTO mode (100-900 ms depending on the compression amount).\"},{\"x\":27,\"width\":2,\"key\":\"limiter\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Limiter (LIM)\",\"description\":\"Limiter amount.\"}]},{\"id\":\"zoomPeak\",\"match\":[{\"x\":0,\"text\":\"ZOOM\"}],\"cells\":[{\"x\":5,\"width\":5,\"key\":\"zoom\",\"type\":\"parameter\",\"format\":\"text\",\"label\":\"Zoom (ZOOM)\",\"description\":\"Lower limit of the scope histogram, in decibels.\"},{\"x\":20,\"width\":6,\"key\":\"peak\",\"type\":\"parameter\",\"format\":\"float\",\"unit\":\" dB\",\"label\":\"Peak (PEAK)\",\"description\":\"Current peak level of the main mix in dB. Resets when MIX or LIM change; clear it with [OPT]+[EDIT].\"}]},{\"id\":\"eq\",\"match\":[{\"x\":27,\"text\":\"EQ\"}],\"cells\":[{\"x\":27,\"width\":2,\"key\":\"mixEq\",\"type\":\"action\",\"format\":\"text\",\"label\":\"Main Mix EQ (EQ)\",\"description\":\"Open the main mix EQ editor.\"}]},{\"id\":\"softClip\",\"match\":[{\"x\":9,\"text\":\"SOFT CLIP\"}],\"cells\":[{\"x\":19,\"width\":3,\"key\":\"softClip\",\"type\":\"onOff\",\"format\":\"text\",\"label\":\"Soft Clip (SOFT CLIP)\",\"description\":\"Gentle saturation after the limiter to prevent harsh clipping; raise MIX to exaggerate it.\"},{\"x\":27,\"width\":2,\"key\":\"mainVol\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Main Volume (MIX)\",\"description\":\"Main mix / song volume, applied after the limiter stage.\"}]},{\"id\":\"mix\",\"match\":[{\"x\":23,\"text\":\"MIX\"}],\"cells\":[{\"x\":27,\"width\":2,\"key\":\"mainVol\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Main Volume (MIX)\",\"description\":\"Main mix / song volume, applied after the limiter stage.\"}]},{\"id\":\"lim\",\"match\":[{\"x\":23,\"text\":\"LIM\"}],\"cells\":[{\"x\":27,\"width\":2,\"key\":\"limiter\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Limiter (LIM)\",\"description\":\"Limiter amount.\"}]},{\"id\":\"djf\",\"match\":[{\"x\":23,\"text\":\"DJF\"}],\"cells\":[{\"x\":27,\"width\":2,\"key\":\"djFilter\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"DJ Filter (DJF)\",\"description\":\"DJ filter cutoff: 80 is off, 00-80 low-pass, 80-FF high-pass (mode set with TYPE).\"}]},{\"id\":\"ott\",\"match\":[{\"x\":23,\"text\":\"OTT\"}],\"cells\":[{\"x\":27,\"width\":2,\"key\":\"ott\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"OTT (OTT)\",\"description\":\"OTT mix amount; from 80 and above the main mix volume is faded out.\"}]}],\"zones\":[{\"id\":\"right\",\"labelX\":23,\"labelWidth\":4,\"x\":27,\"width\":6}],\"vocabulary\":{\"ATK\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Limiter Attack (ATK)\",\"description\":\"Limiter attack time from 0 to 100 ms (see the on-screen help text for the conversion).\"},\"REL\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Limiter Release (REL)\",\"description\":\"Limiter release time from 4 to 1000 ms; 00 activates AUTO mode (100-900 ms depending on the compression amount).\"},\"TYPE\":{\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"DJ Filter Type (TYPE)\",\"description\":\"DJ filter type: low-pass/high-pass, low-pass/band-stop or band-stop/high-pass.\"},\"RES\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"DJ Filter Resonance (RES)\",\"description\":\"Resonance of the DJ filter.\"},\"TIME\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"OTT Time (TIME)\",\"description\":\"OTT compressor envelope time as a percentage from 10% to 1000%.\"},\"COLOR\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"OTT Color (COLOR)\",\"description\":\"OTT compressor bands and low/high gains: above 80 shifts toward treble, below 80 toward bass.\"}}},\"limiterscope\":{\"extends\":\"mixscope\"},\"inst\":{\"rows\":[{\"id\":\"type\",\"match\":[{\"x\":0,\"text\":\"TYPE\"}],\"cells\":[{\"x\":8,\"width\":13,\"key\":\"instrumentType\",\"type\":\"instrumentType\",\"format\":\"text\",\"label\":\"Instrument Type (TYPE)\",\"description\":\"Kind of instrument in this slot: Wavsynth, Macrosynth, Sampler, FM Synth, Hypersynth, External Instrument, MIDI Out (or NONE for an unused slot). Changing it changes the parameters below.\"},{\"x\":22,\"width\":4,\"key\":\"load\",\"type\":\"action\",\"format\":\"text\",\"label\":\"Load Preset (LOAD)\",\"description\":\"Load an instrument preset from the SD card.\"},{\"x\":27,\"width\":4,\"key\":\"save\",\"type\":\"action\",\"format\":\"text\",\"label\":\"Save Preset (SAVE)\",\"description\":\"Save this instrument as a preset on the SD card.\"}]},{\"id\":\"name\",\"match\":[{\"x\":0,\"text\":\"NAME\"}],\"cells\":[{\"x\":8,\"width\":12,\"key\":\"name\",\"type\":\"name\",\"format\":\"text\",\"label\":\"Instrument Name (NAME)\",\"description\":\"Name of the instrument: helps keep the song organised when browsing, saving or bundling instruments.\"}]},{\"id\":\"transp\",\"match\":[{\"x\":0,\"text\":\"TRANSP.\"}],\"cells\":[{\"x\":8,\"width\":3,\"key\":\"transpose\",\"type\":\"onOff\",\"format\":\"text\",\"label\":\"Transpose Enabled (TRANSP.)\",\"description\":\"Enable or disable note transposition from scales, chain transpose columns and the project transpose for this instrument (turn off for percussive or effect instruments).\"},{\"x\":21,\"width\":2,\"key\":\"tableTic\",\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Table Tick (TBL. TIC)\",\"description\":\"Default speed at which this instrument's table advances: 01 is one tick per step, 02 two ticks per step. Can be overridden by the TIC command.\"},{\"x\":29,\"width\":2,\"key\":\"eq\",\"type\":\"eqSlot\",\"format\":\"hex\",\"label\":\"EQ Slot (EQ)\",\"description\":\"EQ bank assigned to this instrument (-- for none). [EDIT] or [SHIFT]+[RIGHT] opens the EQ editor.\"}]}],\"zones\":[{\"id\":\"left\",\"labelX\":0,\"labelWidth\":8,\"x\":8,\"width\":20},{\"id\":\"right\",\"labelX\":18,\"labelWidth\":4,\"x\":22,\"width\":11}],\"vocabularyFrom\":\"instrumentTypes\"},\"instmods\":{\"slotLabel\":\"MOD\\\\d\",\"zones\":[{\"id\":\"left\",\"labelX\":0,\"labelWidth\":4,\"x\":5,\"width\":10},{\"id\":\"right\",\"labelX\":16,\"labelWidth\":4,\"x\":21,\"width\":10}],\"vocabulary\":{\"MOD#\":{\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"Modulator Type\",\"description\":\"Type of this modulation slot: AHD envelope, ADSR envelope, DRUM envelope, LFO, TRIG envelope or TRACKING. Slots can modulate their neighbour (Mod 1 affects Mod 2, 2→3, 3→4, 4→1).\",\"options\":{\"AHD ENV\":\"Attack Hold Decay envelope based on tempo.\",\"ADSR ENV\":\"Traditional Attack Decay Sustain Release envelope.\",\"DRUM ENV\":\"Sharp peak and swelling hold envelope for percussive elements.\",\"LFO\":\"Tempo-synced low frequency oscillator.\",\"TRIG ENV\":\"AHD envelope triggered by another playing track or instrument.\",\"TRACKING\":\"Modulates an instrument parameter from notes or velocities.\",\"OFF\":\"Slot unused.\"}},\"DEST\":{\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"Destination (DEST)\",\"description\":\"Instrument parameter this modulator controls. MOD AMT, MOD RATE or MOD BOTH modulate the neighbouring modulator's amount, rate or both.\"},\"SRC\":{\"type\":\"parameter\",\"format\":\"hexOption\",\"label\":\"Source (SRC)\",\"description\":\"Modulation source. Trig envelope: an instrument number (00-7F) or a whole track (80-87 = tracks 1-8). Tracking: NOTE, VELOCITY or VELOCITY TAKEOVER (velocity no longer affects instrument volume).\"},\"AMT\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Amount (AMT)\",\"description\":\"How strongly the modulator is applied to the destination.\"},\"ATK\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Attack (ATK)\",\"description\":\"Time to reach the amount (in ticks, relative to tempo).\"},\"HOLD\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Hold (HOLD)\",\"description\":\"Time to wait after the attack before decaying (in ticks).\"},\"DEC\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Decay (DEC)\",\"description\":\"Time to fall back (AHD/Drum: to zero; ADSR: to the sustain level), in ticks.\"},\"SUS\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Sustain (SUS)\",\"description\":\"Level held while the note is playing (ADSR).\"},\"REL\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Release (REL)\",\"description\":\"Time to fall back to zero after the note is released (ADSR); needs an OFF note or FX command.\"},\"PEAK\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Peak (PEAK)\",\"description\":\"Shape of the initial transient (drum envelope); modifies the duck amount and peak time.\"},\"BODY\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Body (BODY)\",\"description\":\"Time to hold the modulation before decaying (drum envelope).\"},\"OSC\":{\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"LFO Shape (OSC)\",\"description\":\"LFO shape: triangle, sine, ramp down/up, exponential down/up, square down/up, random, drunk. The 'T' variants run in ticks (much faster).\",\"options\":{\"TRI\":\"Triangle.\",\"SIN\":\"Sine.\",\"RAMP DN\":\"Ramp down.\",\"RAMP UP\":\"Ramp up.\",\"EXP DN\":\"Exponential down.\",\"EXP UP\":\"Exponential up.\",\"SQU DN\":\"Square down.\",\"SQU UP\":\"Square up.\",\"RANDOM\":\"Random values.\",\"DRUNK\":\"Random walk.\"}},\"TRIG\":{\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"LFO Trigger (TRIG)\",\"description\":\"How the LFO reacts when the instrument triggers and when the shape ends.\",\"options\":{\"FREE\":\"Loop the shape and don't reset on new notes.\",\"RETRIG\":\"Loop the shape and reset on each instrument trigger.\",\"HOLD\":\"Hold the last value of the shape.\",\"ONCE\":\"Play the shape once and reset to the start value.\"}},\"FREQ\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"LFO Frequency (FREQ)\",\"description\":\"Rate of the LFO in steps (16th notes), or in ticks for the 'T' shapes.\"},\"LVAL\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Low Value (LVAL)\",\"description\":\"Lowest value of the source range scaled to the destination (tracking). Can be higher than HVAL to invert the range.\"},\"HVAL\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"High Value (HVAL)\",\"description\":\"Highest value of the source range scaled to the destination (tracking).\"}}},\"scale\":{\"notes\":\"Only the rows below the 12 interval rows; the intervals themselves are grid columns in m8-view-context.json.\",\"rows\":[{\"id\":\"key\",\"match\":[{\"x\":0,\"text\":\"KEY\"}],\"cells\":[{\"x\":6,\"width\":2,\"key\":\"key\",\"type\":\"option\",\"format\":\"text\",\"label\":\"Key (KEY)\",\"description\":\"Global key: the root note of the default scale (can be overridden per track with SCA / SCG).\"}]},{\"id\":\"tune\",\"match\":[{\"x\":0,\"text\":\"TUNE\"}],\"cells\":[{\"x\":6,\"width\":6,\"key\":\"tune\",\"type\":\"parameter\",\"format\":\"float\",\"unit\":\" Hz\",\"label\":\"Tuning (TUNE)\",\"description\":\"Reference pitch of A4 in Hz (440.00 is standard).\"}]},{\"id\":\"name\",\"match\":[{\"x\":0,\"text\":\"NAME\"}],\"cells\":[{\"x\":6,\"width\":16,\"key\":\"name\",\"type\":\"name\",\"format\":\"text\",\"label\":\"Scale Name (NAME)\",\"description\":\"Name of this scale (up to 16 characters); 92 factory scales load from /Scales/Factory.\"}]},{\"id\":\"file\",\"match\":[{\"x\":6,\"text\":\"LOAD\"},{\"x\":11,\"text\":\"SAVE\"}],\"cells\":[{\"x\":6,\"width\":4,\"key\":\"load\",\"type\":\"action\",\"format\":\"text\",\"label\":\"Load Scale (LOAD)\",\"description\":\"Load a scale from the SD card.\"},{\"x\":11,\"width\":4,\"key\":\"save\",\"type\":\"action\",\"format\":\"text\",\"label\":\"Save Scale (SAVE)\",\"description\":\"Save this scale to the SD card.\"}]}]},\"loadinstrument\":{\"kind\":\"browser\",\"browserFor\":\"instrument preset\"},\"selectsavedirectory\":{\"kind\":\"browser\",\"browserFor\":\"save location\"},\"createdirectory\":{\"kind\":\"text\",\"fieldLabel\":\"Directory Name\",\"description\":\"Name of the directory to create on the SD card.\"}}"),
179
+ instrumentTypes: /* @__PURE__ */ JSON.parse("{\"common\":{\"name\":\"Common\",\"description\":\"Parameters shared by most instrument types.\",\"params\":{\"FILTER\":{\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"Filter Type (FILTER)\",\"description\":\"Multi-mode filter type: low-pass, high-pass, band-pass, band-stop, LP>HP (low-pass with RES controlling a 1-pole high-pass), ZDF low-pass, ZDF high-pass.\"},\"CUTOFF\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Filter Cutoff (CUTOFF)\",\"description\":\"Filter cutoff frequency.\"},\"RES\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Filter Resonance (RES)\",\"description\":\"Filter resonance amount.\"},\"AMP\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Amplification (AMP)\",\"description\":\"Amplifies the signal; values above the maximum level are handled according to LIM.\"},\"LIM\":{\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"Limit Mode (LIM)\",\"description\":\"Limit / clipping behaviour of the amplified signal.\",\"options\":{\"CLIP\":\"Values above the maximum level are clipped.\",\"SIN\":\"The waveform is fed through a sine function.\",\"FOLD\":\"Values above the maximum level are folded back into themselves.\",\"WRAP\":\"Values above the maximum level are wrapped vertically.\",\"POST\":\"Amplification applied with hard-clipping after the filter stage.\",\"POST:AD\":\"Post filter amplification with soft-clipping.\",\"POST:W1\":\"Post filter folding distortion.\",\"POST:W2\":\"Post filter folding distortion.\",\"POST:W3\":\"Post filter folding distortion.\"}},\"PAN\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Pan (PAN)\",\"description\":\"Stereo position of the instrument (80 is centre).\"},\"DRY\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Dry Volume (DRY)\",\"description\":\"Dry volume sent to the mixer channel.\"},\"MFX\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"ModFX Send (MFX)\",\"description\":\"ModFX send effect volume.\"},\"DEL\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Delay Send (DEL)\",\"description\":\"Delay send effect volume.\"},\"REV\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Reverb Send (REV)\",\"description\":\"Reverb send effect volume.\"}}},\"wavsynth\":{\"name\":\"Wavsynth\",\"description\":\"Wave table synthesizer and noise generator: an 8-bit sample buffer generated in real time from one of 9 basic shapes (repeated, skewed, mirrored, filtered, overdriven) or one of 61 built-in wave tables of 64 waveforms each.\",\"params\":{\"SHAPE\":{\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"Shape (SHAPE)\",\"description\":\"Base waveform: PULSE 12% to 75%, SAW, TRIANGLE, SINE, NOISE PITCHED, NOISE, or WT wave tables. For PWM set PULSE 50% and adjust MIRROR (smoothness set by SIZE).\"},\"SIZE\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Size (SIZE)\",\"description\":\"Horizontal size of the waveform (number of samples).\"},\"MULT\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Multiply (MULT)\",\"description\":\"Multiplies the waveform by adding repeats of the shape; can sound like hard sync.\"},\"WARP\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Warp (WARP)\",\"description\":\"Pushes the shape to one side of the wave table.\"},\"SCAN\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Scan / Mirror (SCAN)\",\"description\":\"Shapes 0-8: mirrors the waveform at the given position (0-200%). Wave tables: scans through the 64 waveforms.\"},\"FILTER\":{\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"Filter Type (FILTER)\",\"description\":\"Multi-mode filter type, plus 4 modes that apply the filter into the waveform: WAV LP, WAV HP, WAV BP, WAV BS.\"}}},\"macrosynth\":{\"name\":\"Macrosynth\",\"description\":\"44 engines ('shapes') from basic analog to 2-op FM, physical modelling and percussion; TIMBRE and COLOR change meaning per shape.\",\"params\":{\"SHAPE\":{\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"Shape (SHAPE)\",\"description\":\"One of the 44 Macrosynth engines (see the Macrosynth Models appendix).\"},\"TIMBRE\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Timbre (TIMBRE)\",\"description\":\"First parameter of the selected shape.\"},\"COLOR\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Color (COLOR)\",\"description\":\"Second parameter of the selected shape.\"},\"DEGRADE\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Degrade (DEGRADE)\",\"description\":\"Sample rate reduction effect.\"},\"REDUX\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Redux (REDUX)\",\"description\":\"Bit rate reduction effect.\"}}},\"sampler\":{\"name\":\"Sampler\",\"description\":\"Sample player, editor and recorder for 1 or 2 channel PCM .wav files.\",\"params\":{\"SAMPLE\":{\"type\":\"name\",\"format\":\"text\",\"label\":\"Sample (SAMPLE)\",\"description\":\"The loaded sample; use LOAD to browse for one, REC. to record or EDIT to open the Sample Editor.\"},\"SLICE\":{\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"Slice (SLICE)\",\"description\":\"Slices the sample into equal sections, mapped from the lowest octave (C-1); 01 FILE uses the markers stored in the file.\"},\"PLAY\":{\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"Play Mode (PLAY)\",\"description\":\"Play direction and loop mode.\",\"options\":{\"FWD\":\"Forward, no loop.\",\"REV\":\"Reverse, no loop.\",\"FWDLOOP\":\"Looping forward.\",\"REVLOOP\":\"Looping reverse.\",\"FWD PP\":\"Ping-pong looping, forward first.\",\"REV PP\":\"Ping-pong looping, reverse first.\",\"OSC\":\"Oscillator mode: ignores the start position and doesn't restart on retrigger.\",\"OSC REV\":\"Oscillator mode, reverse.\",\"OSC PP\":\"Oscillator mode, ping-pong.\",\"REPITCH\":\"Pitches the sample from the song tempo (adjust with STEPS/BPM).\"}},\"START\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Start (START)\",\"description\":\"Sample start position (ignored in OSC play modes).\"},\"LOOP ST.\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Loop Start (LOOP ST.)\",\"description\":\"Where the sample loops back to when it reaches the end in a looping play mode.\"},\"LEN\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Length (LEN)\",\"description\":\"Sample length.\"},\"DETUNE\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Detune (DETUNE)\",\"description\":\"Detune with 80 as the centre frequency: first digit steps semitones, second digit 1/16 semitone.\"},\"DEGRADE\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Degrade (DEGRADE)\",\"description\":\"Sample rate reduction; any value above 00 disables sample interpolation.\"}}},\"fmsynth\":{\"name\":\"FM Synth\",\"description\":\"Four-operator, 12-algorithm FM synthesizer. Each operator has a base shape, ratio, level, feedback and two modulation slots.\",\"params\":{\"ALGO\":{\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"Algorithm (ALGO)\",\"description\":\"One of 12 algorithms (oscillator routing); the last one is additive mode.\"},\"A\":{\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"Operator A (A)\",\"description\":\"Operator letter with optional shape (SIN, SW2-SW6, SAW, SQU, PUL, IMP, TRI, NOISE, then wave tables).\"},\"B\":{\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"Operator B (B)\",\"description\":\"Operator letter with optional shape.\"},\"C\":{\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"Operator C (C)\",\"description\":\"Operator letter with optional shape.\"},\"D\":{\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"Operator D (D)\",\"description\":\"Operator letter with optional shape.\"},\"RATIO\":{\"type\":\"parameter\",\"format\":\"float\",\"label\":\"Ratio (RATIO)\",\"description\":\"Operator frequency ratio relative to the played note (2.00 is an octave up, 0.50 an octave down).\"},\"LEV/FB\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Level / Feedback (LEV/FB)\",\"description\":\"Operator volume and feedback.\"},\"MOD\":{\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"Modulation Slot (MOD)\",\"description\":\"Assigns one of MOD1-MOD4 to control a destination on the operator.\"},\"LEV\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Level Mod (LEV)\",\"description\":\"Controls the level from 00 to the currently set level.\"},\"RAT\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Ratio Mod (RAT)\",\"description\":\"Adds 0.00 to +16.00 to the current ratio.\"},\"PIT\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Pitch Mod (PIT)\",\"description\":\"Adds to the note pitch, in semitones, for the operator.\"},\"FBK\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Feedback Mod (FBK)\",\"description\":\"Controls feedback from 00 to the currently set feedback.\"},\"MOD#\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Modulation Source\",\"description\":\"Modulation source value freely assigned to operators through the MOD slots.\"}}},\"hypersynth\":{\"name\":\"Hypersynth\",\"description\":\"Six-note saw wave chord synthesizer with 16 chord banks of up to 6 intervals, detune (swarm), stereo width and a square sub-oscillator.\",\"params\":{\"SCALE\":{\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"Scale (SCALE)\",\"description\":\"One of the song's scales, or 00 to use the song/track scale settings.\"},\"CHORD\":{\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"Chord (CHORD)\",\"description\":\"Chord bank and its intervals (copy with [SHIFT]+[OPTION], paste with [SHIFT]+[EDIT]).\"},\"SHIFT\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Shift (SHIFT)\",\"description\":\"Cross-fades volume between the first 3 intervals and the second 3.\"},\"SWARM\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Swarm (SWARM)\",\"description\":\"Detunes the oscillators relative to their interval.\"},\"WIDTH\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Stereo Width (WIDTH)\",\"description\":\"Stereo width of the oscillators, from mono 00 to full stereo FF.\"},\"SUBOSC\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"Sub Oscillator (SUBOSC)\",\"description\":\"Mixes in a sub-oscillator 2 octaves below the root (below 80) or 1 octave below (above 80).\"}}},\"external\":{\"name\":\"External Instrument\",\"description\":\"Hybrid MIDI output and audio input device: notes and MIDI FX are sent to the chosen port and channel, audio returns through its filter and amp stage.\",\"params\":{\"INPUT\":{\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"Audio Input (INPUT)\",\"description\":\"Audio input: line-in (stereo, left, right), USB (stereo, left, right), or line-in and USB.\"},\"PORT\":{\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"MIDI Port (PORT)\",\"description\":\"MIDI output port: MIDI and USB, MIDI only, USB only, or Internal (track MIDI input / global MIDI CCs from the MIDI Settings View).\"},\"CHANNEL\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"MIDI Channel (CHANNEL)\",\"description\":\"MIDI channel, 1 to 16.\"},\"BANK:PG\":{\"type\":\"parameter\",\"format\":\"hexPair\",\"parts\":[\"bank\",\"program\"],\"label\":\"Bank / Program (BANK:PG)\",\"description\":\"Optional MIDI bank select and program change (program change can also be sent as an FX command).\"},\"CC#\":{\"type\":\"parameter\",\"format\":\"hexPair\",\"parts\":[\"CC number\",\"value\"],\"label\":\"Custom CC (CC:VAL)\",\"description\":\"A custom MIDI CC number with an optional default value, sent with the note-on after program change messages.\"}}},\"midiout\":{\"name\":\"MIDI Out\",\"description\":\"Controls external devices over USB MIDI or the TRS (type A) MIDI output.\",\"params\":{\"PORT\":{\"type\":\"option\",\"format\":\"hexOption\",\"label\":\"MIDI Port (PORT)\",\"description\":\"MIDI output port: MIDI and USB, MIDI only, USB only, or Internal (track MIDI input / global MIDI CCs from the MIDI Settings View).\"},\"CHANNEL\":{\"type\":\"parameter\",\"format\":\"hex\",\"label\":\"MIDI Channel (CHANNEL)\",\"description\":\"MIDI channel, 1 to 16.\"},\"BANK:PG\":{\"type\":\"parameter\",\"format\":\"hexPair\",\"parts\":[\"bank\",\"program\"],\"label\":\"Bank / Program (BANK:PG)\",\"description\":\"Optional MIDI bank select and program change (program change can also be sent as an FX command).\"},\"CC#\":{\"type\":\"parameter\",\"format\":\"hexPair\",\"parts\":[\"CC number\",\"value\"],\"label\":\"Custom CC (CC:VAL)\",\"description\":\"One of up to 10 custom MIDI CC numbers per instrument with an optional default value, sent with the note-on after program change messages.\"}}}}"),
180
+ instrumentTypeNames: {
181
+ WAVS: "wavsynth",
182
+ MACRO: "macrosynth",
183
+ SAMPL: "sampler",
184
+ FM: "fmsynth",
185
+ HYPER: "hypersynth",
186
+ EXTERN: "external",
187
+ MIDI: "midiout"
188
+ }
189
+ }, a = i.views, o = i.instrumentTypes, s = i.instrumentTypeNames, c = {};
190
+ for (let [e, t] of Object.entries(a)) {
191
+ let { extends: n, ...r } = t;
192
+ c[e] = n ? {
193
+ ...a[n],
194
+ ...r
195
+ } : r;
196
+ }
197
+ function l(e) {
198
+ return c[e] ?? null;
199
+ }
200
+ var u = (e, t, n) => t >= e.length ? "" : e.slice(t, t + n);
201
+ function d(e, t) {
202
+ let n = e.width ?? e.text?.length ?? 1, r = u(t, e.x, n);
203
+ return e.text == null ? e.regex == null ? !1 : new RegExp(e.regex, "i").test(r) : r.toUpperCase() === e.text.toUpperCase();
204
+ }
205
+ function f(e, t) {
206
+ let n = e.sections;
207
+ if (!n) return null;
208
+ for (let e of t) {
209
+ let t = e.toUpperCase(), r = n.find((e) => t.startsWith(e));
210
+ if (r) return r;
211
+ }
212
+ return null;
213
+ }
214
+ function p(e, t, n) {
215
+ let r = e.zones?.find((e) => e.id === t);
216
+ if (!e.slotLabel || !r) return null;
217
+ let i = RegExp(`^${e.slotLabel}$`, "i");
218
+ for (let e of n) {
219
+ let t = u(e, r.labelX, r.labelWidth).trim();
220
+ if (i.test(t)) return t.toUpperCase();
221
+ }
222
+ return null;
223
+ }
224
+ function m(e) {
225
+ let t = e.toUpperCase().replace(/[^A-Z]/g, "");
226
+ if (!t) return null;
227
+ let n = Object.keys(s).find((e) => t.startsWith(e));
228
+ return n ? s[n] : null;
229
+ }
230
+ function h(e) {
231
+ for (let t of e) if (t.toUpperCase().startsWith("TYPE")) {
232
+ let e = u(t, 8, 13).trim();
233
+ return e ? {
234
+ text: e,
235
+ key: m(e)
236
+ } : null;
237
+ }
238
+ return null;
239
+ }
240
+ function g(e) {
241
+ let t = o[e];
242
+ return t ? {
243
+ name: t.name,
244
+ description: t.description
245
+ } : null;
246
+ }
247
+ function _(e, t, n) {
248
+ let r = t.replace(/^MOD\d$/, "MOD#").replace(/^CC[A-J]$/, "CC#");
249
+ if (e.vocabulary) return e.vocabulary[r] ?? null;
250
+ if (e.vocabularyFrom !== "instrumentTypes") return null;
251
+ let i = n ? [n, "common"] : ["common", ...Object.keys(o).filter((e) => e !== "common")];
252
+ for (let e of i) {
253
+ let t = o[e]?.params[r];
254
+ if (t) return t;
255
+ }
256
+ return null;
257
+ }
258
+ var v = (e) => e.toLowerCase().replace(/[^a-z0-9]+(.)?/g, (e, t) => t ? t.toUpperCase() : "").replace(/^[^a-z]+/, ""), y = /^[A-Z][A-Z0-9.:#/ -]*$/;
259
+ function b(e, t, n) {
260
+ if (e.kind === "browser") {
261
+ let r = n.entryText?.trim() || t.trim();
262
+ return r ? {
263
+ rowId: "entry",
264
+ cells: [{
265
+ x: Math.max(0, t.indexOf(r)),
266
+ width: r.length,
267
+ key: "entry",
268
+ type: "fileEntry",
269
+ format: "text",
270
+ label: "File Browser Entry",
271
+ meta: { browserFor: e.browserFor }
319
272
  }]
320
- },
321
- instrumentpool: {
322
- title: "Instrument Pool",
323
- type: "grid",
324
- description: "Lists all instrument slots with their mix routing. Each row shows the instrument name and its dry/FX send levels.",
325
- rowField: {
326
- x: 0,
327
- width: 2,
328
- parse: "hex",
329
- type: "rowIndex",
330
- key: "instIndex",
331
- description: "Instrument slot index 00-7F."
332
- },
333
- columns: [
334
- {
335
- x: 3,
336
- width: 12,
337
- key: "name",
338
- type: "instrumentName",
339
- label: "Instrument Name",
340
- description: "Name of the instrument in this slot (up to 12 chars). '------------' = empty slot."
341
- },
342
- {
343
- x: 16,
344
- width: 2,
345
- key: "dry",
346
- type: "volume",
347
- label: "Dry (DRY)",
348
- description: "Direct output volume for this instrument (hex 00-FF)."
349
- },
350
- {
351
- x: 19,
352
- width: 2,
353
- key: "mx",
354
- type: "volume",
355
- label: "ModFX (MX)",
356
- description: "ModFX send level (hex 00-FF)."
357
- },
358
- {
359
- x: 22,
360
- width: 2,
361
- key: "de",
362
- type: "volume",
363
- label: "Delay (DE)",
364
- description: "Delay send level (hex 00-FF)."
365
- },
366
- {
367
- x: 25,
368
- width: 2,
369
- key: "rv",
370
- type: "volume",
371
- label: "Reverb (RV)",
372
- description: "Reverb send level (hex 00-FF)."
373
- },
374
- {
375
- x: 28,
376
- width: 2,
377
- key: "eq",
378
- type: "eqSlot",
379
- label: "EQ Slot (EQ)",
380
- description: "EQ slot assignment. '--' = no EQ."
381
- }
382
- ]
273
+ } : {
274
+ rowId: null,
275
+ cells: []
276
+ };
277
+ }
278
+ if (e.kind === "text") {
279
+ if (!t.trim()) return {
280
+ rowId: null,
281
+ cells: []
282
+ };
283
+ let n = Math.max(0, t.search(/\S/));
284
+ return {
285
+ rowId: "text",
286
+ cells: [{
287
+ x: n,
288
+ width: Math.max(12, t.length - n),
289
+ key: "name",
290
+ type: "name",
291
+ format: "text",
292
+ label: e.fieldLabel ?? "Name",
293
+ description: e.description
294
+ }]
295
+ };
296
+ }
297
+ for (let r of e.rows ?? []) if (!(r.section && n.section && r.section !== n.section) && r.match.every((e) => d(e, t))) return {
298
+ rowId: r.id,
299
+ cells: r.cells
300
+ };
301
+ let r = e.zones ?? [], i = [];
302
+ return r.forEach((a, o) => {
303
+ let s = u(t, a.labelX, a.labelWidth).trim().toUpperCase();
304
+ if (!y.test(s)) return;
305
+ let c = r[o + 1], l = c != null && u(t, c.labelX - 1, 1).trim() === "" && y.test(u(t, c.labelX, c.labelWidth).trim().toUpperCase()), d = c && l ? Math.max(1, c.labelX - 1 - a.x) : a.width;
306
+ if (!u(t, a.x, d).trim()) return;
307
+ let f = _(e, s, n.instrumentKey), p = v(s) || a.id, m = i.some((e) => e.key === p) ? `${p}${a.id[0].toUpperCase()}${a.id.slice(1)}` : p;
308
+ i.push({
309
+ x: a.x,
310
+ width: d,
311
+ key: m,
312
+ type: f?.type ?? "parameter",
313
+ format: f?.format ?? "auto",
314
+ label: f?.label ?? s,
315
+ description: f?.description,
316
+ parts: f?.parts,
317
+ options: f?.options,
318
+ unit: f?.unit,
319
+ meta: {
320
+ paramLabel: s,
321
+ zone: a.id
322
+ }
323
+ });
324
+ }), {
325
+ rowId: i.length ? "params" : null,
326
+ cells: i
327
+ };
328
+ }
329
+ var x = {
330
+ hexValue: null,
331
+ numericValue: null,
332
+ values: null,
333
+ text: null
334
+ };
335
+ function S(e) {
336
+ return /^[0-9A-F]{2}$/i.test(e) ? "hex" : /^[0-9A-F]{2}:[0-9A-F]{2}$/i.test(e) ? "hexPair" : /^[+-]?\d+([.,]\d+)?$/.test(e) ? "float" : /^[0-9A-F]{2}\S/i.test(e) ? "hexOption" : "text";
337
+ }
338
+ function C(e, t) {
339
+ let n = e.trim();
340
+ if (!n) return x;
341
+ switch (t === "auto" ? S(n) : t) {
342
+ case "hex": {
343
+ let e = /^([0-9A-F]{2})/i.exec(n), t = e ? parseInt(e[1], 16) : null;
344
+ return {
345
+ hexValue: t,
346
+ numericValue: t,
347
+ values: null,
348
+ text: e ? null : n
349
+ };
383
350
  }
384
- },
385
- fxCommands: {
386
- sequencer: {
387
- ARP: { description: "Arpeggio: plays 3 notes rapidly. X=first interval semitones, Y=second interval semitones." },
388
- ARC: { description: "Arpeggio Config: X=mode, Y=speed in ticks." },
389
- CHA: { description: "Chance: X=probability left of command (0=never, F=always), Y=probability right." },
390
- DEL: { description: "Delay: in phrase delays entire row by XX ticks; in table delays table playhead." },
391
- GRV: { description: "Groove: sets groove number XX for the current track." },
392
- GGR: { description: "Global Groove: sets groove XX for all tracks." },
393
- HOP: { description: "Hop: in phrase jumps to row Y of next phrase; HOPFF stops track. In table loops to row Y X times." },
394
- INS: { description: "Instrument: changes active instrument to XX as an FX command." },
395
- KIL: { description: "Kill: stops the playing instrument after XX ticks." },
396
- RND: { description: "Random: randomises the preceding FX command. X=left range, Y=right range (0=none, F=full)." },
397
- RNL: { description: "Randomise Left: randomises the FX command to the left." },
398
- RET: { description: "Retrig: retriggers current row. Y≠0: retrig every Y ticks with X volume ramp. Y=0: single retrig after X ticks." },
399
- REP: { description: "Repeat: repeats and increments the last FX command by XX each step." },
400
- RTO: { description: "Repeat To: sets the min/max value that REP stops at." },
401
- RMX: { description: "Remix: repositions the phrase playhead (Y) on tracks to the left (selected by X)." },
402
- NTH: { description: "Nth Trigger: conditional trigger based on loop count." },
403
- PSL: { description: "Pitch Slide (portamento): enables portamento for XX ticks." },
404
- PBN: { description: "Pitch Bend: continuous pitch slide up (00-7F) or down (80-FF)." },
405
- PVB: { description: "Vibrato: X=speed, Y=depth." },
406
- PVX: { description: "Extreme Vibrato: like PVB but with higher range." },
407
- SCA: { description: "Track Scale: X=key signature, Y=scale number for this track." },
408
- SCG: { description: "Global Scale: X=key, Y=scale number for the whole song." },
409
- SNG: { description: "Song Hop: moves this track's song position by XX rows relative to current." },
410
- SED: { description: "Random Seed: sets the random seed XX for this track." },
411
- TBL: { description: "Table: assigns table number XX to the current instrument." },
412
- THO: { description: "Table Hop: jumps all table columns to position 0X." },
413
- TIC: { description: "Table Tick: sets the table tick rate. In a table, each FX column can run independently." },
414
- TBX: { description: "Aux Table: runs table XX in parallel with the instrument table. 00=stop aux table." },
415
- TPO: { description: "Tempo: sets song BPM to XX (hex → decimal conversion shown in help text)." },
416
- TSP: { description: "Global Transpose: transposes the entire song by XX semitones." },
417
- NXT: { description: "Next Track Trigger: plays instrument XX on the next track using current note/velocity." },
418
- OFF: { description: "Note Off: stops the playing instrument after XX ticks. Triggers ADSR release stage." },
419
- MTT: { description: "Micro Time: adjusts row playback timing in sub-tick (1/8 tick) amounts." }
420
- },
421
- instrument: {
422
- VOL: { description: "Volume offset (relative)." },
423
- PIT: { description: "Pitch offset in semitones (relative)." },
424
- FIN: { description: "Fine tune: pitch offset -1 to +1 semitones (relative)." },
425
- EA1: { description: "Envelope 1 Amount offset." },
426
- EA2: { description: "Envelope 2 Amount offset." },
427
- AT1: { description: "Envelope 1 Attack time offset." },
428
- AT2: { description: "Envelope 2 Attack time offset." },
429
- HO1: { description: "Envelope 1 Hold time offset." },
430
- HO2: { description: "Envelope 2 Hold time offset." },
431
- DE1: { description: "Envelope 1 Decay time offset." },
432
- DE2: { description: "Envelope 2 Decay time offset." },
433
- ET1: { description: "Retrigger Envelope 1 (any value > 00 retriggers)." },
434
- ET2: { description: "Retrigger Envelope 2." },
435
- LA1: { description: "LFO 1 Amount offset." },
436
- LA2: { description: "LFO 2 Amount offset." },
437
- LF1: { description: "LFO 1 Frequency offset." },
438
- LF2: { description: "LFO 2 Frequency offset." },
439
- LT1: { description: "Retrigger LFO 1 (value sets phase offset)." },
440
- LT2: { description: "Retrigger LFO 2." }
441
- },
442
- mixer: {
443
- VMV: { description: "Main Volume: sets the main song output volume." },
444
- VMX: { description: "ModFX Volume." },
445
- VDE: { description: "Delay Volume." },
446
- VRE: { description: "Reverb Volume." },
447
- VT1: { description: "Track 1 Volume." },
448
- VT2: { description: "Track 2 Volume." },
449
- VT3: { description: "Track 3 Volume." },
450
- VT4: { description: "Track 4 Volume." },
451
- VT5: { description: "Track 5 Volume." },
452
- VT6: { description: "Track 6 Volume." },
453
- VT7: { description: "Track 7 Volume." },
454
- VT8: { description: "Track 8 Volume." },
455
- DJC: { description: "DJ Filter Cutoff." },
456
- DJR: { description: "DJ Filter Resonance." },
457
- DJT: { description: "DJ Filter Type." },
458
- EQM: { description: "Assign main mix EQ slot." },
459
- EQI: { description: "Assign current instrument EQ slot." }
351
+ case "hexOption": {
352
+ let e = /^([0-9A-F]{2})\s?(.*)$/i.exec(n);
353
+ if (!e) return {
354
+ ...x,
355
+ text: n
356
+ };
357
+ let t = parseInt(e[1], 16);
358
+ return {
359
+ hexValue: t,
360
+ numericValue: t,
361
+ values: null,
362
+ text: e[2].trim() || null
363
+ };
364
+ }
365
+ case "hexPair": {
366
+ let e = /^([0-9A-F]{2}):([0-9A-F]{2})/i.exec(n);
367
+ if (!e) return {
368
+ ...x,
369
+ text: n
370
+ };
371
+ let t = [parseInt(e[1], 16), parseInt(e[2], 16)];
372
+ return {
373
+ hexValue: t[0],
374
+ numericValue: t[0],
375
+ values: t,
376
+ text: null
377
+ };
378
+ }
379
+ case "decimal": {
380
+ let e = parseInt(n, 10);
381
+ return Number.isNaN(e) ? {
382
+ ...x,
383
+ text: n
384
+ } : {
385
+ hexValue: null,
386
+ numericValue: e,
387
+ values: null,
388
+ text: null
389
+ };
390
+ }
391
+ case "decimalPair": {
392
+ let e = /^(\d+):(\d+)/.exec(n);
393
+ if (!e) return {
394
+ ...x,
395
+ text: n
396
+ };
397
+ let t = [parseInt(e[1], 10), parseInt(e[2], 10)];
398
+ return {
399
+ hexValue: null,
400
+ numericValue: t[0],
401
+ values: t,
402
+ text: null
403
+ };
404
+ }
405
+ case "float": {
406
+ let e = parseFloat(n.replace(",", "."));
407
+ return Number.isNaN(e) ? {
408
+ ...x,
409
+ text: n
410
+ } : {
411
+ hexValue: null,
412
+ numericValue: e,
413
+ values: null,
414
+ text: null
415
+ };
460
416
  }
417
+ default: return {
418
+ ...x,
419
+ text: n
420
+ };
461
421
  }
462
- }, i = r.fxCommands;
463
- function a(e) {
422
+ }
423
+ function w(e, t) {
424
+ if (!e || !t) return null;
425
+ let n = t.toUpperCase().trim();
426
+ if (e[n]) return e[n];
427
+ let r = Object.keys(e).find((e) => e.length >= 3 && n.startsWith(e));
428
+ return r ? e[r] : null;
429
+ }
430
+ //#endregion
431
+ //#region src/fxCommands.ts
432
+ var T = r.fxCommands, E = r.instrumentFx.types, D = Object.entries(E).filter(([, e]) => e.verified).map(([e]) => e);
433
+ function ee(e) {
434
+ let t = D.filter((t) => E[t].commands.includes(e));
435
+ return t.length === 0 || t.length === D.length ? null : t;
436
+ }
437
+ function O(e) {
464
438
  let t = e.toUpperCase();
465
- for (let e of Object.values(i)) if (t in e) return e[t];
439
+ for (let e of [
440
+ "sequencer",
441
+ "instrument",
442
+ "mixer"
443
+ ]) {
444
+ let n = T[e][t];
445
+ if (n) return {
446
+ description: n.description,
447
+ category: e,
448
+ relative: n.relative === !0,
449
+ instrumentTypes: e === "instrument" ? ee(t) : null,
450
+ slot: null
451
+ };
452
+ }
453
+ let n = /^([A-Z]{2})([1-4])$/.exec(t), r = n ? T.modulation[n[1]] : void 0;
454
+ if (n && r) return {
455
+ description: r.description.replace("modulator N", `modulator ${n[2]}`),
456
+ category: "modulation",
457
+ relative: r.relative === !0,
458
+ instrumentTypes: null,
459
+ slot: Number(n[2])
460
+ };
461
+ }
462
+ function k(e) {
463
+ return O(e)?.relative === !0;
464
+ }
465
+ function te(e) {
466
+ let t = E[e.toLowerCase()];
467
+ return t ? {
468
+ type: e.toLowerCase(),
469
+ verified: t.verified,
470
+ commands: [...t.commands]
471
+ } : null;
472
+ }
473
+ var ne = r.instrumentFx.relativeCommands.description, A = (e) => e.toString(16).toUpperCase().padStart(2, "0"), j = (e) => e > 127 ? e - 256 : e, M = (e) => `${e > 0 ? "+" : e < 0 ? "−" : "±"}${Math.abs(e)}`;
474
+ function N(e, t) {
475
+ return k(e) && t > 127 ? `${A(t)} (${j(t)})` : A(t);
476
+ }
477
+ function re(e) {
478
+ return e > 127 ? `−${A(256 - e)}` : `+${A(e)}`;
479
+ }
480
+ var ie = [
481
+ "C-",
482
+ "C#",
483
+ "D-",
484
+ "D#",
485
+ "E-",
486
+ "F-",
487
+ "F#",
488
+ "G-",
489
+ "G#",
490
+ "A-",
491
+ "A#",
492
+ "B-"
493
+ ];
494
+ function ae(e) {
495
+ let t = /^([A-G])([#-])(\d)$/.exec((e ?? "").trim().toUpperCase());
496
+ if (!t) return null;
497
+ let n = ie.indexOf(`${t[1]}${t[2]}`);
498
+ return n < 0 ? null : Number(t[3]) * 12 + n;
499
+ }
500
+ function P(e) {
501
+ return `${ie[(e % 12 + 12) % 12]}${Math.floor(e / 12)}`;
502
+ }
503
+ var oe = [
504
+ "C",
505
+ "C#",
506
+ "D",
507
+ "D#",
508
+ "E",
509
+ "F",
510
+ "F#",
511
+ "G",
512
+ "G#",
513
+ "A",
514
+ "A#",
515
+ "B"
516
+ ];
517
+ function se(e, t, n = {}) {
518
+ let r = e.toUpperCase(), i = t >> 4, a = t & 15, o = (e) => `${e} tick${e === 1 ? "" : "s"}`;
519
+ switch (r) {
520
+ case "ARP": {
521
+ let e = ae(n.note), t = `+${i} and +${a} semitones`;
522
+ return e == null ? `plays the note, then ${t}` : `${t}: ${P(e)} ${P(e + i)} ${P(e + a)}`;
523
+ }
524
+ case "ARC": return `arp mode ${i}, speed ${o(a)}`;
525
+ case "CHA": return n.inTable ? `everything left of it plays with probability ${t}/255 (00 never, FF always)` : `${i}/15 chance for what is left of it, ${a}/15 for what is right (0 never, F always)`;
526
+ case "DEL": return `delays this row by ${o(t)}`;
527
+ case "KIL": return `stops the note after ${o(t)}`;
528
+ case "OFF": return `note off after ${o(t)}`;
529
+ case "PSL": return `portamento over ${o(t)}`;
530
+ case "GRV": return `track uses groove ${A(t)}`;
531
+ case "GGR": return `all tracks use groove ${A(t)}`;
532
+ case "INS": return `switches to instrument ${A(t)}`;
533
+ case "TBL": return `instrument uses table ${A(t)}`;
534
+ case "TBX": return t === 0 ? "stops the auxiliary table" : `plays table ${A(t)} alongside the instrument table`;
535
+ case "THO": return `table jumps to position ${a.toString(16).toUpperCase()}`;
536
+ case "HOP": return n.inTable ? `jumps to row ${a.toString(16).toUpperCase()}, ${i} time${i === 1 ? "" : "s"}` : t === 255 ? "stops this track" : `jumps to row ${a.toString(16).toUpperCase()} of the next phrase`;
537
+ case "RND": return `randomises the previous FX: left range ${i}, right range ${a} (0 none, F full)`;
538
+ case "RNL": return `randomises the FX to its left: left range ${i}, right range ${a} (0 none, F full)`;
539
+ case "RET": return a === 0 ? `single retrig after ${o(i)}` : `retrigs every ${o(a)}, volume ${i < 8 ? "falls" : "rises"} on each retrig (ramp ${i})`;
540
+ case "PVB":
541
+ case "PVX": return `vibrato speed ${i}, depth ${a}`;
542
+ case "PBN": return t < 128 ? `pitch slides up by ${t}` : `pitch slides down by ${256 - t}`;
543
+ case "SCA":
544
+ case "SCG": {
545
+ let e = oe[i];
546
+ return `${r === "SCA" ? "track" : "song"} scale ${a.toString(16).toUpperCase()}${e ? `, key ${e}` : ""}`;
547
+ }
548
+ case "SNG": return `moves the song position by ${M(j(t))} row(s)`;
549
+ case "SED": return `random seed ${A(t)}`;
550
+ case "NXT": return `plays instrument ${A(t)} on the next track`;
551
+ case "MTT": {
552
+ let e = j(t);
553
+ return e === 0 ? "no timing shift" : `shifts the row by ${M(e)}/8 tick`;
554
+ }
555
+ case "TPO": return `${t} BPM`;
556
+ case "TSP": return `transposes the song by ${M(j(t))} semitones`;
557
+ case "TIC": return t === 0 ? "table advances on each instrument trigger" : t <= 251 ? `table advances every ${o(t)}` : {
558
+ 252: "octave map: playing octave picks the table row",
559
+ 253: "velocity map",
560
+ 254: "note map",
561
+ 255: "table advances at 200 Hz"
562
+ }[t] ?? null;
563
+ case "XRZ": return t > 0 ? "reverb freeze on" : "reverb freeze off";
564
+ default: break;
565
+ }
566
+ if (k(r)) {
567
+ let e = j(t);
568
+ return r === "PIT" ? e === 0 ? "no change" : `${M(e)} semitones` : e === 0 ? "no change" : M(e);
569
+ }
570
+ return null;
571
+ }
572
+ function ce(e, t, n) {
573
+ let r = e + t & 255;
574
+ return n != null && (t < 128 ? r < e || r > n : r > e || r < n) && (r = n), {
575
+ value: r,
576
+ atLimit: n != null && r === n
577
+ };
578
+ }
579
+ function le(e, t, n, r = !1) {
580
+ let i = null, a = null, o = null, s = null, c = r, l = !1, u = null, d = "none", f = Math.min(n, e.length - 1);
581
+ for (let n = 0; n <= f; n += 1) {
582
+ let f = e[n].fields[`fx${t}cmd`], p = e[n].fields[`fx${t}val`];
583
+ if (d = "none", f && !f.isEmpty) {
584
+ let e = f.rawValue.toUpperCase(), t = p && !p.isEmpty ? p.hexValue : null;
585
+ e === "REP" ? t ? !i && !r ? d = "orphan" : (d = c ? "repChange" : "rep", c || (u = n), c = !0, o = t, a != null && ({value: a, atLimit: l} = ce(a, o, s))) : (d = "repStop", c = !1, o = null, l = !1) : e === "RTO" ? (d = "rto", s = t) : (d = c ? "replace" : "set", i = {
586
+ cmd: e,
587
+ value: t,
588
+ step: n
589
+ }, a = t, c = !1, o = null, s = null, l = !1, u = null);
590
+ } else c && (d = "continue", a != null && o != null && ({value: a, atLimit: l} = ce(a, o, s)));
591
+ }
592
+ return {
593
+ lane: t,
594
+ step: n,
595
+ event: d,
596
+ source: i,
597
+ active: c,
598
+ increment: o,
599
+ limit: s,
600
+ value: c ? a : null,
601
+ atLimit: l,
602
+ repStartStep: u,
603
+ carried: c && !i
604
+ };
605
+ }
606
+ function F(e) {
607
+ let t = e.source, n = (e) => e == null ? "??" : t ? N(t.cmd, e) : A(e), r = e.increment == null ? "" : re(e.increment), i = e.atLimit && e.limit != null ? `, held at the RTO limit ${A(e.limit)}` : "";
608
+ switch (e.event) {
609
+ case "rep":
610
+ case "repChange": return e.carried ? `REP ${r} per step continues the repeat from the previous phrase` : `${e.event === "rep" ? "repeats" : "now repeats"} ${t?.cmd} from ${n(t?.value ?? null)} (step ${t?.step.toString(16).toUpperCase()}), ${r} per step → ${n(e.value)} on this step${i}`;
611
+ case "continue": return e.carried ? "REP from a previous phrase is still active in this lane (^^)" : `REP still active: ${t?.cmd} reaches ${n(e.value)} on this step (${r} per step since step ${e.repStartStep?.toString(16).toUpperCase()})${i}`;
612
+ case "repStop": return t ? `REP00 stops the repeat of ${t.cmd}` : "REP00 stops the repeat";
613
+ case "orphan": return "REP has no earlier command in this lane of the phrase to repeat";
614
+ case "rto": return e.active && e.limit != null ? `sets the value the running REP stops at (${A(e.limit)})` : "sets the stop value for a REP";
615
+ case "replace": return t ? `replaces the running REP (${t.cmd} is no longer repeated)` : null;
616
+ default: return null;
617
+ }
618
+ }
619
+ function I(e) {
620
+ let t = e.fields.inst;
621
+ return t && !t.isEmpty ? "instrument" : [
622
+ 1,
623
+ 2,
624
+ 3
625
+ ].some((t) => {
626
+ let n = e.fields[`fx${t}cmd`];
627
+ return n != null && !n.isEmpty && n.rawValue.toUpperCase() === "RET";
628
+ }) ? "ret" : null;
629
+ }
630
+ function L(e, t, n = null) {
631
+ let r = {}, i = null, a = null, o = Math.min(t, e.length - 1);
632
+ for (let t = 0; t <= o; t += 1) {
633
+ let o = I(e[t]);
634
+ if (o) {
635
+ for (let e of Object.keys(r)) delete r[e];
636
+ i = t, a = o;
637
+ }
638
+ for (let o of [
639
+ 1,
640
+ 2,
641
+ 3
642
+ ]) {
643
+ let s = le(e, o, t, n === o), c = s.source;
644
+ if (!c || s.carried || !k(c.cmd)) continue;
645
+ let l = null, u = !1;
646
+ if (s.event === "set" || s.event === "replace" ? l = c.value : (s.event === "rep" || s.event === "repChange" || s.event === "continue") && (l = s.value, u = !0), l == null) continue;
647
+ let d = r[c.cmd] ??= {
648
+ cmd: c.cmd,
649
+ total: 0,
650
+ count: 0,
651
+ resetStep: i,
652
+ resetBy: a,
653
+ viaRep: !1
654
+ };
655
+ d.total += j(l), d.count += 1, d.viaRep ||= u;
656
+ }
657
+ }
658
+ return r;
659
+ }
660
+ var R = (e) => e === 0 ? "±00" : `${e > 0 ? "+" : "−"}${A(Math.abs(e))}`;
661
+ function ue(e) {
662
+ if (e.resetStep == null) return "the start of this phrase (earlier state unknown)";
663
+ let t = e.resetStep.toString(16).toUpperCase();
664
+ return e.resetBy === "ret" ? `the RET on step ${t}` : `the instrument number on step ${t}`;
665
+ }
666
+ var z = "stays until a note with an instrument number (I) or a RET resets it";
667
+ function B(e) {
668
+ if (!e || e.count <= 1) return `relative: ${z}`;
669
+ let t = e.viaRep ? ", including REP repeats" : "", n = e.total === 0 ? "has had no net effect" : `has moved by ${R(e.total)}`;
670
+ return `relative: ${e.cmd} ${n} over ${e.count} steps since ${ue(e)}${t}; ${z}`;
671
+ }
672
+ function V(e) {
673
+ let t = Object.values(e).filter((e) => e.total !== 0);
674
+ return t.length ? `triggers the instrument again: resets the relative changes still in force (${t.map((e) => `${e.cmd} ${R(e.total)}`).join(", ")})` : null;
675
+ }
676
+ //#endregion
677
+ //#region src/scaleInsight.ts
678
+ var H = [
679
+ "C",
680
+ "C#",
681
+ "D",
682
+ "D#",
683
+ "E",
684
+ "F",
685
+ "F#",
686
+ "G",
687
+ "G#",
688
+ "A",
689
+ "A#",
690
+ "B"
691
+ ], de = [
692
+ {
693
+ name: "Major (Ionian)",
694
+ steps: [
695
+ 0,
696
+ 2,
697
+ 4,
698
+ 5,
699
+ 7,
700
+ 9,
701
+ 11
702
+ ]
703
+ },
704
+ {
705
+ name: "Natural minor (Aeolian)",
706
+ steps: [
707
+ 0,
708
+ 2,
709
+ 3,
710
+ 5,
711
+ 7,
712
+ 8,
713
+ 10
714
+ ]
715
+ },
716
+ {
717
+ name: "Harmonic minor",
718
+ steps: [
719
+ 0,
720
+ 2,
721
+ 3,
722
+ 5,
723
+ 7,
724
+ 8,
725
+ 11
726
+ ]
727
+ },
728
+ {
729
+ name: "Melodic minor",
730
+ steps: [
731
+ 0,
732
+ 2,
733
+ 3,
734
+ 5,
735
+ 7,
736
+ 9,
737
+ 11
738
+ ]
739
+ },
740
+ {
741
+ name: "Dorian",
742
+ steps: [
743
+ 0,
744
+ 2,
745
+ 3,
746
+ 5,
747
+ 7,
748
+ 9,
749
+ 10
750
+ ]
751
+ },
752
+ {
753
+ name: "Phrygian",
754
+ steps: [
755
+ 0,
756
+ 1,
757
+ 3,
758
+ 5,
759
+ 7,
760
+ 8,
761
+ 10
762
+ ]
763
+ },
764
+ {
765
+ name: "Lydian",
766
+ steps: [
767
+ 0,
768
+ 2,
769
+ 4,
770
+ 6,
771
+ 7,
772
+ 9,
773
+ 11
774
+ ]
775
+ },
776
+ {
777
+ name: "Mixolydian",
778
+ steps: [
779
+ 0,
780
+ 2,
781
+ 4,
782
+ 5,
783
+ 7,
784
+ 9,
785
+ 10
786
+ ]
787
+ },
788
+ {
789
+ name: "Locrian",
790
+ steps: [
791
+ 0,
792
+ 1,
793
+ 3,
794
+ 5,
795
+ 6,
796
+ 8,
797
+ 10
798
+ ]
799
+ },
800
+ {
801
+ name: "Phrygian dominant",
802
+ steps: [
803
+ 0,
804
+ 1,
805
+ 4,
806
+ 5,
807
+ 7,
808
+ 8,
809
+ 10
810
+ ]
811
+ },
812
+ {
813
+ name: "Double harmonic",
814
+ steps: [
815
+ 0,
816
+ 1,
817
+ 4,
818
+ 5,
819
+ 7,
820
+ 8,
821
+ 11
822
+ ]
823
+ },
824
+ {
825
+ name: "Major pentatonic",
826
+ steps: [
827
+ 0,
828
+ 2,
829
+ 4,
830
+ 7,
831
+ 9
832
+ ]
833
+ },
834
+ {
835
+ name: "Minor pentatonic",
836
+ steps: [
837
+ 0,
838
+ 3,
839
+ 5,
840
+ 7,
841
+ 10
842
+ ]
843
+ },
844
+ {
845
+ name: "Blues",
846
+ steps: [
847
+ 0,
848
+ 3,
849
+ 5,
850
+ 6,
851
+ 7,
852
+ 10
853
+ ]
854
+ },
855
+ {
856
+ name: "Whole tone",
857
+ steps: [
858
+ 0,
859
+ 2,
860
+ 4,
861
+ 6,
862
+ 8,
863
+ 10
864
+ ]
865
+ },
866
+ {
867
+ name: "Diminished (whole-half)",
868
+ steps: [
869
+ 0,
870
+ 2,
871
+ 3,
872
+ 5,
873
+ 6,
874
+ 8,
875
+ 9,
876
+ 11
877
+ ]
878
+ },
879
+ {
880
+ name: "Diminished (half-whole)",
881
+ steps: [
882
+ 0,
883
+ 1,
884
+ 3,
885
+ 4,
886
+ 6,
887
+ 7,
888
+ 9,
889
+ 10
890
+ ]
891
+ },
892
+ {
893
+ name: "Chromatic",
894
+ steps: [
895
+ 0,
896
+ 1,
897
+ 2,
898
+ 3,
899
+ 4,
900
+ 5,
901
+ 6,
902
+ 7,
903
+ 8,
904
+ 9,
905
+ 10,
906
+ 11
907
+ ]
908
+ }
909
+ ], fe = [
910
+ "the root",
911
+ "a minor 2nd",
912
+ "a major 2nd",
913
+ "a minor 3rd",
914
+ "a major 3rd",
915
+ "a perfect 4th",
916
+ "a tritone",
917
+ "a perfect 5th",
918
+ "a minor 6th",
919
+ "a major 6th",
920
+ "a minor 7th",
921
+ "a major 7th"
922
+ ];
923
+ function U(e) {
924
+ let t = e.replace(/[-\s]/g, "").toUpperCase();
925
+ return H.includes(t) ? t : null;
926
+ }
927
+ function pe(e) {
928
+ let t = H.indexOf(e);
929
+ return t <= 0 ? t === 0 ? "the first row (the scale root)" : e : `${fe[t]} (+${t} semitones above C)`;
930
+ }
931
+ function me(e) {
932
+ let t = new Set(e);
933
+ if (t.size === 0) return [];
934
+ let n = [];
935
+ for (let e of de) if (e.steps.length === t.size) for (let r = 0; r < 12; r += 1) e.steps.every((e) => t.has((e + r) % 12)) && n.push({
936
+ root: r,
937
+ name: e.name
938
+ });
939
+ return n.sort((e, t) => e.root - t.root), n.map((e) => e.root === 0 ? e.name : `${e.name} from ${H[e.root]}`);
940
+ }
941
+ function he(e) {
942
+ let t = e.filter((e) => e.enabled === !0), n = t.map((e) => e.interval), r = me(t.map((e) => e.semitone)), i = e.filter((e) => e.enabled === !0 && e.offset != null && e.offset !== 0).map((e) => ({
943
+ interval: e.interval,
944
+ offset: e.offset
945
+ }));
946
+ return {
947
+ notes: e,
948
+ enabled: n,
949
+ shapes: r,
950
+ detuned: i,
951
+ summary: W({
952
+ enabled: n,
953
+ shapes: r,
954
+ detuned: i
955
+ }).join(" — ")
956
+ };
957
+ }
958
+ function W(e) {
959
+ let { enabled: t, shapes: n, detuned: r } = e;
960
+ if (!t.length) return ["no notes enabled"];
961
+ let i = n[0] ?? `${t.length} notes, custom scale`;
962
+ return r.length && (i += `; detuned: ${r.map((e) => `${e.interval} ${G(e.offset)}`).join(", ")}`), [t.join(" "), i];
963
+ }
964
+ function G(e) {
965
+ return `${e > 0 ? "+" : e < 0 ? "−" : ""}${Math.abs(e).toFixed(2)} st`;
466
966
  }
467
- var o = new Set([
967
+ //#endregion
968
+ //#region src/viewContext.ts
969
+ var ge = new Set([
468
970
  "--",
469
971
  "---",
470
972
  "---00",
471
973
  "----",
472
974
  "-"
473
975
  ]);
474
- function s(e) {
475
- return e ? o.has(e) || /^-+$/.test(e) : !0;
976
+ function K(e) {
977
+ return e ? ge.has(e) || /^-+$/.test(e) : !0;
476
978
  }
477
- function c(e) {
979
+ function _e(e) {
478
980
  let t = e.trim();
479
- if (!t || s(t)) return null;
981
+ if (!t || K(t)) return null;
480
982
  let n = parseInt(t, 16);
481
983
  return Number.isNaN(n) ? null : n;
482
984
  }
483
- function l(e, t, n) {
985
+ function ve(e, t, n) {
484
986
  return t >= e.length ? "" : e.slice(t, Math.min(t + n, e.length));
485
987
  }
486
- function u(e) {
988
+ function ye(e) {
487
989
  if (!e) return {
488
990
  viewId: null,
489
991
  isUnsaved: !1
490
992
  };
491
- let t = e.trim(), n = t.endsWith("*"), r = (n ? t.slice(0, -1).trimEnd() : t).split(/\s+/), i = r[r.length - 1] ?? "";
993
+ let t = e.replace(/[{}]/g, "0").trim(), n = t.endsWith("*"), r = (n ? t.slice(0, -1).trimEnd() : t).split(/\s+/), i = r[r.length - 1] ?? "";
492
994
  return {
493
995
  viewId: /^[0-9A-Fa-f]{1,2}$/.test(i) ? i.toUpperCase() : null,
494
996
  isUnsaved: n
495
997
  };
496
998
  }
497
- function d(e) {
999
+ function be(e) {
498
1000
  return e.length > 0 && /^[^a-zA-Z0-9 ]/.test(e[0]) ? {
499
1001
  line: e.slice(1),
500
1002
  offset: 1
@@ -503,8 +1005,31 @@ function d(e) {
503
1005
  offset: 0
504
1006
  };
505
1007
  }
506
- function f(e, t) {
507
- let n = l(t, e.x, e.width).trim(), r = s(n), i = [
1008
+ function xe(e, t) {
1009
+ let n = ve(t, e.x, e.width).trim();
1010
+ n.includes("^") && (e.type === "fxCommand" || e.type === "fxValue") && (n = "");
1011
+ let r = K(n);
1012
+ if (e.format) {
1013
+ let t = r ? null : C(n, e.format), i = e.type === "name" || e.type === "fileEntry", a = t?.text != null && !i ? t.text.toUpperCase() : t?.text ?? null;
1014
+ return {
1015
+ key: e.key,
1016
+ label: e.label,
1017
+ type: e.type,
1018
+ rawValue: n,
1019
+ hexValue: t?.hexValue ?? null,
1020
+ isEmpty: r,
1021
+ meta: e.meta,
1022
+ description: e.description,
1023
+ text: a,
1024
+ numericValue: t?.numericValue ?? null,
1025
+ values: t?.values ?? null,
1026
+ parts: e.parts,
1027
+ unit: e.unit,
1028
+ valueDescription: !r && w(e.options, a ?? n) || void 0,
1029
+ fileKind: e.type === "fileEntry" ? Se(n) : void 0
1030
+ };
1031
+ }
1032
+ let i = [
508
1033
  "chainRef",
509
1034
  "phraseRef",
510
1035
  "velocity",
@@ -520,7 +1045,7 @@ function f(e, t) {
520
1045
  if (!r && i.includes(e.type)) if (a.includes(e.type)) {
521
1046
  let e = parseInt(n, 10);
522
1047
  o = Number.isNaN(e) ? null : e;
523
- } else o = c(n);
1048
+ } else o = _e(n);
524
1049
  return {
525
1050
  key: e.key,
526
1051
  label: e.label,
@@ -531,14 +1056,20 @@ function f(e, t) {
531
1056
  meta: e.meta
532
1057
  };
533
1058
  }
534
- function p(e, t) {
535
- let n = l(e, t.x, t.width).trim();
1059
+ function Se(e) {
1060
+ if (e === "/..") return "parent";
1061
+ if (e.startsWith("/")) return "directory";
1062
+ let t = /\.([a-z0-9]+)$/i.exec(e)?.[1]?.toLowerCase();
1063
+ return t === "m8i" ? "instrumentPreset" : t === "wav" ? "sample" : t?.startsWith("m8") ? "m8file" : "file";
1064
+ }
1065
+ function Ce(e, t) {
1066
+ let n = ve(e, t.x, t.width).trim();
536
1067
  if (!n) return null;
537
- if (t.parse === "hex") return c(n);
1068
+ if (t.parse === "hex") return _e(n);
538
1069
  let r = parseInt(n, 10);
539
1070
  return Number.isNaN(r) ? null : r;
540
1071
  }
541
- function m(e, t) {
1072
+ function we(e, t) {
542
1073
  for (let n of e) if (t >= n.x && t < n.x + n.width) return n;
543
1074
  let n = null, r = 2;
544
1075
  for (let i of e) {
@@ -547,104 +1078,383 @@ function m(e, t) {
547
1078
  }
548
1079
  return n;
549
1080
  }
550
- function h(e) {
551
- let t = e.viewName;
1081
+ function q(e, t) {
1082
+ let n = {};
1083
+ for (let r of e.columns ?? []) n[r.key] = xe(r, t);
1084
+ for (let e of Object.keys(n)) {
1085
+ let t = /^fx(\d)cmd$/.exec(e)?.[1], r = t ? n[`fx${t}val`] : void 0;
1086
+ r && n[e].isEmpty && (n[`fx${t}val`] = {
1087
+ ...r,
1088
+ isEmpty: !0
1089
+ });
1090
+ }
1091
+ return {
1092
+ rowIndex: e.rowField ? Ce(t, e.rowField) : null,
1093
+ rowKey: e.rowField?.key ?? "row",
1094
+ rowId: null,
1095
+ fields: n
1096
+ };
1097
+ }
1098
+ var Te = (e) => e.replace(/\s+/g, ""), J = (e) => e.slice(1);
1099
+ function Ee(e, t) {
1100
+ if (!t || !e.cursorPos || !e.currentLine) return !1;
1101
+ let n = t.lines[e.cursorPos.y];
1102
+ return n != null && Te(n) === Te(e.currentLine);
1103
+ }
1104
+ var De = 16;
1105
+ function Oe(e, t, n, r) {
1106
+ let i = (t.cursorPos?.y ?? -1) - r;
1107
+ if (i < 0) return null;
1108
+ let a = [], o = null;
1109
+ for (let t = 0; t < De; t += 1) {
1110
+ let r = n.lines[i + t];
1111
+ if (r == null) return null;
1112
+ let s = J(r), c = q(e, s);
1113
+ if (c.rowIndex !== t) return null;
1114
+ a.push(c);
1115
+ let l = s.indexOf("^^");
1116
+ o == null && l >= 0 && (o = ke(e, l));
1117
+ }
1118
+ return {
1119
+ steps: a,
1120
+ carriedRepLane: o
1121
+ };
1122
+ }
1123
+ function ke(e, t) {
1124
+ let n = [];
1125
+ for (let r = 1; r <= 3; r += 1) {
1126
+ let i = e.columns?.find((e) => e.key === `fx${r}cmd`), a = e.columns?.find((e) => e.key === `fx${r}val`);
1127
+ if (!i || !a) continue;
1128
+ let o = a.x + a.width - 1;
1129
+ n.push({
1130
+ lane: r,
1131
+ dist: t < i.x ? i.x - t : t > o ? t - o : 0
1132
+ });
1133
+ }
1134
+ let r = Math.min(...n.map((e) => e.dist)), i = n.filter((e) => e.dist === r);
1135
+ return r <= 1 && i.length === 1 ? i[0].lane : null;
1136
+ }
1137
+ function Ae(e) {
1138
+ let t = U(e.fields.interval?.rawValue ?? "");
552
1139
  if (!t) return null;
553
- let n = r.views[t] ?? null, i = n?.type === "grid", a = n?.title ?? null, o = n?.description ?? null, { viewId: s, isUnsaved: c } = u(e.viewTitle);
554
- if (!i || !n) return {
555
- viewName: t,
556
- viewTitle: a,
557
- viewDescription: o,
558
- viewId: s,
559
- isUnsaved: c,
1140
+ let n = e.fields.en?.rawValue.toUpperCase(), r = parseFloat(e.fields.offset?.rawValue ?? "");
1141
+ return {
1142
+ interval: t,
1143
+ semitone: H.indexOf(t),
1144
+ enabled: n === "ON" ? !0 : n === "OFF" ? !1 : null,
1145
+ offset: Number.isNaN(r) ? null : r
1146
+ };
1147
+ }
1148
+ function je(e, t) {
1149
+ let n = /* @__PURE__ */ new Map();
1150
+ for (let r of t.lines) {
1151
+ let t = q(e, J(r)), i = Ae(t), a = t.fields.en?.rawValue.toUpperCase();
1152
+ !i || a !== "ON" && a !== "OFF" && a !== "--" || n.has(i.interval) || n.set(i.interval, i);
1153
+ }
1154
+ return n.size === H.length ? H.map((e) => n.get(e)) : null;
1155
+ }
1156
+ function Me(e, t, n, r) {
1157
+ let i = {
1158
+ ...r,
1159
+ isGridView: !1,
1160
+ isParameterView: !0,
1161
+ section: null,
1162
+ instrumentType: null,
1163
+ row: null,
1164
+ activeField: null,
1165
+ lineText: null,
1166
+ steps: null,
1167
+ carriedRepLane: null,
1168
+ fxLane: null,
1169
+ relativeFx: null,
1170
+ resetsRelative: null,
1171
+ scaleNote: null,
1172
+ scale: null
1173
+ }, a = e.cursorPos, o = a ? a.x - 1 : 0, s = a && Ee(e, t) ? t : null, c = s && a ? J(s.lines[a.y] ?? "") : e.currentLine ?? "";
1174
+ if (!c.trim()) return i;
1175
+ let l = s && a ? s.lines.slice(0, a.y + 1).reverse().map(J) : [c], u = r.viewName === "inst" ? h(s ? s.lines.map(J) : [c]) : null, d = {
1176
+ instrumentKey: u?.key ?? null,
1177
+ entryText: e.textUnderCursor
1178
+ };
1179
+ if (!s && a && n.kind == null) for (let e = 0; e <= Math.min(o, 24); e += 1) {
1180
+ let t = " ".repeat(e) + c;
1181
+ if (b(n, t, {
1182
+ ...d,
1183
+ section: f(n, [t])
1184
+ }).cells.some((e) => o >= e.x && o < e.x + e.width)) {
1185
+ c = t;
1186
+ break;
1187
+ }
1188
+ }
1189
+ let m = f(n, s ? l : [c]), { rowId: g, cells: _ } = b(n, c, {
1190
+ ...d,
1191
+ section: m
1192
+ }), v = {};
1193
+ for (let e of _) v[e.key] = xe(e, c);
1194
+ let y = {
1195
+ rowIndex: null,
1196
+ rowKey: "param",
1197
+ rowId: g,
1198
+ fields: v
1199
+ }, x = null, S = a ? we(_, o) : null;
1200
+ S && (x = {
1201
+ ...v[S.key],
1202
+ viewName: r.viewName,
1203
+ rowIndex: null
1204
+ });
1205
+ let C = S?.meta?.zone;
1206
+ return s && typeof C == "string" && (m = p(n, C, l) ?? m), {
1207
+ ...i,
1208
+ section: m,
1209
+ instrumentType: u,
1210
+ row: y,
1211
+ activeField: x,
1212
+ lineText: c.trim()
1213
+ };
1214
+ }
1215
+ function Y(e, t) {
1216
+ let n = e.viewName;
1217
+ if (!n) return null;
1218
+ let i = r.views[n] ?? null, a = i?.type === "grid", o = i?.title ?? null, s = i?.description ?? null, { viewId: c, isUnsaved: u } = ye(e.viewTitle), d = {
1219
+ viewName: n,
1220
+ viewTitle: o,
1221
+ viewDescription: s,
1222
+ viewId: c,
1223
+ isUnsaved: u
1224
+ }, f = {
1225
+ ...d,
1226
+ isParameterView: !1,
1227
+ section: null,
1228
+ instrumentType: null,
1229
+ lineText: null,
1230
+ steps: null,
1231
+ carriedRepLane: null,
1232
+ fxLane: null,
1233
+ relativeFx: null,
1234
+ resetsRelative: null,
1235
+ scaleNote: null,
1236
+ scale: null
1237
+ }, p = i?.type === "parameter" ? l(n) : null;
1238
+ if (p) return Me(e, t, p, d);
1239
+ if (!a || !i) return {
1240
+ ...f,
560
1241
  isGridView: !1,
561
1242
  row: null,
562
1243
  activeField: null
563
1244
  };
564
- let l = e.currentLine;
565
- if (!l) return {
566
- viewName: t,
567
- viewTitle: a,
568
- viewDescription: o,
569
- viewId: s,
570
- isUnsaved: c,
1245
+ let m = e.currentLine;
1246
+ if (!m) return {
1247
+ ...f,
571
1248
  isGridView: !0,
572
1249
  row: null,
573
1250
  activeField: null
574
1251
  };
575
- let { line: h, offset: g } = d(l), _ = e.cursorPos ? e.cursorPos.x - g : 0, v = n.rowField ? p(h, n.rowField) : null, y = {};
576
- for (let e of n.columns) y[e.key] = f(e, h);
577
- let b = {
578
- rowIndex: v,
579
- rowKey: n.rowField?.key ?? "row",
580
- fields: y
581
- }, x = null;
1252
+ let { line: h } = be(m), g = e.cursorPos ? e.cursorPos.x - 1 : 0, _ = q(i, h), v = n === "scale" && !U(_.fields.interval?.rawValue ?? "") ? l(n) : null;
1253
+ if (v) return Me(e, t, v, d);
1254
+ let y = null;
582
1255
  if (e.cursorPos) {
583
- let e = m(n.columns, _);
1256
+ let e = we(i.columns ?? [], g);
584
1257
  if (e) {
585
- let n = y[e.key];
586
- n && (x = {
587
- ...n,
588
- viewName: t,
589
- rowIndex: v
1258
+ let t = _.fields[e.key];
1259
+ t && (y = {
1260
+ ...t,
1261
+ viewName: n,
1262
+ rowIndex: _.rowIndex
590
1263
  });
591
1264
  }
592
1265
  }
1266
+ let b = null, x = null, S = null, C = null, w = null, T = null;
1267
+ if (Ee(e, t)) {
1268
+ if (n === "phrase" && _.rowIndex != null) {
1269
+ let n = Oe(i, e, t, _.rowIndex);
1270
+ if (n) {
1271
+ b = n.steps, x = n.carriedRepLane;
1272
+ let e = y ? /^fx(\d)(cmd|val)$/.exec(y.key)?.[1] : void 0;
1273
+ e && (S = le(b, Number(e), _.rowIndex, x === Number(e))), C = L(b, _.rowIndex, x), _.rowIndex > 0 && I(_) && (w = L(b, _.rowIndex - 1, x));
1274
+ }
1275
+ } else if (n === "scale") {
1276
+ let e = je(i, t);
1277
+ e && (T = he(e));
1278
+ }
1279
+ }
1280
+ let E = n === "scale" ? Ae(_) : null;
593
1281
  return {
594
- viewName: t,
595
- viewTitle: a,
596
- viewDescription: o,
597
- viewId: s,
598
- isUnsaved: c,
1282
+ ...f,
599
1283
  isGridView: !0,
600
- row: b,
601
- activeField: x
1284
+ row: _,
1285
+ activeField: y,
1286
+ lineText: h.trim() || null,
1287
+ steps: b,
1288
+ carriedRepLane: x,
1289
+ fxLane: S,
1290
+ relativeFx: C,
1291
+ resetsRelative: w,
1292
+ scaleNote: E,
1293
+ scale: T
602
1294
  };
603
1295
  }
604
- function g(e) {
605
- if (!e.activeField) return e.viewTitle ?? e.viewName;
606
- let { activeField: t, row: n } = e, r = [], i = _(t);
607
- if (r.push(`${t.label}: ${i}`), t.type === "fxCommand" && !t.isEmpty) {
608
- let e = a(t.rawValue);
609
- e && r.push(`(${e.description})`);
1296
+ function X(e) {
1297
+ if (e.isParameterView) return ze(e);
1298
+ if (e.viewName === "scale") {
1299
+ let t = Be(e);
1300
+ if (t) return t;
1301
+ }
1302
+ if (!e.activeField) return Q(["location", e.viewTitle ?? e.viewName]);
1303
+ let { activeField: t, row: n } = e, r = Q(["field", `${t.label}: ${$(t)}`]), i = (t.type === "fxCommand" || t.type === "fxValue") && n ? Ne(e, t, n) : Ie(e, t), a = i.length > 0;
1304
+ if (t.type === "fxCommand" && !t.isEmpty) {
1305
+ let e = a && /^(REP|RTO)$/i.test(t.rawValue) ? void 0 : O(t.rawValue);
1306
+ e && r.push({
1307
+ kind: "fxInfo",
1308
+ text: `(${Pe(e)})`
1309
+ });
610
1310
  }
611
1311
  if (t.type === "fxValue" && n) {
612
1312
  let e = t.key.replace("val", "cmd"), i = n.fields[e];
613
1313
  if (i && !i.isEmpty) {
614
- let e = a(i.rawValue), t = e ? `${i.rawValue} (${e.description})` : i.rawValue;
615
- r.push(`for ${t}`);
1314
+ let e = a && /^(REP|RTO)$/i.test(i.rawValue) ? void 0 : O(i.rawValue), t = e ? `${i.rawValue} (${Pe(e)})` : i.rawValue;
1315
+ r.push({
1316
+ kind: "fxTarget",
1317
+ text: `for ${t}`
1318
+ });
616
1319
  }
617
1320
  }
618
- if (t.meta?.trackIndex != null && r.push(`Track ${t.meta.trackIndex}`), n?.rowIndex != null) {
1321
+ if (r.push(...i), t.meta?.trackIndex != null && r.push({
1322
+ kind: "track",
1323
+ text: `Track ${t.meta.trackIndex}`
1324
+ }), n?.rowIndex != null) {
619
1325
  let t = n.rowIndex.toString(16).toUpperCase().padStart(2, "0");
620
- r.push(`${e.viewTitle ?? e.viewName} row ${t}`);
1326
+ r.push({
1327
+ kind: "location",
1328
+ text: `${e.viewTitle ?? e.viewName} row ${t}`
1329
+ });
621
1330
  }
622
- return r.join(" — ");
1331
+ return r;
1332
+ }
1333
+ function Z(e) {
1334
+ return X(e).map((e) => e.text).join(" — ");
623
1335
  }
624
- function _(e) {
1336
+ function Q(...e) {
1337
+ return e.flatMap(([e, t]) => t ? [{
1338
+ kind: e,
1339
+ text: t
1340
+ }] : []);
1341
+ }
1342
+ function Ne(e, t, n) {
1343
+ let r = /^fx(\d)/.exec(t.key)?.[1];
1344
+ if (!r) return [];
1345
+ let i = n.fields[`fx${r}cmd`], a = n.fields[`fx${r}val`];
1346
+ if (!i || i.isEmpty) {
1347
+ if (e.fxLane?.event !== "continue") return [];
1348
+ let t = e.fxLane.source?.cmd, n = t && k(t) ? B(e.relativeFx?.[t]) : null;
1349
+ return Q(["fxLane", F(e.fxLane)], ["relative", n]);
1350
+ }
1351
+ let o = i.rawValue.toUpperCase(), s = e.fxLane && e.fxLane.event !== "none" && e.fxLane.event !== "set" ? F(e.fxLane) : null;
1352
+ if (o === "REP" || o === "RTO") {
1353
+ let t = e.fxLane?.source?.cmd, n = o === "REP" && e.fxLane?.active && t && k(t) ? B(e.relativeFx?.[t]) : null;
1354
+ return Q(["fxLane", s], ["relative", n]);
1355
+ }
1356
+ if (!a || a.isEmpty || a.hexValue == null) return Q(["fxLane", s]);
1357
+ let c = t.type === "fxCommand" ? `value ${N(o, a.hexValue)}: ` : "", l = se(o, a.hexValue, {
1358
+ note: n.fields.note?.isEmpty ? null : n.fields.note?.rawValue,
1359
+ inTable: e.viewName === "table"
1360
+ }), u = null;
1361
+ return k(o) ? u = B(e.relativeFx?.[o]) : o === "RET" && e.resetsRelative && (u = V(e.resetsRelative)), Q(["meaning", l ? `${c}${l}` : null], ["fxLane", s], ["relative", u]);
1362
+ }
1363
+ function Pe(e) {
1364
+ let t = e.description.replace(/\.$/, "");
1365
+ return e.instrumentTypes ? `${t}; offered by ${e.instrumentTypes.map((e) => Fe[e] ?? e).join(", ")} instruments` : t;
1366
+ }
1367
+ var Fe = {
1368
+ sampler: "Sampler",
1369
+ macrosynth: "Macrosynth",
1370
+ fmsynth: "FM Synth",
1371
+ hypersynth: "Hypersynth",
1372
+ wavsynth: "Wavsynth",
1373
+ external: "External",
1374
+ midiout: "MIDI Out"
1375
+ };
1376
+ function Ie(e, t) {
1377
+ return t.type !== "instrumentRef" || t.isEmpty || !e.resetsRelative ? [] : Q(["relative", V(e.resetsRelative)]);
1378
+ }
1379
+ var Le = {
1380
+ MODFX: "ModFX",
1381
+ DELAY: "Delay",
1382
+ REVERB: "Reverb"
1383
+ }, Re = {
1384
+ parent: "goes up to the parent directory",
1385
+ directory: "directory: [EDIT] opens it",
1386
+ instrumentPreset: "instrument preset: [EDIT] selects it",
1387
+ sample: "sample: [EDIT] selects it",
1388
+ m8file: "M8 file: [EDIT] selects it",
1389
+ file: "file: [EDIT] selects it"
1390
+ };
1391
+ function ze(e) {
1392
+ let t = `${e.viewTitle ?? e.viewName}${e.viewId ? ` ${e.viewId}` : ""}`, n = e.activeField;
1393
+ if (!n) return Q(["location", t], ["line", e.lineText]);
1394
+ let r = e.instrumentType?.key ? g(e.instrumentType.key) : null;
1395
+ return Q(["field", `${n.label}: ${$(n)}`], ["optionInfo", n.valueDescription], ["fieldInfo", n.description], ["fileInfo", n.fileKind && Re[n.fileKind]], ["instrument", e.instrumentType && `${r?.name ?? e.instrumentType.text} instrument`], ["section", e.section && (Le[e.section] ?? e.section)], ["location", t]);
1396
+ }
1397
+ function Be(e) {
1398
+ let t = `${e.viewTitle ?? e.viewName}${e.viewId ? ` ${e.viewId}` : ""}`, n = e.activeField, r = e.scaleNote;
1399
+ if (!n || !r) return e.lineText ? Q(["location", t], ["line", e.lineText]) : null;
1400
+ let { interval: i, enabled: a, offset: o } = r, s;
1401
+ if (n.key === "offset") {
1402
+ let e = o == null ? `detune of ${i}` : o === 0 ? `${i} is not detuned` : `${i} is detuned by ${G(o)}`;
1403
+ s = Q(["field", `${n.label}: ${n.rawValue || "(empty)"}`], ["meaning", e], ["meaning", a === !1 ? "(note is OFF)" : null]);
1404
+ } else {
1405
+ let e = a === !0 ? "is in" : a === !1 ? "is not in" : "is not yet set in";
1406
+ s = Q(["field", `${n.label}: ${n.key === "en" ? n.rawValue.toUpperCase() || "(unset)" : i}`], ["meaning", i], ["meaning", pe(i)], ["meaning", `${e} the scale`]);
1407
+ }
1408
+ if (e.scale) {
1409
+ let [t, n] = W(e.scale);
1410
+ s.push(...Q(["scale", `Scale: ${t}`], ["scale", n]));
1411
+ }
1412
+ return [...s, ...Q(["location", `${t} row ${i}`])];
1413
+ }
1414
+ function Ve(e) {
1415
+ let t = e.unit ?? "";
1416
+ if (e.values && e.parts) {
1417
+ let n = e.hexValue != null, r = e.values.map((e) => n ? e.toString(16).toUpperCase().padStart(2, "0") : String(e)), i = e.parts.map((e, n) => `${e} ${r[n] ?? "?"}${t}`).join(", ");
1418
+ return `${r.join(":")} (${i})`;
1419
+ }
1420
+ return e.hexValue == null ? e.numericValue == null ? e.text ?? e.rawValue : `${e.rawValue}${t}` : `${e.rawValue.slice(0, 2)}h (dec ${e.hexValue})${e.text ? ` ${e.text}` : ""}`;
1421
+ }
1422
+ function $(e) {
625
1423
  if (e.isEmpty) return "(empty)";
626
- switch (e.type) {
627
- case "note": return e.rawValue === "OFF" ? "Note Off" : `Note ${e.rawValue}`;
1424
+ let t = e.type === "name" || e.type === "fileEntry" ? e : {
1425
+ ...e,
1426
+ rawValue: e.rawValue.toUpperCase()
1427
+ };
1428
+ switch (t.type) {
1429
+ case "note": return t.rawValue.toUpperCase() === "OFF" ? "Note Off" : `Note ${t.rawValue}`;
628
1430
  case "transpose": {
629
- if (e.hexValue == null) return e.rawValue;
630
- if (e.hexValue === 0) return "±0 st";
631
- let t = e.hexValue > 127 ? e.hexValue - 256 : e.hexValue;
632
- return `${t > 0 ? "+" : ""}${t} st`;
1431
+ if (t.hexValue == null) return t.rawValue;
1432
+ if (t.hexValue === 0) return "±0 st";
1433
+ let e = t.hexValue > 127 ? t.hexValue - 256 : t.hexValue;
1434
+ return `${e > 0 ? "+" : ""}${e} st`;
633
1435
  }
634
- case "velocity": return e.hexValue == null ? e.rawValue : `${e.rawValue}h (${e.hexValue} / 127 max)`;
1436
+ case "velocity": return t.hexValue == null ? t.rawValue : `${t.rawValue}h (${t.hexValue} / 127 max)`;
635
1437
  case "chainRef":
636
1438
  case "phraseRef":
637
- case "instrumentRef": return e.rawValue;
638
- case "fxCommand": return e.rawValue;
639
- case "fxValue": return e.hexValue == null ? e.rawValue : `${e.rawValue}h (dec ${e.hexValue})`;
640
- case "ticks": return e.rawValue === "00" ? "00 (skip step)" : e.hexValue == null ? e.rawValue : `${e.rawValue}h (${e.hexValue} ticks)`;
641
- case "volume": return e.rawValue;
642
- default: return e.rawValue;
1439
+ case "instrumentRef": return t.rawValue;
1440
+ case "fxCommand": return t.rawValue;
1441
+ case "fxValue": return t.hexValue == null ? t.rawValue : `${t.rawValue}h (dec ${t.hexValue})`;
1442
+ case "ticks": return t.rawValue === "00" ? "00 (skip step)" : t.hexValue == null ? t.rawValue : `${t.rawValue}h (${t.hexValue} ticks)`;
1443
+ case "volume": return t.rawValue;
1444
+ case "instrumentType":
1445
+ case "action":
1446
+ case "fileEntry": return t.text ?? t.rawValue;
1447
+ case "name": return `"${t.rawValue}"`;
1448
+ case "option": return t.hexValue != null && t.text ? `${t.rawValue.slice(0, 2)} ${t.text}` : t.text ?? t.rawValue;
1449
+ case "parameter": return Ve(t);
1450
+ case "noteInterval": return `Interval ${U(t.rawValue) ?? t.rawValue}`;
1451
+ case "semitoneOffset": return t.isEmpty ? "(empty)" : `${t.rawValue} st`;
1452
+ default: return t.rawValue;
643
1453
  }
644
1454
  }
645
1455
  //#endregion
646
1456
  //#region src/client.ts
647
- var v = () => ({
1457
+ var He = () => ({
648
1458
  viewName: null,
649
1459
  viewTitle: null,
650
1460
  minimapKey: null,
@@ -660,9 +1470,9 @@ var v = () => ({
660
1470
  fontMode: null,
661
1471
  systemInfo: null,
662
1472
  macroRunning: !1
663
- }), y = class {
1473
+ }), Ue = class {
664
1474
  constructor(e = {}) {
665
- this.connection = null, this.remoteHandle = null, this.localHandle = null, this.stateCallbacks = /* @__PURE__ */ new Set(), this.viewCallbacks = /* @__PURE__ */ new Set(), this.cursorCallbacks = /* @__PURE__ */ new Set(), this.textCallbacks = /* @__PURE__ */ new Set(), this.keyCallbacks = /* @__PURE__ */ new Set(), this._state = v(), this._isConnected = !1, this.config = e;
1475
+ this.connection = null, this.remoteHandle = null, this.localHandle = null, this.stateCallbacks = /* @__PURE__ */ new Set(), this.viewCallbacks = /* @__PURE__ */ new Set(), this.cursorCallbacks = /* @__PURE__ */ new Set(), this.textCallbacks = /* @__PURE__ */ new Set(), this.keyCallbacks = /* @__PURE__ */ new Set(), this._state = He(), this._screen = null, this.screenRefreshing = !1, this.screenDirty = !1, this._isConnected = !1, this.config = e;
666
1476
  }
667
1477
  get state() {
668
1478
  return this._state;
@@ -682,7 +1492,7 @@ var v = () => ({
682
1492
  }));
683
1493
  let i = await e(r, { ping: async () => "pong" });
684
1494
  this.connection = i, this.remoteHandle = i.remoteHandle(), this.localHandle = i.localHandle(), this._isConnected = !0, this.remoteHandle.addEventListener("stateChanged", (e) => {
685
- this._state = e, this.stateCallbacks.forEach((t) => {
1495
+ this._state = e, this.refreshScreen(), this.stateCallbacks.forEach((t) => {
686
1496
  t(e);
687
1497
  });
688
1498
  }), this.remoteHandle.addEventListener("viewChanged", ({ viewName: e, viewTitle: t }) => {
@@ -690,7 +1500,7 @@ var v = () => ({
690
1500
  ...this._state,
691
1501
  viewName: e,
692
1502
  viewTitle: t
693
- }, this.viewCallbacks.forEach((n) => {
1503
+ }, this.refreshScreen(), this.viewCallbacks.forEach((n) => {
694
1504
  n(e, t);
695
1505
  });
696
1506
  }), this.remoteHandle.addEventListener("cursorMoved", ({ pos: e, rect: t, selectionMode: n }) => {
@@ -699,7 +1509,7 @@ var v = () => ({
699
1509
  cursorPos: e,
700
1510
  cursorRect: t,
701
1511
  selectionMode: n
702
- }, this.cursorCallbacks.forEach((r) => {
1512
+ }, this.refreshScreen(), this.cursorCallbacks.forEach((r) => {
703
1513
  r(e, t, n);
704
1514
  });
705
1515
  }), this.remoteHandle.addEventListener("textUpdated", ({ textUnderCursor: e, currentLine: t }) => {
@@ -707,14 +1517,27 @@ var v = () => ({
707
1517
  ...this._state,
708
1518
  textUnderCursor: e,
709
1519
  currentLine: t
710
- }, this.textCallbacks.forEach((n) => {
1520
+ }, this.refreshScreen(), this.textCallbacks.forEach((n) => {
711
1521
  n(e, t);
712
1522
  });
713
1523
  }), this.remoteHandle.addEventListener("keyPressed", ({ keys: e }) => {
714
1524
  this.keyCallbacks.forEach((t) => {
715
1525
  t(e);
716
1526
  });
717
- }), await this.fetchState(), this.localHandle.emit("ready", void 0);
1527
+ }), await this.fetchState(), this.refreshScreen(), this.localHandle.emit("ready", void 0);
1528
+ }
1529
+ refreshScreen() {
1530
+ if (this.remoteHandle) {
1531
+ if (this.screenRefreshing) {
1532
+ this.screenDirty = !0;
1533
+ return;
1534
+ }
1535
+ this.screenRefreshing = !0, this.remoteHandle.call("getScreen").then((e) => {
1536
+ this._screen = e;
1537
+ }).catch(() => {}).finally(() => {
1538
+ this.screenRefreshing = !1, this.screenDirty && (this.screenDirty = !1, this.refreshScreen());
1539
+ });
1540
+ }
718
1541
  }
719
1542
  async navigateToView(e) {
720
1543
  if (!this.remoteHandle) throw Error("M8 SDK client is not connected");
@@ -768,6 +1591,30 @@ var v = () => ({
768
1591
  let e = await this.remoteHandle.call("getState");
769
1592
  return this._state = e, e;
770
1593
  }
1594
+ async getScreen() {
1595
+ if (!this.remoteHandle) throw Error("M8 SDK client is not connected");
1596
+ let e = await this.remoteHandle.call("getScreen");
1597
+ return this._screen = e, e;
1598
+ }
1599
+ async captureSnapshot() {
1600
+ let [e, t] = await Promise.all([this.fetchState(), this.getScreen()]), n = Y(e, t);
1601
+ return {
1602
+ capturedAt: Date.now(),
1603
+ state: {
1604
+ viewName: e.viewName,
1605
+ viewTitle: e.viewTitle,
1606
+ cursorPos: e.cursorPos,
1607
+ selectionMode: e.selectionMode,
1608
+ textUnderCursor: e.textUnderCursor,
1609
+ currentLine: e.currentLine,
1610
+ deviceModel: e.deviceModel
1611
+ },
1612
+ semantic: n,
1613
+ description: n ? Z(n) : null,
1614
+ descriptionParts: n ? X(n) : null,
1615
+ screen: t
1616
+ };
1617
+ }
771
1618
  onStateChange(e) {
772
1619
  return this.stateCallbacks.add(e), () => this.stateCallbacks.delete(e);
773
1620
  }
@@ -784,22 +1631,26 @@ var v = () => ({
784
1631
  return this.keyCallbacks.add(e), () => this.keyCallbacks.delete(e);
785
1632
  }
786
1633
  disconnect() {
787
- this.connection?.close(), this.connection = null, this.remoteHandle = null, this.localHandle = null, this._isConnected = !1, this.stateCallbacks.clear(), this.viewCallbacks.clear(), this.cursorCallbacks.clear(), this.textCallbacks.clear(), this.keyCallbacks.clear();
1634
+ this.connection?.close(), this.connection = null, this.remoteHandle = null, this.localHandle = null, this._isConnected = !1, this._screen = null, this.stateCallbacks.clear(), this.viewCallbacks.clear(), this.cursorCallbacks.clear(), this.textCallbacks.clear(), this.keyCallbacks.clear();
788
1635
  }
789
1636
  getSemanticContext() {
790
- return h(this._state);
1637
+ return Y(this._state, this._screen);
791
1638
  }
792
1639
  describeContext() {
793
- let e = h(this._state);
794
- return e ? g(e) : null;
1640
+ let e = Y(this._state, this._screen);
1641
+ return e ? Z(e) : null;
1642
+ }
1643
+ describeContextParts() {
1644
+ let e = Y(this._state, this._screen);
1645
+ return e ? X(e) : null;
795
1646
  }
796
1647
  };
797
- async function b(e = {}) {
798
- let t = new y(e);
1648
+ async function We(e = {}) {
1649
+ let t = new Ue(e);
799
1650
  return await t.connect(), t;
800
1651
  }
801
- function x(e = {}) {
802
- let t = new y(e);
1652
+ function Ge(e = {}) {
1653
+ let t = new Ue(e);
803
1654
  return {
804
1655
  client: t,
805
1656
  connect: async () => {
@@ -807,11 +1658,11 @@ function x(e = {}) {
807
1658
  }
808
1659
  };
809
1660
  }
810
- var S = {
811
- createM8Client: b,
812
- createM8ClientSync: x
1661
+ var Ke = {
1662
+ createM8Client: We,
1663
+ createM8ClientSync: Ge
813
1664
  };
814
1665
  //#endregion
815
- export { b as createM8Client, x as createM8ClientSync, S as default, g as describeContext, _ as formatFieldValue, h as getSemanticContext, a as lookupFxCommand };
1666
+ export { ne as RELATIVE_FX_RULE, We as createM8Client, Ge as createM8ClientSync, Ke as default, Z as describeContext, X as describeContextParts, $ as formatFieldValue, te as getInstrumentFxCommands, Y as getSemanticContext, O as lookupFxCommand };
816
1667
 
817
1668
  //# sourceMappingURL=index.js.map