Small fixes
This commit is contained in:
@ -80,8 +80,8 @@ export class Note extends Event {
|
|||||||
}
|
}
|
||||||
|
|
||||||
update = (): void => {
|
update = (): void => {
|
||||||
console.log(this.values.type);
|
// TODO: Figure out why _ is sometimes added?
|
||||||
if(this.values.type === 'Pitch') {
|
if(this.values.type === 'Pitch' || this.values.type === '_Pitch') {
|
||||||
const [note,bend] = noteFromPc(this.values.key!, this.values.pitch!, this.values.parsedScale!, this.values.octave!);
|
const [note,bend] = noteFromPc(this.values.key!, this.values.pitch!, this.values.parsedScale!, this.values.octave!);
|
||||||
this.values.note = note;
|
this.values.note = note;
|
||||||
this.values.freq = midiToFreq(note);
|
this.values.freq = midiToFreq(note);
|
||||||
@ -115,7 +115,6 @@ export class Note extends Event {
|
|||||||
}
|
}
|
||||||
|
|
||||||
out = (): void => {
|
out = (): void => {
|
||||||
console.log("NOTE OUT", this.values);
|
|
||||||
const note = this.values.note ? this.values.note : 60;
|
const note = this.values.note ? this.values.note : 60;
|
||||||
const channel = this.values.channel ? this.values.channel : 0;
|
const channel = this.values.channel ? this.values.channel : 0;
|
||||||
const velocity = this.values.velocity ? this.values.velocity : 100;
|
const velocity = this.values.velocity ? this.values.velocity : 100;
|
||||||
|
|||||||
@ -32,6 +32,7 @@ export class Player extends Event {
|
|||||||
if(this.areWeThereYet()) {
|
if(this.areWeThereYet()) {
|
||||||
const event = this.next() as Pitch|Chord|ZRest;
|
const event = this.next() as Pitch|Chord|ZRest;
|
||||||
if(event instanceof Pitch) {
|
if(event instanceof Pitch) {
|
||||||
|
// TODO: Quick hack. Select which attributes to use, but some ziffers stuff is needed for chaining key change etc.
|
||||||
return new Sound(event.asObject(), this.app).sound(name);
|
return new Sound(event.asObject(), this.app).sound(name);
|
||||||
} else if(event instanceof Rest) {
|
} else if(event instanceof Rest) {
|
||||||
return Rest.createRestProxy(event.duration, this.app);
|
return Rest.createRestProxy(event.duration, this.app);
|
||||||
@ -46,7 +47,7 @@ export class Player extends Event {
|
|||||||
if(this.areWeThereYet()) {
|
if(this.areWeThereYet()) {
|
||||||
const event = this.next() as Pitch|Chord|ZRest;
|
const event = this.next() as Pitch|Chord|ZRest;
|
||||||
if(event instanceof Pitch) {
|
if(event instanceof Pitch) {
|
||||||
console.log(event.asObject());
|
// TODO: Quick hack. Select which attributes to use, but some ziffers stuff is needed for chaining key change etc.
|
||||||
const note = new Note(event.asObject(), this.app);
|
const note = new Note(event.asObject(), this.app);
|
||||||
return value ? note.note(value) : note;
|
return value ? note.note(value) : note;
|
||||||
} else if(event instanceof ZRest) {
|
} else if(event instanceof ZRest) {
|
||||||
|
|||||||
Reference in New Issue
Block a user