diff --git a/amy b/amy index 2793cd3e4..6cebb3297 160000 --- a/amy +++ b/amy @@ -1 +1 @@ -Subproject commit 2793cd3e4335f65235cf404cae7a66bf74b2b252 +Subproject commit 6cebb3297aa0a81f9ce681bb753e924ad912593e diff --git a/tulip/server/refdocs/amy/_VENDORED_FROM.txt b/tulip/server/refdocs/amy/_VENDORED_FROM.txt index da40e12b3..d6e229835 100644 --- a/tulip/server/refdocs/amy/_VENDORED_FROM.txt +++ b/tulip/server/refdocs/amy/_VENDORED_FROM.txt @@ -1,3 +1,3 @@ Auto-generated by tulip/server/sync_amy_docs.py — do not edit by hand. -Source: amy@009d0b494af2d13f7c49b868b78b96e1cef80753 +Source: amy@6cebb3297aa0a81f9ce681bb753e924ad912593e Files: api.md, arduino.md, billie_jean.md, godot.md, juno_patches.md, midi.md, synth.md, upgrading.md diff --git a/tulip/server/refdocs/amy/api.md b/tulip/server/refdocs/amy/api.md index 1c19ffdf8..e3a4676b9 100644 --- a/tulip/server/refdocs/amy/api.md +++ b/tulip/server/refdocs/amy/api.md @@ -285,7 +285,7 @@ A note on list parameters: When an argument is a list of parameters, you can in | `i` | `synth` | `synth` | 0-31 | Define a set of voices for voice management. | | `ic` | **TODO** | `midi_cc` | C,L,N,X,O,CMD | MIDI Control Code command for this synth (1-16). `C`=MIDI CC (0-127), `L`=log mapping (0/1), `N`=min val, `X`=max val, `O`=offset, `CMD`=wire command to execute, where `%i` is replaced by the channel number and `%v` is replaced by the value after min/max/offset/log mapping. Providing `C` with no further args deletes that CC. `C=255` deletes all CC mappings for the specified synth. See [#524](https://github.com/shorepine/amy/issues/524) | | `id` | `synth_delay_ms` | `synth_delay` | uint | Delay (in ms) applied to synth note-ons. Gives time for decay of 'stolen' notes. | -| `if` | `synth_flags` | `synth_flags` | uint | Flags for synth creation: 1 = Use MIDI drum note->preset translation; 2 = Drop note-off events. | +| `if` | `synth_flags` | `synth_flags` | uint | Flags for synth creation: 1 = Use MIDI drum note->preset translation; 2 = Drop note-off events; 4 = Invert MIDI pedal sense. | | `ig` | `cv_trigger` | `cv_trigger` | uint,uint | Configure external CV event triggering: Gate CV, trigger threshold, reset threshold, pitch CV, pitch scale, pitch offset, wire command template, %v gets pitch value. | | `im` | `grab_midi_notes` | `grab_midi_notes` | 0/1 | Use `amy.send(synth=CHANNEL, grab_midi_notes=0)` to prevent the default direct forwarding of MIDI note-on/offs to synth CHANNEL. | | `iM` | `note_source_channel` | `note_source_channel` | 1-16 | Used internally to mark events that result from MIDI inputs, meaning they won't get forwarded to MIDI out. | @@ -364,7 +364,7 @@ These per-oscillator parameters use [CtrlCoefs](synth.md) notation Devices built with `-DGAMMA9001` (Tulip, AMYboard, AMY on the web, the CPython `amy` module) carry the Gamma9001 drum sample banks: the full TR-808 bank is baked in as PCM presets 0-18, and 136 more samples (TR-909, Linn 9000, Univox MR-12, Tokyo Synthetics, 80s Power Kit, Percussion) live at presets 256-391, served from a platform-provided blob (linked into the binary on web and CPython; an mmapped `drums` flash partition on ESP32-S3). All of them play directly with `wave=PCM, preset=P`. -Patches **384-390** are ready-made General MIDI drum kits over these banks -- load one on a synth with `synth_flags=3` and GM note numbers trigger the mapped samples: +Patches **384-390** are ready-made General MIDI drum kits over these banks -- load one on a synth to make GM note numbers trigger the mapped samples: | patch | MIDI PC (bank MSB 3) | kit | |-------|----------------------|-----| diff --git a/tulip/server/refdocs/amy/synth.md b/tulip/server/refdocs/amy/synth.md index 2ed9ee81c..56fd15993 100644 --- a/tulip/server/refdocs/amy/synth.md +++ b/tulip/server/refdocs/amy/synth.md @@ -77,14 +77,13 @@ amy.send(synth=0, num_voices=0) # for the synth, independent of any osc amp settings (and the natural way to # scale a drum-kit synth, whose per-drum oscs each carry their own amp): amy.send(synth=0, synth_level=0.5) -# As a special case, you can use `synth_flags` to set up a MIDI drum synth -# that will translate GM note events into PCM presets. Load one of the drum kit -# patches (384-390, see the Drum kits section). Drum kits are single-voice: -# the one voice holds a dedicated osc per drum sound, so num_voices must be 1: -amy.send(synth=10, num_voices=1, patch=384, synth_flags=3) +# Patches 258 and 384-390 are General MIDI drum synth kits (see the Drum kits section). +# They include special flags that will translate GM note events into PCM presets. +amy.send(synth=10, patch=384) amy.send(synth=10, note=38, vel=1) # acoustic snare (GM note numbers) amy.send(synth=10, patch=389) # hot-swap the synth to the 80s Power Kit # You can also use `patch_string` to directly define a patch using a wire-command string. +# The `synth_flags` here triggers the MIDI-drums-to-PCM-preset-patch translation. amy.send(synth=11, num_voices=3, patch_string='w7f0Z', synth_flags=3) ``` @@ -94,7 +93,8 @@ Note 2: note-on events to synths (or their component voices) have a specific beh ``` amy.reset() amy.send(synth=1, num_voices=2, oscs_per_voice=2) -amy.send(synth=1, osc=1, freq=660) +amy.send(synth=1, osc=0, wave=amy.SINE, freq=440) # These are all defaults, so this line is not needed. +amy.send(synth=1, osc=1, wave=amy.SINE, freq=660) # Non-default freq amy.send(synth=1, note=60, vel=1) ``` .. will sound two sine tones a fifth apart, even though the two oscs are not chained and we only issued a single note-one. @@ -171,7 +171,7 @@ You see we first set up the modulation oscillator (a sine wave at 0.5Hz, with am ```python amy.send(osc=1, wave=amy.TRIANGLE, freq=5, amp=1) -amy.send(osc=0, wave=amy.PULSE, duty={'const': 0.5, 'mod': 0.25}, freq={'mod': 0.5}, mod_source=1) +amy.send(osc=0, wave=amy.PULSE, duty={'const': 0.5, 'mod': 0.25}, freq={'mod': 0.5}, mod_source=1)m amy.send(osc=0, note=60, vel=0.5) ``` @@ -221,7 +221,7 @@ Oscillators will not become audible until a `velocity` over 0 is set for the osc - Pick the table with `preset`: `pcm_wavetable_base` to `pcm_wavetable_base + pcm_wavetable_samples - 1` - `duty` controls interpolation position across the 64 waveform cycles within one wavetable preset. - - Internally each cycle is 256 samples; full table length is typically 16384 samples. + - Internally each cycle is 256 samples; full table length is typically 16384 samples (64 complete cycles). - You can load new wavetables using `load_sample` and use your new preset number. Ensure they are 16,384 samples long. Find more on [waveeditonline.com](http://waveeditonline.com). @@ -328,7 +328,7 @@ AMY comes with a bank of drum-like PCM samples baked in, as they are normally ha ### Drum kits -On Gamma9001 devices, patches 384-390 are ready-made General MIDI drum kits: load one on a synth with `synth_flags=3` and GM note numbers (35/36 kick, 38 snare, 42 closed hat, 46 open hat, 49 crash, ...) play the right sound. +On Gamma9001 devices, patches 384-390 are ready-made General MIDI drum kits: load one on a synth and GM note numbers (35/36 kick, 38 snare, 42 closed hat, 46 open hat, 49 crash, ...) play the right sound. | patch | MIDI PC (bank MSB 3) | kit | |-------|----------------------|-----| @@ -340,7 +340,7 @@ On Gamma9001 devices, patches 384-390 are ready-made General MIDI drum kits: loa | 389 | 5 | 80s Power Kit (gated reverb) | | 390 | 6 | Percussion (hand drums / latin) | -Switch kits from code with `amy.send(synth=10, patch=38x)`, or over MIDI with a bank select MSB of 3 (CC0=3) followed by a program change 0-6 on the drum channel. A synth already sitting on a kit patch stays in the kit bank, so a bare program change also switches kits. Channel 10 boots as the TR-808 kit when default synths are on; you can run a second kit polytimbrally on another channel, e.g. `amy.send(synth=11, num_voices=4, patch=390, synth_flags=3)`. Set a kit channel's overall level with a constant amp on the synth, e.g. `amy.send(synth=10, amp=0.5)` — the kits keep their per-drum gains in each note mapping's velocity scale, so the level persists across hits, just like on the melodic patches. +Switch kits from code with `amy.send(synth=10, patch=38x)`, or over MIDI with a bank select MSB of 3 (CC0=3) followed by a program change 0-6 on the drum channel. A synth already sitting on a kit patch stays in the kit bank, so a bare program change also switches kits. Channel 10 boots as the TR-808 kit when default synths are on; you can run a second kit polytimbrally on another channel, e.g. `amy.send(synth=11, patch=390)`. Set a kit channel's overall level with a constant amp on the synth, e.g. `amy.send(synth=10, amp=0.5)` — the kits keep their per-drum gains in each note mapping's velocity scale, so the level persists across hits, just like on the melodic patches. ```python