Skip to content

Enaga v0.4.0

Latest

Choose a tag to compare

@github-actions github-actions released this 27 Nov 00:17

Enaga 0.4.0 makes USB DRIVE about four times faster and adds a USB debug port, recording to WAV files, and a much larger library for app developers: fast math, samples and a sample player, sequencing helpers, dynamics, and tests that run on a PC. The DSP library is faster too, and the SDK now ships it prebuilt.

What has been tested on a unit. USB DRIVE's new speed, the debug port with remote input, and the audio engine's lower overhead were tested on a SmplTrek with a Windows 11 computer. Recording, the new library code and the examples were tested on the emulator and in the test suite only. Please report what you find.

For players

  • USB DRIVE is about four times faster: about 0.9 MiB/s writing and 1 MiB/s reading on a good port, up from 0.15. That is close to the limit of the unit's USB speed (12 Mbit/s).
    • Which port matters. On the PC we tested, a front port on the chipset's USB controller was three to four times slower than a rear port on the CPU's. If copies are slow, try another port.
    • The unit's audio streams also take some of the bandwidth. Disabling the unit's audio devices in the computer's sound settings during a big copy makes it 15-30 % faster.
    • On a good port the drive appears about 8 seconds after you choose USB DRIVE, down from about 50.
  • The audio engine's own overhead is less than half what it was, leaving more of each block to the app.
  • The build is shown: the STATUS page header and the first log line give the commit the firmware was built from, e.g. 0.4.0 7487bbf.
  • Fixes:
    • Settings are saved however their page is left, including F1 + POWER and switching off.
    • A pad press could switch the unit off through AUTO OFF. Fixed.
    • FAT32's free-space record (FSInfo) was checked at the wrong offset, so Enaga ignored valid ones. Fixed.
    • MIDI clock: DIN follows the MIDI IN setting like USB; only one port's clock is followed at a time; a long pause no longer gives one wrong tempo reading.
    • An app that fails to start, or crashes, gives back the input, the clock and the LEDs.

For app developers

  • Breaking: the data folder is the package's folder, /ENAGA/DATA/<folder under /ENAGA/APPS>, as the docs always said. Before, it used the display name. An app whose display name differs from its folder must move its old data once.
  • Recording (<enaga/wav.hpp>): wav::Writer records a WAV file: create(path, format, ring, size), write(in, frames) in audio(), and close() writes the header. It converts your floats to 16-bit, 24-bit, 32-bit or float, and drops whole frames if the card falls behind. write also works in the main context, for rendering faster than real time. enaga_float_to_pcm does the conversion on its own. examples/recorder records the input to /RECORD.
  • Samples: dsp::Sample and SamplePlayer (any pitch, forward and ping-pong loops, reverse), wav::Loader (a WAV file into a sample in the background, converted to 48 kHz), sample format conversion and a windowed-sinc resampler, VoiceAllocator and NoteStack, and enaga::Queue between the audio and main contexts. examples/sampler puts a WAV file on each pad.
  • Math: fast functions in enaga::dsp (sqrt, tanh, sin/cos in radians, atan2, pow, decibels and more) and the standard float functions through <cmath> and <math.h>, within 1 ulp.
  • Sequencing and music: enaga::seq (StepClock with swing, NoteOffs, chance, every N), enaga::music (note names, scales, quantize, degrees, tempo), and dsp::Smoothed for parameters that glide.
  • Dynamics: Compressor (with side chain), a look-ahead Limiter, Bitcrusher and DcBlocker. The UI toolkit draws waveforms (ui::Waveform, ui::scope).
  • Tests on a PC: tools/host_test.py builds an app's tests/*.cpp with the app's own sources and the DSP library, and runs them with the PC's g++. <enaga/testing.hpp> has the helpers: measurements, checks, and WAV files in and out. examples/sampler/tests is an example.
  • The DSP library is faster: the sample player is about ten times faster and a synced sine three times. The SDK now includes the library prebuilt by TI's compiler, so you get that speed with GCC alone. Edit the library's sources and the build tool builds it with GCC instead.
  • USB debug port: a second USB MIDI port carries Enaga's log, status and screen, and takes keys, knobs and pads from the computer, so you can script tests on a unit. tools/usb_debug.py (in the SDK) is the tool, and docs/usb-debug.md is the guide. Log from your app with enaga::log.
  • Emulator tools: tools/emulate.py can save the whole run's audio, and panel.py takes --file and --card-mib. Long file names work on the emulator's cards.
  • Rebuild your apps for 0.4.0. The app interface is provisional until 1.0, and an app needs firmware of the same version.

Known issues

  • Channel timing, unconfirmed: the left and right channels may be taken one sample apart, in and out. The emulator works this way because Enaga copies the original firmware's audio setup, but it has not been checked on a unit. If it holds, a mono source recorded in stereo has its channels one sample apart. CHECK's new REC page measures it.
  • Atomic read-modify-write on 8- and 16-bit types (std::atomic<uint8_t>::fetch_add and the like) still fails to link. 32-bit types work.
  • USB uses test IDs until a pid.codes product ID is granted.
  • DIN MIDI, the clock and SYNC, and battery support have not yet been checked on a unit.

Installing

Firmware update files for the SmplTrek, Lofi-12 XT and CyDrums are attached. Only the SmplTrek has been tested. Unzip the file for your device, copy the .bin to the root of the SD card keeping its name, then follow "Installing" in the README.

For writing apps, download enaga-sdk-v0.4.0.zip and enaga-toolchain-v0.4.0-linux-x86_64.tar.xz, then start with docs/getting-started.md in the SDK. The toolchain's source, GCC and binutils (GPLv3) with GMP, MPFR, MPC and ISL, is enaga-toolchain-v0.4.0-source.tar.

Full changelog: v0.3.0...v0.4.0