mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-13 06:19:33 -04:00
Merge branch 'main' of ssh://codeberg.org/uzu/strudel
This commit is contained in:
@@ -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*
|
||||
*
|
||||
|
||||
@@ -537,6 +537,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
|
||||
* @param {string | number} input MIDI device name or index defaulting to 0
|
||||
@@ -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 = {};
|
||||
@@ -633,7 +640,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) {
|
||||
|
||||
@@ -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 ]",
|
||||
|
||||
Reference in New Issue
Block a user