mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-25 20:48:27 +00:00
fix midibend and miditouch
This commit is contained in:
parent
e19d059c0f
commit
3189b365c8
@ -1710,7 +1710,6 @@ export const { sysexid } = registerControl('sysexid');
|
|||||||
*/
|
*/
|
||||||
export const { sysexdata } = registerControl('sysexdata');
|
export const { sysexdata } = registerControl('sysexdata');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MIDI pitch bend: Sends a MIDI pitch bend message.
|
* MIDI pitch bend: Sends a MIDI pitch bend message.
|
||||||
* @name midibend
|
* @name midibend
|
||||||
|
|||||||
@ -163,8 +163,6 @@ Pattern.prototype.midi = function (output) {
|
|||||||
sysexdata,
|
sysexdata,
|
||||||
} = hap.value;
|
} = hap.value;
|
||||||
|
|
||||||
console.log('hap', hap.value);
|
|
||||||
|
|
||||||
velocity = gain * velocity;
|
velocity = gain * velocity;
|
||||||
|
|
||||||
// note off messages will often a few ms arrive late, try to prevent glitching by subtracting from the duration length
|
// note off messages will often a few ms arrive late, try to prevent glitching by subtracting from the duration length
|
||||||
@ -267,18 +265,20 @@ Pattern.prototype.midi = function (output) {
|
|||||||
|
|
||||||
// Handle midibend
|
// Handle midibend
|
||||||
if (midibend !== undefined) {
|
if (midibend !== undefined) {
|
||||||
if (typeof midibend !== 'number' || midibend < 1 || midibend > -1) {
|
if (typeof midibend == 'number' || midibend < 1 || midibend > -1) {
|
||||||
|
device.sendPitchBend(midibend, midichan, { time: timeOffsetString });
|
||||||
|
}else{
|
||||||
throw new Error('expected midibend to be a number between 1 and -1');
|
throw new Error('expected midibend to be a number between 1 and -1');
|
||||||
}
|
}
|
||||||
device.sendPitchBend(midibend, midichan, { time: timeOffsetString });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle miditouch
|
// Handle miditouch
|
||||||
if (miditouch !== undefined) {
|
if (miditouch !== undefined) {
|
||||||
if (typeof miditouch !== 'number' || miditouch < 1 || miditouch > 0) {
|
if (typeof miditouch == 'number' || miditouch < 1 || miditouch > 0) {
|
||||||
|
device.sendKeyAfterTouch(miditouch, midichan, { time: timeOffsetString });
|
||||||
|
}else{
|
||||||
throw new Error('expected miditouch to be a number between 1 and 0');
|
throw new Error('expected miditouch to be a number between 1 and 0');
|
||||||
}
|
}
|
||||||
device.sendKeyAfterTouch(miditouch, midichan, { time: timeOffsetString });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle midicmd
|
// Handle midicmd
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user