Send a track, a pattern item or a whole song through a sound FX (#346)
A sound FX could only be put on a single sound. Now a track, a pattern item, a Play pattern and a Play song send everything they play through one chain of it, as an insert in a DAW. A Play note gets one of its own. - Track: an FX box in the head next to M and S opens a menu of the project's sound FX, and the track's inspector has the row too. Order: items, track FX, volume, pan. - Pattern item: Sound FX in its inspector. Its notes play on a bus of their own into the track's bus. - Play pattern and Play song take fx and fx params. The chain sits on the master of the playing, after the tracks and before the level and the fades. Set sound FX parameters reaches it by the playback. - Play note takes fx and fx params next to the instrument's params. The FX parameters go by "fx:" so the two sets stay apart. Set sound FX parameters on a note changes a name both have in both. - A Pitch on a bus is a new PitchShifter: the phase vocoder of the PitchPlayer, fed while it plays. It cannot look ahead and is exactly one frame late at every pitch, 2048 samples. - That latency is made up. The other way of a Mix is held back by a delay of the same length. Every note and clip starts as much earlier as the buses it passes are late. The scheduler plans that much further ahead, and the first note waits that much after Play. - The Song tab waits for the chains before it plays and lets its buses go a moment after Stop. A playing in a game lets them go after its echoes and what the shifters still hold. - songBuses moved to its own file. Kept in song.ts it pulled the FX compiler into the node registry through an import cycle. Decisions of the user: one chain for the whole (1a), FX everywhere asked for (2a), Set sound FX parameters on playbacks (3a), and a pitch shifter of its own with exact latency compensation for a Pitch on a bus. Tests: - Unit pitch-shifter (new): 11 green. At 0 semitones the output is the input 2048 samples later, off by at most 1.2e-7. - Unit sound-library: 84 green, 8 new. Counter-checks (no early start, no Mix delay, chain made every time, tune misses the master) each turned their test red. - Unit bus-fx (new): 6 green, 4 counter-checks red. Scheduler ahead: 1 new, its counter-check red. - e2e 65 (melektaus-atx): ALL PASSED, 35 checks, 4 new, first run. Chrome at 44.1 kHz: the bus was 0.046440 s late, the note started exactly that much early. Offline the shifter moved 1 kHz to 2000 Hz and passed a click 2048 samples later. - Gate (melektaus-atx): CHECK EXIT 0, 259 files, 4021 tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
01fd6e6464
commit
b519cd192f
32 files changed
+1666
-226
No files matched your search
@@ -2065,9 +2065,22 @@ const CASES: Record<string, Case[]> = {
|
||||
detached: false,
|
||||
instrumentParams: { cut: 2 },
|
||||
tempo: 120,
|
||||
fx: '',
|
||||
fxParams: {},
|
||||
},
|
||||
]),
|
||||
},
|
||||
{
|
||||
name: 'hands on a sound FX of its own with its values, apart from the instrument parameters (#346)',
|
||||
inputs: { instrument: 'ins-1', fxParams: { cut: 2 }, soundFx: 'fx-1', soundFxParams: { depth: -6 } },
|
||||
next: 'exec',
|
||||
after: (ctx) =>
|
||||
expect(ctx.notes[0]).toMatchObject({
|
||||
instrumentParams: { cut: 2 },
|
||||
fx: 'fx-1',
|
||||
fxParams: { depth: -6 },
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: 'hands on its tempo for a Delay synced to beats (#332)',
|
||||
inputs: { instrument: 'ins-1', note: 60, tempo: 90 },
|
||||
@@ -2098,7 +2111,15 @@ const CASES: Record<string, Case[]> = {
|
||||
next: 'exec',
|
||||
outputs: { playback: 1 },
|
||||
after: (ctx) =>
|
||||
expect(ctx.patterns).toEqual([{ patternId: 'pat-1', volume: 0.5, loop: true, detached: false }]),
|
||||
expect(ctx.patterns).toEqual([
|
||||
{ patternId: 'pat-1', volume: 0.5, loop: true, detached: false, fx: '', fxParams: {} },
|
||||
]),
|
||||
},
|
||||
{
|
||||
name: 'hands on a sound FX for all of it with its values (#346)',
|
||||
inputs: { pattern: 'pat-1', fx: 'fx-1', fxParams: { depth: -6 } },
|
||||
next: 'exec',
|
||||
after: (ctx) => expect(ctx.patterns[0]).toMatchObject({ fx: 'fx-1', fxParams: { depth: -6 } }),
|
||||
},
|
||||
{
|
||||
name: 'plays once and detached when asked to',
|
||||
@@ -2148,9 +2169,15 @@ const CASES: Record<string, Case[]> = {
|
||||
outputs: { playback: 1 },
|
||||
after: (ctx) =>
|
||||
expect(ctx.songs).toEqual([
|
||||
{ songId: 'song-1', volume: 0.5, fadeIn: 2, loop: true, detached: false },
|
||||
{ songId: 'song-1', volume: 0.5, fadeIn: 2, loop: true, detached: false, fx: '', fxParams: {} },
|
||||
]),
|
||||
},
|
||||
{
|
||||
name: 'hands on a sound FX for the whole of it with its values (#346)',
|
||||
inputs: { song: 'song-1', fx: 'fx-1', fxParams: { depth: -6 } },
|
||||
next: 'exec',
|
||||
after: (ctx) => expect(ctx.songs[0]).toMatchObject({ fx: 'fx-1', fxParams: { depth: -6 } }),
|
||||
},
|
||||
{
|
||||
name: 'plays once and detached when asked to',
|
||||
inputs: { song: 'song-1', volume: 1, fadeIn: 0, loop: false, detached: true },
|
||||
|
||||
Reference in new issue
Block a user