From 05a43ef687729766524dde006964ef31cf045fce Mon Sep 17 00:00:00 2001 From: eefano <77832+eefano@users.noreply.github.com> Date: Tue, 2 Jun 2026 13:14:30 +0200 Subject: [PATCH 1/6] included midichan value in midikeys haps --- packages/midi/midi.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/midi/midi.mjs b/packages/midi/midi.mjs index bd40b743e..51a077115 100644 --- a/packages/midi/midi.mjs +++ b/packages/midi/midi.mjs @@ -633,7 +633,7 @@ export async function midikeys(input) { */ return; } else { - value = { ...value, note: Math.round(note), velocity: velocity / 127 }; + value = { ...value, note: Math.round(note), velocity: velocity / 127, midichan: message.channel }; } kHaps[input].push(new Hap(span, span, value, {})); if (!noteoff && triggerAvailable) { From 0ae2c120b33ea5613d631625403505ad51c8cff6 Mon Sep 17 00:00:00 2001 From: eefano <77832+eefano@users.noreply.github.com> Date: Tue, 2 Jun 2026 13:28:23 +0200 Subject: [PATCH 2/6] updated documentation for midikeys --- packages/midi/midi.mjs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/midi/midi.mjs b/packages/midi/midi.mjs index 51a077115..73383a378 100644 --- a/packages/midi/midi.mjs +++ b/packages/midi/midi.mjs @@ -536,6 +536,9 @@ export async function midin(input) { * * The note length is fixed as Superdough is not currently set up for undetermined * note durations + * + * The 'midichan' control value contains the number of the channel the note is coming from + * so it could be filtered or manipulated further in the chain. * * @name midikeys * @tags external_io, midi @@ -552,6 +555,10 @@ export async function midin(input) { * .s("saw") * .add(note(rand.mul(0.3))) * .lpf(1000).lpe(2).room(0.5) + * @example + * // discard all notes not coming out from midi channel 2 + * const kb = await midikeys('Arturia KeyStep 32') + * kb().filterValues(v=>v.midichan==2).s("tri") */ const kHaps = {}; const kListeners = {}; From 58f956b57e5f9f94be10e14c3d8ba954187637e9 Mon Sep 17 00:00:00 2001 From: eefano <77832+eefano@users.noreply.github.com> Date: Tue, 2 Jun 2026 14:29:28 +0200 Subject: [PATCH 3/6] prettier fix --- packages/midi/midi.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/midi/midi.mjs b/packages/midi/midi.mjs index 73383a378..5880ca268 100644 --- a/packages/midi/midi.mjs +++ b/packages/midi/midi.mjs @@ -536,7 +536,7 @@ export async function midin(input) { * * The note length is fixed as Superdough is not currently set up for undetermined * note durations - * + * * The 'midichan' control value contains the number of the channel the note is coming from * so it could be filtered or manipulated further in the chain. * From 2635716c878059ef5c5ee89898841a50fae9cc0f Mon Sep 17 00:00:00 2001 From: eefano <77832+eefano@users.noreply.github.com> Date: Tue, 2 Jun 2026 14:56:55 +0200 Subject: [PATCH 4/6] added midikeys third test --- test/__snapshots__/examples.test.mjs.snap | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/__snapshots__/examples.test.mjs.snap b/test/__snapshots__/examples.test.mjs.snap index f7989dc7e..f465f06bf 100644 --- a/test/__snapshots__/examples.test.mjs.snap +++ b/test/__snapshots__/examples.test.mjs.snap @@ -7927,6 +7927,8 @@ exports[`runs examples > example "midikeys" example index 0 1`] = `[]`; exports[`runs examples > example "midikeys" example index 1 1`] = `[]`; +exports[`runs examples > example "midikeys" example index 2 1`] = `[]`; + exports[`runs examples > example "midin" example index 0 1`] = ` [ "[ 0/1 → 1/4 | note:c cutoff:0 resonance:0 s:sawtooth ]", From 62d4f84e698abcfddc33d65d62f5a640472f7bf4 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 18 Jun 2026 10:55:34 +0100 Subject: [PATCH 5/6] add growlist --- packages/core/pattern.mjs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/core/pattern.mjs b/packages/core/pattern.mjs index bf9d8ce0b..76568fd2f 100644 --- a/packages/core/pattern.mjs +++ b/packages/core/pattern.mjs @@ -2028,9 +2028,9 @@ export const { fastGap, fastgap } = register(['fastGap', 'fastgap'], function (f const newWhole = !hap.whole ? undefined : new TimeSpan( - newPart.begin.sub(begin.sub(hap.whole.begin).div(factor)), - newPart.end.add(hap.whole.end.sub(end).div(factor)), - ); + newPart.begin.sub(begin.sub(hap.whole.begin).div(factor)), + newPart.end.add(hap.whole.end.sub(end).div(factor)), + ); return new Hap(newWhole, newPart, hap.value, hap.context); }; return pat.withQuerySpanMaybe(qf).withHap(ef).splitQueries(); @@ -3359,6 +3359,11 @@ Pattern.prototype.shrinklist = function (amount) { export const shrinklist = (amount, pat) => pat.shrinklist(amount); +Pattern.prototype.growlist = function (amount) { + return this.shrinklist(amount).reverse(); +} +export const growlist = (amount, pat) => pat.growlist(amount); + /** * *Experimental* * From 813cc6c1904f73f4f2afd373681a3a5d16f613cd Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 18 Jun 2026 12:04:03 +0100 Subject: [PATCH 6/6] format --- packages/core/pattern.mjs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/pattern.mjs b/packages/core/pattern.mjs index 76568fd2f..ff808ac4a 100644 --- a/packages/core/pattern.mjs +++ b/packages/core/pattern.mjs @@ -2028,9 +2028,9 @@ export const { fastGap, fastgap } = register(['fastGap', 'fastgap'], function (f const newWhole = !hap.whole ? undefined : new TimeSpan( - newPart.begin.sub(begin.sub(hap.whole.begin).div(factor)), - newPart.end.add(hap.whole.end.sub(end).div(factor)), - ); + newPart.begin.sub(begin.sub(hap.whole.begin).div(factor)), + newPart.end.add(hap.whole.end.sub(end).div(factor)), + ); return new Hap(newWhole, newPart, hap.value, hap.context); }; return pat.withQuerySpanMaybe(qf).withHap(ef).splitQueries(); @@ -3361,7 +3361,7 @@ export const shrinklist = (amount, pat) => pat.shrinklist(amount); Pattern.prototype.growlist = function (amount) { return this.shrinklist(amount).reverse(); -} +}; export const growlist = (amount, pat) => pat.growlist(amount); /**