Update zifferjs
This commit is contained in:
@ -30,7 +30,7 @@
|
|||||||
"superdough": "^0.9.3",
|
"superdough": "^0.9.3",
|
||||||
"tailwindcss": "^3.3.3",
|
"tailwindcss": "^3.3.3",
|
||||||
"tone": "^14.8.49",
|
"tone": "^14.8.49",
|
||||||
"zifferjs": "^0.0.6",
|
"zifferjs": "^0.0.8",
|
||||||
"zzfx": "^1.2.0"
|
"zzfx": "^1.2.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -249,16 +249,16 @@ export class UserAPI {
|
|||||||
public zn(input: string,
|
public zn(input: string,
|
||||||
options: {[key: string]: string|number} = {}): Event {
|
options: {[key: string]: string|number} = {}): Event {
|
||||||
const pattern = cachedPattern(input, options);
|
const pattern = cachedPattern(input, options);
|
||||||
|
if(pattern.hasStarted()) {
|
||||||
if(pattern.hasStarted()) {
|
|
||||||
const event = pattern.peek();
|
const event = pattern.peek();
|
||||||
|
|
||||||
// Check if event is modified
|
// Check if event is modified
|
||||||
const node = event.modifiedEvent ? event.modifiedEvent : event;
|
const node = event.modifiedEvent ? event.modifiedEvent : event;
|
||||||
|
|
||||||
const channel = (options.channel ? options.channel : 0) as number;
|
const channel = (options.channel ? options.channel : 0) as number;
|
||||||
const velocity = (options.velocity ? options.velocity : 100) as number;
|
const velocity = (options.velocity ? options.velocity : 100) as number;
|
||||||
const sustain = (options.sustain ? options.sustain : 0.5) as number;
|
const sustain = (options.sustain ? options.sustain : 0.5) as number;
|
||||||
|
|
||||||
if(node instanceof Pitch) {
|
if(node instanceof Pitch) {
|
||||||
if(node.bend) this.MidiConnection.sendPitchBend(node.bend, channel);
|
if(node.bend) this.MidiConnection.sendPitchBend(node.bend, channel);
|
||||||
this.MidiConnection.sendMidiNote(node.note!, channel, velocity, sustain);
|
this.MidiConnection.sendMidiNote(node.note!, channel, velocity, sustain);
|
||||||
|
|||||||
Reference in New Issue
Block a user