hal/smk_input.h: Melodee's SMK-37 HAL as it is (velocity keybed, 18 buttons, 8
encoders, the button LEDs, pads, faders, wheels; the fm1_adc.h stand-ins, K5 as the
MASTER pot), with three no-op stand-ins for JIANT's dim / sweep LED calls. felucca.c
includes it instead of fm1_input.h and fm1_adc.h on the SMK (PB6 is the SMK's LCD
clock).
The mapping (panel.c, after Melodee's): FX=FX, SCALE=SCL, CHORD=ENV, NOTE REPEAT=LFO,
PARA=EDIT, GLOBE=GLO, PATCH=HOME, BT=SAVE, ARP, SEQ, SEQ PLAY=PLAY, SEQ REC=REC,
OCTAVE-/+ = OCT-/+; K1-K4 KNOB 1-4, K5 MASTER, K6 SELECT, K7 ALGORITHM, K8 PRESETS;
magic 'PNS5', validation against the SMK's 18 buttons / 8 encoders; HARDWARE
CALIBRATION asks by the printed names. ui_input.c: < and > one SELECT step, KNOB BANK /
FADER BANK nothing, the pad and outer-key queues drained, button loops over the SMK's
ids, an SMK ui_leds (button LEDs on/off, breathing = blink, the pads show their white
key's LED); ui.pg_down widened to 32 bits on the SMK. seq.c: a key struck again while
held (notes_retrig) sounds again. main.c: OCTAVE- + OCTAVE+ at power-on for the
calibration. console.c: no 'inp' on the SMK. lcd.c: the pad LED buffer in .bss.
Tests: tests/smk_map_test.c (the mapping), tests/smk_keys_test.c (Melodee's keybed
test, unchanged). The FM-1 build is byte-identical.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UVqsRpEnNJfjWWrH3C4opq
The main-loop code's repeated address and table work made calls (ui.c): TSEL (&trk[song.sel], a multiply and an add in
place at ~230 sites) a call from ui.c on (core.h's stays for the sound files before it; -5.0 KB), VAL and RATIO (-2.7 KB),
a track's engine (t->eng_req % NENGINES, 74 sites) and its table (-0.7 KB). The graphs no page reaches since the lenses
gone, each checked against the lenses' code and the coverage of ui_test and ui_render: SEQ > SONG's list (hidden, SAVE >
ARRANGE draws its own), PATTERN's 64 bars and LARGE's step strip (SEQ's cards are never tall), SCL's twelve keys, and
the draw_graph cases LFO MSEQ (MOD's lens), the tech graphs of LFO DEST, VOICE and MSEQ 2 (-3.3 KB). GEN's drum maps,
the throws' pools and DICE's bars, kept as text in gen_tables.c / song_dice.c, packed by a new generator
(tools/gen_drum_maps.py: each lane once, 16 levels a nibble or 2 bits a step) and the bass archetypes a byte a step
(-2.9 KB). The sound files' main-loop functions built for size too (size_fns.py: FM6's patch store, the kit's names,
MASTER's boot; what an interrupt reaches stays -Os).
Checked: every non-minsize function's disassembly as before (addresses aside: the audio ISR, the render loops, the hot
RAM code identical, target_budget's counts unchanged); 225,549 ui_render screens hashed pixel for pixel identical; GEN's
pieces for every genre and seed and SEQ's dice identical (a hash of every step and parameter); the packed tables decode
back to the text; cpu_vg's counts equal HEAD's; goldens unchanged. RAM .data+.bss 79172 B, pool spare 10880 B, RAM code
22472 B, all as before. ALL HOST TESTS PASSED.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh
The 0.8.7 field test (FM-1, CORES 2, LOAD FULL, a heavy 160 BPM song, USB CONSOLE captured at 48 kHz): USB audio
on raised CPU 65.5 -> 77 %, late halves 15 -> 50 /s, ~230 underruns /s, captures 10-20 % short.
- Root cause (audio.c): the ALNK0 ISR acknowledged a half after rendering it, so a render that ran past its half
cleared the next half's pending flip and that half was never rendered (the DAC replayed 2.9 ms of old audio; USB got
128 frames fewer). Every "late" half lost the next: ~14 % of the audio with USB on, the ring always dry (adj_down
saturated, ~230 underruns /s). Now the half is acked first: a late render is followed at once by the next, which
catches up glitch-free (the DMA reads the half behind the render); a half is lost only past ~1.7 halves, counted in
the console's new audio_lost.
- usb.c, the packets: every packet still carries n +- 1 frames (an underrun repeats the last frame, never drops or
shortens it); the repeated frames are now owed and made up (one ring frame skipped a packet while the ring is
healthy, uac_repeats_made_up), so a capture keeps the music's length and timing. Bands 0.7 ms higher for renders that
now start up to ~1 ms late (44.1: 112..160, 48: 128..176).
- usb.c, the resampler: uac_rs_run, in RAM (.c1_text) calling nothing, its 160 phases in a RAM table (pool, 15 KiB)
built from the flash's, four taps a pass: bit for bit 0.8.8's. With CORES 2 each half goes to core 1 at the render's
end (uac_render_end) and enters the ring when the next half starts (uac_collect; mix_block's first job queues behind
it, so its wait covers it); one core: per block in the ISR as before. Core 0's share at 48 kHz: ~21 instructions an
input frame (the 16-bit store) against ~270 (resampling) before: ~11 CPU points -> ~1 (estimate, to confirm on the
device); CORES 1 ~20 % fewer instructions and no flash table reads.
- uac_fir.h (tools/gen_uac_fir.py): the 80 phases stored as each tap's third differences (int16), summed back exactly
(UAC_FIR_CHK): 7680 -> 3984 B.
- voice.c / console: voices_given_up counts each voice once (one already fading not again) and splits into
voices_trimmed (load-budget tails under -50 dB: inaudible, most of the field test's 670 /s), voices_stolen and
voices_shed.
- Tests: tests/uac_sched_test.c (new; one core and CORES 2): 3 min against a simulated 48 kHz host at +-500 ppm, renders
as the heavy song's (~17 late /s, up to 131 %): every IN token finds a packet, sizes 47..49, no underrun / overrun /
jump, frames sent = frames resampled exactly, no latency drift; starvation bursts (renders 150..190 %, halves lost):
underruns repeated and all made up; IRQs off 4 ms: ~3 empty frames each, recovered. LEGACY=1 shows the 0.8.8 order:
~245 underruns /s, 12.4 % of the music missing at ~43 late /s (the field test's figures). uac_test: the RAM table
exactly the generator's, bit for bit 0.8.8's resampler (10 s at +-2x full scale), THD / aliasing spurs < -98.9 dB
(1 k .. 22 kHz). audio_test: the ack before the render, audio_lost.
- Image 568320 -> 565384 B (-2936 B); RAM code +328 B (22440 of 24576), pool +16 KiB (36 KiB spare). Goldens, CPU
baselines unchanged; target budget: uac_tap48 -> uac_rs_run (static 558: the unrolled body).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh
- 46 new factory presets across ANALOG, PHASE, LOFI, VOICE, WHEEL, NOISE
and FM6 (appended: stored preset numbers stay; the LOFI browsing order
and the editor's mirror extended). Every preset played on the host:
none quiet, none hot.
- GEN: the recipes point at the new presets first (pads, stabs, leads,
textures, basses); melodies stay in their octave (a leap past a sixth
takes the nearer octave), the motif follows the chord the nearer way
and less often, every phrase ends on a chord tone.
- GEN: HOME closes the screen (OCT- still does).
- Fix (community report): browsing presets switched SCL > CHORD off. A
sound load keeps CHORD, VOICING, STRUM, C.LEN, CHANCE and MUTATE.
- The device is JIANT wherever it speaks: USB MIDI and audio "JIANT FM"
(manufacturer "Juan Jiant", updater "JIANT Update"), the editor's
version string "JIANT v..", the splash, ABOUT, CREDITS, the console,
the crash screen. The web editor, installer and the Python installer
match both names so older firmware still connects.
- PRESETS card: past 99 the number alone (the total is 3 digits now).
- Memory map: RAMTEXT up 4 KiB (the image grew); user stack 15.75 KiB.
- Docs: README changelog and status, MANUAL EN/ES, cheat sheets.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh
A wrong word core 1 reads in the buses' state cannot blow up (their lines
are 16-bit and clamped: a test feeds every word of their state a wrong
value on all five reverbs, at most ~290000 out). ROOM's modulation
offsets, wrong, are put back in range (they read far outside the combs).
An output out of range (2^20; core 1's known misread is 2^21) mutes the
block, clears every bus line and state and gives core 1 up as a BAD READ
(fx_trip). Console status: fx_trips.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh
Parameter locks: hold a step on SEQ > STEP and turn a knob; SEQ > AUTO
LIST lists and edits the locks and automation; lock edits undo.
SEQ TOOLS (SEQ held on the SEQ pages): CLEAR, REVERSE, SHIFT, RANDOM,
COOK, BEAT and the DRUM lane tools.
REC layer (REC held): CLEAR, CLICK, COUNT-IN, CLICK LEVEL.
Metronome and count-in (MENU > AUDIO), never in USB audio.
MIDI CC map (5, 7, 10, 71..75, 91, 93, 94); DRUM lane levels (EDIT >
LANES, LANES 2; projects FUN9).
USB audio input at 44.1 or 48 kHz.
Step recording at the cursor (SEQ > STEP, REC while stopped); restore
the last session at power-on (MENU > SYSTEM > RESTORE LAST).
Eight more ARP modes; MENU > CONTROL > SCALE LEDS; MENU > DISPLAY >
SCREEN OFF.
The header in three parts with a metronome; the new splash; the
power-on LED sweep; DRUM grid beats on the key LEDs.
Fast knob turns keep every click; KNOB ACCEL up to x8, on the FX and
GLO layers too (#126).
MASTER read from the pot before the audio starts, keys silent under
the splash (#137).
The update loader checks the whole package before erasing anything;
robustness against damaged packages and stored data; sanitizer and
fuzz runs in tests/run_tests.sh.
Smaller icons in flash.
LEDs: idle buttons and keys glow dim (a short pulse riding on the 595
shift, no flicker, no extra CPU; #35); MENU > LEDS DIM / INV (INV: the
official firmware's look); PLAY's green LED lit while playing. Key LEDs
show the notes the selected track's sequencer and ARP play (#38). QNT SEQ:
the scale applies to the sequenced notes as they play, non-destructive,
off by default (#37). A song playing shows a disc in the header.
Build: --release accepts X.Y.Z (identity FM-1_9XY).
Big New Features. Engines: FM6 (6-operator FM, replaces DIGITAL; old sounds
convert), SLICE in the standard build with manual slices, DRUM, NOISE; PHYS
membranes and sympathetic strings. 13 engines in one display order.
Sequencer: piano roll, drum grid, songs (patterns A-D), motion recording,
per-step chance, divisions to 4 bars, ARP REPEAT and beat LED; chord keys.
Effects: FX hold layer with a harmonizer, spring reverb, modulation matrix.
Quick layers, undo, on-device naming, new UI (Inter Tight, Fukiai icons,
8 palettes). USB audio input; TRS MIDI in, clock, bend, sustain. Web: full
backup and restore, sample recording and trim, return to the official
firmware. Build: font, icon, keycap, palette and FM6 patch generators;
release folder with the licence texts. Licences: LICENSES/ (Inter Tight
OFL, Fukiai MIT, DaisySP MIT, Rings MIT, msfa Apache-2.0, JieLi SDK
Apache-2.0). Removed: the bitmap font and icon atlas, their generators.
Co-authored-by: ChanceTheMaker <471816+ChanceTheMaker@users.noreply.github.com>
Firmware, update loader, build tools, assets, web installer and editor,
host tests. Four tracks (three synth parts and a drum track), user presets
with live editor sync (protocol v2), editor protocol v3 (tracks), the
command-line installer tools/fm1_install.py.