The editor gets a USB button that asks the device for the playback
counters and shows them in a pop-up:
- command 89 USBDIAG: version 1, the playback alt setting, playing,
then nine 5-byte counters (7 bits, LSB first): SET_INTERFACE to the
playback interface, EP3 interrupts, packets received, frames stored,
packets dropped, dry blocks, frames dropped and repeated by the
rate follow, and the ring's fill. Read only; zeros without
FELUCCA_UAC_OUT.
- usb.c counts the playback SET_INTERFACE and the EP3 interrupts.
- editor_test.c checks the reply's layout and its zero counters before
any playback.
- EDITOR_PROTOCOL.md: the row for command 89.
Command 89 is new, so the INFO reply and the older commands do not
change.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUF6pQ1NkTwmBC8SR8AK94
The audio ISR now plays the playback ring (usb_play_mix, audio.c):
- After the USB input and USB LEVEL FIXED, before the click, the frames
are added to the DAC's signal at MASTER's level (song.master_q12) and
saturated at +-32767. They are not added to the USB input (uac_tap):
the host would record its own output back.
- Prebuffer: 128 frames before the first sound. The ring's fill is
followed against TARGET 256 +- BAND 128: one frame is dropped above
the band, one repeated below it (the host's clock is adaptive, so the
device follows it; there is no feedback endpoint). A dry ring goes
silent for the rest of the block and primes again.
- The stream's reset (SET_INTERFACE, configuration, bus reset) sets a
flag; the reader moves its own index. The audio ISR can nest TIMER5,
so the writer never touches pb_r.
- The playback format is 44.1 kHz only: the reader does not resample.
Windows converts for applications that play at 48 kHz.
tests/uac_out_test.c: the reader's blocks (prime, MASTER level, sums
with saturation, drop and repeat, a dry ring, the flag, alt 0) and a
10 s run with the host 0.04 % slow: no dry ring, about 176 repeats.
usb_desc_test.c: the playback format is 44.1 kHz only.
Not tested on a real FM-1 yet.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUF6pQ1NkTwmBC8SR8AK94
The playback stream (alt 1) now receives its EP3 OUT packets:
- uac_out_stream() runs on SET_INTERFACE, SET_CONFIGURATION and bus
reset: alt 1 sets EP3 RX up as isochronous (RXMAXP, RXCSR2 ISO,
FlushFIFO + ClrDataTog as EP1's RX) and enables its interrupt
(INTRRX1 bit 3); alt 0 turns it back to EP1 only.
- uac_out_rx() reads one packet in the TIMER5 poll, the same CSR
sequence as ep1_rx; the packet is clamped to UAC_MAXP and dropped
whole when the ring has no room (isochronous: no NAK).
- uac_out_store() unpacks 16-bit stereo little endian frames into
pb_ring (L | R << 16, the layout of ua_ring). The ring has 512
frames. Only the TIMER5 side writes pb_w.
- The reader (the audio ISR, step 3) does not exist yet, so nothing
plays; the ring only fills.
tests/uac_out_test.c checks the store: byte layout, a partial frame,
the largest packet, wrap-around, a full ring (whole packet dropped,
earlier frames intact) and the room a reader gives back.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUF6pQ1NkTwmBC8SR8AK94
FELUCCA_UAC_OUT (on by default without the console) adds a class 1.0
playback stream after the audio input and the MIDI interface:
- interface a+3, alt 0 (no bandwidth) and alt 1 (the stream);
- endpoint 3 OUT, isochronous, adaptive, 1 ms, wMaxPacketSize of the
input stream, with its class-specific endpoint descriptor;
- a second USB streaming input terminal (3, 2 ch L R) and a speaker
output terminal (4, from 3);
- the AC header lists three interfaces (streams first, MIDI last with
FELUCCA_UAC_AS_FIRST, the order macOS' AppleUSBAudio parses);
- bcdDevice + 0.40 so hosts do not reuse what they learnt about the
input-only device.
No data is received yet: SET_INTERFACE / GET_INTERFACE accept the
playback interface's alt settings (alt 1 is acknowledged, the endpoint
is not configured), so Windows can list the device under playback
without a stall. Reception and mixing follow in steps 2 and 3.
FELUCCA_UAC_OUT needs FELUCCA_UAC and no FELUCCA_CDC (EP3 is the
console's bulk pipe); usb.c stops the build otherwise.
Tests: usb_desc_test.c learns T_OUT (interfaces, endpoints, bcdDevice,
collection order, the playback terminals, the alt settings and the
endpoint); run_tests.sh runs it with 48 kHz and 44.1 kHz only and both
collection orders. The byte-for-byte references are not applied to the
playback build, which differs from 1.0 on purpose.
Not tested on a real FM-1 yet: the playback endpoint appears in
Windows' Playback list only after the host accepts the descriptors.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUF6pQ1NkTwmBC8SR8AK94
FMINI_VERSION v2.2.0 in core.h and FW_LATEST 2.2.0 in the patch editor.
docs/emu, docs/emu2 and docs/index.html (the installer, 2.2.0 .fwsc)
regenerated from this source. Patch / LP-HP / FILT. MOD / MODE changes
are the 2.1.0 work carried into 2.2.0.
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUF6pQ1NkTwmBC8SR8AK94
FMini-1 2.1.0 (unreleased): A-SYNC delay fixes, 1/2T and 1/4T note
values, FX and OSC layout tweaks, no K1..K4 labels, and the FILT LP / HP
switch with its MODE title, FILT. MOD and ON / OFF labels.
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUF6pQ1NkTwmBC8SR8AK94
The LP/HP switch gets a MODE title above it. The response graph's frame
starts 10 px higher (y 136), and its dB scale stretches over the extra
rows so the curve uses the height.
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUF6pQ1NkTwmBC8SR8AK94
A high-pass output: (1 - LP)^4 of the ladder's own four stages, 24 dB/oct,
on the same loop (the EMPHASIS feedback is still the low-pass one). The
switch is a field of the FILT page (CC 72, free), drawn left of the
response; the response graph and its caption follow the choice
(FMINI_GRAPH_HP, generated by tools/fmini_filter.py; the LP table is
unchanged). fmini_sanitize keeps SW2 up to 7 (it kept 3). Settings layout
0x51 (the controls grew by one). Patches saved before have the bit clear:
LP, as before. Test: a C2 is cut 18.6 dB and a C7 passes +14 dB (a saw's
harmonics pass the high-pass; the bar is 14 dB). The full suite: only the
known failures. Protocol note in web/EDITOR_PROTOCOL.md. Emulator
regenerated (docs/emu2).
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUF6pQ1NkTwmBC8SR8AK94
The knob columns and the FX pop-up knobs drop their K1..K4 captions; the
FX page keeps its MIX / GAIN captions (the parameter each knob sets).
Emulator regenerated (docs/emu2).
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUF6pQ1NkTwmBC8SR8AK94
The bars between the four sections and the four EDIT buttons are gone
(the FX button still opens the pop-ups). The knobs and their labels sit
10 px lower on the FX page, and "Press FX to edit effects." is written
under them. Screenshot checked on the host (fmini_app_test).
Emulator regenerated (docs/emu2).
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUF6pQ1NkTwmBC8SR8AK94
N_DIV gains 1/2T (code 10, 4/3 of a quarter) and 1/4T (code 11, 2/3 of a
quarter), appended, so stored values keep their meaning. The shown order
(DIV_ORDER) places them by length. The DELAY's TIME list (N_DTIME) gets the
new names too; its own dotted codes 10..12 are unchanged. Renamed labels
only: the values stay. LFO SYNC, the SLICER and the SEQ's slide keep their
own lists. The editor's note tables follow (divLength reads the triplets).
Tests: the length check reads the dotted codes only for N_DTIME; the TIME
check skips A-SYNC's type code (7); the step expectations follow the order.
Emulator regenerated (docs/emu2).
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUF6pQ1NkTwmBC8SR8AK94
The gauge of a knob now sits at the value's place in the order it is
shown (fmg_ratio over enum_rank): A-SYNC is second, not last. Changing
the TYPE to or from A-SYNC keeps the delay's length (dly_time_convert):
the stored TIME is a note value (0..9) there and ms (0..127) elsewhere,
so the TIME used to jump. Test: the type knob and the conversion both ways.
Emulator regenerated (docs/emu2).
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUF6pQ1NkTwmBC8SR8AK94
The knob skips the ARP RATE values longer than the delay line (1.48 s) at
the tempo now, so they are not shown; a value that fits nowhere (a very
slow tempo) stays. dly_div_fits() is the test, the delay stays silent for
a stored value that does not fit. Tests: 60 BPM skips 1/2 and longer.
Emulator regenerated (docs/emu2).
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUF6pQ1NkTwmBC8SR8AK94
- TYPE gets A-SYNC (7, appended so stored values keep their meaning),
shown right after ANALOG (DLYTYPE_ORDER, the display order).
- A-SYNC is ANALOG's algorithm (fx.c dly_kind); its TIME (G_DRREV, 0..9)
is the ARP RATE's note values (N_DIV, with their order), and
delay_samples takes the tempo's length of the value (div_samples: the
internal clock, ARP / SEQ, or MIDI clock).
- Limit: the delay line holds 1.48 s, so note values longer than that
(1/2 below 81 BPM, 1/1, 2BAR, 4BAR) are cut to 1.48 s.
- tests: the type order, the sync length, the type list (eight).
docs/emu2 rebuilt.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUF6pQ1NkTwmBC8SR8AK94
- GLO list: TUNING and TRANSPOSE below PITCH BEND, ABOUT last (8 rows,
17 px apart). ALGORITHM changes them; TUNING is 1 Hz a click.
- Global, not in the preset: every note (keys, MIDI, SEQ, ARP) goes
through trk_note_on / trk_note_off (voice.c), TRANSPOSE applies there
and a note outside 0..127 is dropped (on and off alike); TUNING adds
its cents from A 440 to the pitch (eng_fmini.c). A change of TRANSPOSE
is a panic, so no note hangs.
- Settings: two new bytes after the record's last one (no shift of the
older bytes; the magic is unchanged); erased bytes read as 440 Hz and 0.
- tests: the GLO list, the limits, the transposed out-of-range note.
docs/emu2 rebuilt.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUF6pQ1NkTwmBC8SR8AK94
- docs/emu2: the browser emulator built from the new-stuff branch
(the MIXER page with the noise colour button).
- installer.yml: copy docs/emu2 to _site/emu2 and rebuild on its changes.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUF6pQ1NkTwmBC8SR8AK94
- MIXER: no K1..K4 under the knobs, no names above the four switches.
- The switches are raised; ON text light, OFF text dark.
- A ninth MIXER control under NOISE: PINK or WHITE (FS_PINK in FG_SW1),
its text always in the ON colour.
- MIDI CC: the new control answers to CC 63 by default. The settings
record moves to magic 0xA7 0x50, so an older record reads as defaults
once (its MIDI source, channel and CC map are reset).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUF6pQ1NkTwmBC8SR8AK94
- firmware 2.1.0: CC1 is a vibrato on the pitch (+-1 semitone at full
wheel, whatever MOD OSC is); MOD depth is the patch's E6 only.
- built: build.sh ok, target budget ok, full host suite passed
(ALL HOST TESTS PASSED; the known failing sections only).
- docs: browser emulator (v2.1.0) and installer page regenerated.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUF6pQ1NkTwmBC8SR8AK94
- firmware: CC1 adds the track LFO to the pitch, +-1 semitone at full
wheel, whatever MOD OSC is; MOD depth is the patch's E6 only.
- version 2.1.0 (core.h, FW_LATEST in the editor).
- built: build.sh ok, target budget ok; the full host suite is still to
run before this goes to main.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUF6pQ1NkTwmBC8SR8AK94
- eng_fmini: CC1 (t->mw) adds the track LFO to the pitch, +-1 semitone at
full wheel, whatever MOD OSC is. It no longer deepens the MOD depth:
that is the patch's E6 only (the matrix's MODW source still drives it).
With the wheel at 0 the render is unchanged, so the FMini goldens hold.
- tests/fmini_filter_test: the wheel at 0 leaves the pitch still; at 127
it sways about a semitone with MOD OSC off.
- web/site_fmini: the mod wheel is named as vibrato (pt, en).
Not built for the firmware yet: the JieLi toolchain and the AC79 SDK could
not be fetched in this session, so build.sh, the full suite, the target
budget and the version bump are still to do before this goes to main.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUF6pQ1NkTwmBC8SR8AK94
- Version 2.0.0 (was 1.23.0), the owner's: FMINI_VER_MAJ 2, MIN 0, PATCH 0.
No other firmware change. INFO reports 2.0.0; the editor compares the
three numbers in order, so 2.0.0 is newer than any 1.x.
- Web: editor FW_LATEST 2.0.0, emulator and installer rebuilt.
- Tests run: editor_test (INFO's version bytes), fmini_app_test (ABOUT
shows v2.0.0), install_test, the web editor test.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUF6pQ1NkTwmBC8SR8AK94