Fix for ziffers chord fix
This commit is contained in:
@ -137,10 +137,26 @@ 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) {
|
||||||
return new SoundEvent({dur: event.duration, freq: event.freq}, this.app).sound(name);
|
const obj = event.getExisting(
|
||||||
|
"freq",
|
||||||
|
"pitch",
|
||||||
|
"key",
|
||||||
|
"scale",
|
||||||
|
"octave",
|
||||||
|
"parsedScale"
|
||||||
|
);
|
||||||
|
obj.dur = event.duration;
|
||||||
|
return new SoundEvent(obj, this.app).sound(name);
|
||||||
} else if (event instanceof Chord) {
|
} else if (event instanceof Chord) {
|
||||||
const pitches = event.pitches.map((p) => {
|
const pitches = event.pitches.map((p) => {
|
||||||
return {freq: p.freq}
|
return p.getExisting(
|
||||||
|
"freq",
|
||||||
|
"pitch",
|
||||||
|
"key",
|
||||||
|
"scale",
|
||||||
|
"octave",
|
||||||
|
"parsedScale"
|
||||||
|
);
|
||||||
});
|
});
|
||||||
return new SoundEvent({dur: event.duration}, this.app).chord(pitches).sound(name);
|
return new SoundEvent({dur: event.duration}, this.app).chord(pitches).sound(name);
|
||||||
} else if (event instanceof ZRest) {
|
} else if (event instanceof ZRest) {
|
||||||
|
|||||||
Reference in New Issue
Block a user