Skip to content

sk-engines 0.4.0

Choose a tag to compare

@shakfu shakfu released this 18 Jun 19:17

Changes since the last Release

Added

  • Csound 7 engine (ENGINE=csound), verified on hardware. make engine-csound runs a full Csound 7 instance behind IEngine: an orchestra (.csd) is compiled and performed at runtime, so the patch defines the sound - swap the .csd, swap the synth, no C++ change. Csound's ~2 MB of code can't fit SRAM, so it is a BOOT_QSPI build that executes from QSPI flash, with Csound's heap in a free-capable SDRAM pool (the platform heap stays in SRAM). It loads an SD patch bank (/csound/0.csd..7.csd, plus a built-in fallback so a card-less unit always sounds) with Alt+PITCH live switching (a lock-free handoff recompiles the patch on the main loop without blocking audio), maps the panel knobs to Csound control channels (chnget), and plays the patch's MidiNote instrument from MIDI NoteOn. The static library is the core opcode set only (no plugin opcodes or soundfile I/O), fetched + cross-built from upstream csound/csound (pinned tag 7.0.0-beta.16) by scripts/fetch_csound.sh. Host-tested (allocator, patch selector, MIDI ring, reload handoff); the full design, bring-up notes, and the one open item (a QSPI-XIP CPU perf pass) are in docs/engines/csound.md + docs/dev/csound-impl.md.

  • Grain cloud engine (ENGINE=graincloud). A polyphonic grain cloud - dozens of grains with independent pitch / pan / position scattered over the recorded buffer in contrast to granular's tape-loop scanning. Built as a self-contained variant of the granular engine (SPK_GRAIN_GF): src/engine/graincloud/ is a copy of the granular tree, so it inherits recording, SD save/load, dual-deck, crossfade, FX and UI verbatim, with only the grain core swapped - Generator::process sums a GrainFlowLib cloud (gf_cloud.{h,cpp}) reading granular's recorded buffer instead of driving the granular voice. Played exactly like granular; the cloud knobs map per deck (POS = centre, SIZE = grain size, PITCH = transpose, ENV = position spray, MODFREQ = density, MOD_AMT = pitch/pan spread, SOS = dry/wet, with direction / playhead-speed / vibrato / glisson on the Mode switch + Alt layers). The de-STL'd GrainflowLib is vendored under src/engine/graincloud/thirdparty/; builds at -Os (~97% SRAM_EXEC), 8 grains/deck (conservative - on-device scattered-read cost is unconfirmed; raise kMaxGrains after a METER run). Host-tested (make -C host test-graincloud-kernel). See docs/engines/graincloud.md + docs/dev/graincloud-impl.md.

Flashing an sk-engines firmware (0.4.0)

Each .bin here is a complete firmware for one engine. Flash exactly one at a time.

Prerequisite

These app binaries are not standalone: they run under the spotykach bootloader, which must
already be installed on the device. Installing the bootloader is a separate, device-level
procedure not covered here.

Step 1: enter bootloader mode

Both methods below need the device in its bootloader (DFU) mode first: hold Reset ~3s until
the bottom pad LEDs breathe white.

Step 2, option A: Daisy Web Programmer (easiest)

Needs a WebUSB browser - Chrome or Edge (Firefox and Safari will not work).

  1. With the device in bootloader mode, open https://flash.daisy.audio/
  2. On the "File Upload" tab, choose your engine binary (sk--0.4.0.bin).
  3. Click FLASH.

Step 2, option B: dfu-util (command line)

dfu-util -a 0 -s 0x90040000:leave -D sk-<engine>-0.4.0.bin -d ,0483:df11

Verify

  • Confirm the download is intact: shasum -a 256 -c SHA256SUMS
  • Confirm what a binary is: arm-none-eabi-strings <file>.bin | grep '^spotykach '
    (prints e.g. spotykach 0.4.0 engine=reverb)

Note for the csound engine

sk-csound-*.bin is a QSPI app: unlike the other engines it executes in place from QSPI flash (its Csound runtime is ~2 MB, too big for SRAM), so it is also a larger download and takes longer to flash. Same address and steps as above, with two caveats:

  • It needs a bootloader that runs QSPI apps (the spotykach bootloader does); a SRAM-only bootloader cannot run it.
  • With dfu-util, the :leave step may print a harmless Error 74 / "get_status" message at the end - the write has already succeeded. Ignore it (the Web Programmer does not show this).