mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-16 16:18:27 +00:00
fix MIDI CC messages
This commit is contained in:
parent
c5738aeed9
commit
97f84ee87f
@ -3,6 +3,7 @@ import { Pattern, noteToMidi } from '@strudel.cycles/core';
|
|||||||
|
|
||||||
const ON_MESSAGE = 0x90;
|
const ON_MESSAGE = 0x90;
|
||||||
const OFF_MESSAGE = 0x80;
|
const OFF_MESSAGE = 0x80;
|
||||||
|
const CC_MESSAGE = 0xb0;
|
||||||
|
|
||||||
Pattern.prototype.midi = function (output) {
|
Pattern.prototype.midi = function (output) {
|
||||||
return this.onTrigger((time, hap, currentTime) => {
|
return this.onTrigger((time, hap, currentTime) => {
|
||||||
@ -37,14 +38,9 @@ Pattern.prototype.midi = function (output) {
|
|||||||
const scaled = Math.round(ccv * 127);
|
const scaled = Math.round(ccv * 127);
|
||||||
messagesfromjs.push({
|
messagesfromjs.push({
|
||||||
requestedport,
|
requestedport,
|
||||||
message: [ON_MESSAGE + midichan, ccn, scaled],
|
message: [CC_MESSAGE + midichan, ccn, scaled],
|
||||||
offset: roundedOffset,
|
offset: roundedOffset,
|
||||||
});
|
});
|
||||||
messagesfromjs.push({
|
|
||||||
requestedport,
|
|
||||||
message: [OFF_MESSAGE + midichan, ccn, scaled],
|
|
||||||
offset: roundedOffset + duration,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
// invoke is temporarily blocking, run in an async process
|
// invoke is temporarily blocking, run in an async process
|
||||||
if (messagesfromjs.length) {
|
if (messagesfromjs.length) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user