Merge branch 'main' into base-function
This commit is contained in:
commit
49a1e11cd8
2 changed files with 10 additions and 1 deletions
|
|
@ -537,6 +537,9 @@ export async function midin(input) {
|
||||||
* The note length is fixed as Superdough is not currently set up for undetermined
|
* The note length is fixed as Superdough is not currently set up for undetermined
|
||||||
* note durations
|
* 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
|
* @name midikeys
|
||||||
* @tags external_io, midi
|
* @tags external_io, midi
|
||||||
* @param {string | number} input MIDI device name or index defaulting to 0
|
* @param {string | number} input MIDI device name or index defaulting to 0
|
||||||
|
|
@ -552,6 +555,10 @@ export async function midin(input) {
|
||||||
* .s("saw")
|
* .s("saw")
|
||||||
* .add(note(rand.mul(0.3)))
|
* .add(note(rand.mul(0.3)))
|
||||||
* .lpf(1000).lpe(2).room(0.5)
|
* .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 kHaps = {};
|
||||||
const kListeners = {};
|
const kListeners = {};
|
||||||
|
|
@ -633,7 +640,7 @@ export async function midikeys(input) {
|
||||||
*/
|
*/
|
||||||
return;
|
return;
|
||||||
} else {
|
} 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, {}));
|
kHaps[input].push(new Hap(span, span, value, {}));
|
||||||
if (!noteoff && triggerAvailable) {
|
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 1 1`] = `[]`;
|
||||||
|
|
||||||
|
exports[`runs examples > example "midikeys" example index 2 1`] = `[]`;
|
||||||
|
|
||||||
exports[`runs examples > example "midin" example index 0 1`] = `
|
exports[`runs examples > example "midin" example index 0 1`] = `
|
||||||
[
|
[
|
||||||
"[ 0/1 → 1/4 | note:c cutoff:0 resonance:0 s:sawtooth ]",
|
"[ 0/1 → 1/4 | note:c cutoff:0 resonance:0 s:sawtooth ]",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue