Describe Preset, Randomize and Mutate in Instruments (#329)

Development counts 1847 checks.
admin committed 2026-10-06 23:29:57 +02:00
1 parent 2b7a1b04d0
commit 57df8825bc
2 files changed
+32 -2

No files matched your search

+1 -1
@@ -18,7 +18,7 @@ php tests/php/accounts.test.php # the API's accoun
# has and the web server's container has not (SKIP there)
php tests/php/snapshots.test.php # the snapshot store (#231), the same way
php tests/php/releases.test.php # the release store (#266), the same way
node tools/seed-e2e.mjs && node tools/e2e.mjs # 1843 editor checks, screenshots in /tmp/gm-e2e-*.png
node tools/seed-e2e.mjs && node tools/e2e.mjs # 1847 editor checks, screenshots in /tmp/gm-e2e-*.png
GM_STEPS=20 node tools/e2e.mjs # or 1-12, or 6,20 — a subset while working on one step
./e2e.sh start [GM_STEPS] # the same run detached, see below
./e2e.sh status # live progress, or the last run's result
+31 -1
@@ -218,6 +218,35 @@ so a drum can be hit quickly. **Stop**, or `Esc` on the keys, ends everything th
instrument has a number field in the header, starting at its default: what the keys play with,
heard at once on what is playing. Those values are the tab's own and never written into the asset.
### Presets, Randomize and Mutate
Three buttons in the header make 8-bit sounds the way sfxr does (#329). Each is one undo step and
plays the note last played at once (C4 before any), for up to 2 s.
- **Preset** opens a menu: *Pickup*, *Laser*, *Explosion*, *Powerup*, *Hit*, *Jump*, *Blip*. It
puts a new graph in place of the instrument's: Notes for all 128 notes → [Chip](#chips) →
Envelope → Filter → Bitcrusher → Output. Groups and notes on the canvas stay. Every click draws
the sound anew within its kind, with sfxr's generator for it. The Chip plays at its own
frequency, *Follow note* off, so every key plays the same sound, as an effect does; turn it on to
play the sound as a melody. The Envelope has *Sustain* 0, so the sound ends by itself.
- **Randomize** draws every number of the Chips, Envelopes, Filters and Bitcrushers in the graph
anew, as sfxr's randomizer does: most of them wild. It leaves the wave, *Follow note*, the type
of a Filter, the *Mix* of a Bitcrusher, an Envelope's *From* and *To* and every other node as
they are. An Envelope gets *Sustain* 0. An input with an edge into it keeps what it is fed.
- **Mutate** moves the numbers of those nodes a little, each one in two: a frequency, cutoff or
rate by up to a quarter of an octave, the rest by a step and a tenth of its value. A 0 stays 0,
so nothing that was off comes on, and *Sustain* stays as it is.
- Randomize and Mutate are grey while the graph has none of those nodes.
- **Audition** (off when the tab opens, as in the Pattern tab): on, every change to the graph
plays the note last played again, 150 ms after it rests, so dragging a number is heard once you
let it be. Moving a node is no change.
sfxr counts its sliders from 0 to 1; the presets turn them into Hz, semitones and seconds with
sfxr's own formulas. Its envelope holds a sound and lets it fall in a straight line, an Envelope
falls away quick at first, so the decay is three times sfxr's hold and fall. sfxr's punch and its
filter sweeps are left out, its phaser is #341. A Preset with both of sfxr's filters keeps the
low-pass.
## Playing one in a game
**Play note** plays one note of an instrument:
@@ -281,6 +310,7 @@ the game's, so a slow frame or a busy page never moves a note. The Pattern tab p
## Not yet
No oscillators or 8-bit sources (#329), no swing. An Envelope
No swing. No view of the waveform a Chip makes, no import of sfxr or jsfxr codes, no WAV export
(#340), no phaser (#341). An Envelope
shapes notes of an instrument only, not a sound played through a sound FX. Notes can not be played from an `.mid` file or a MIDI
keyboard.