Added chords to ziffers

This commit is contained in:
2023-09-08 00:42:39 +03:00
parent 7993d87915
commit d2161eb5bc
10 changed files with 111 additions and 46 deletions

View File

@ -90,6 +90,7 @@ export class SoundEvent extends AudibleEvent {
return this;
};
public sound = (value: string) => this.updateValue("s", value);
public chord = (value: number[]) => this.updateValue("chord", value);
public snd = this.sound;
public nudge = (value: number) => this.updateValue("nudge", value);
public cut = (value: number) => this.updateValue("cut", value);
@ -162,7 +163,15 @@ export class SoundEvent extends AudibleEvent {
this.values.freq = midiToFreq(note);
};
out = (): object => {
return superdough(this.values, 1 / 4, this.values.dur || 0.5);
out = (): void => {
if(this.values.chord) {
this.values.chord.forEach((freq: number) => {
const copy = {...this.values};
copy.freq = freq;
superdough(copy, 1 / 4, this.values.dur || 0.5);
});
} else {
superdough(this.values, 1 / 4, this.values.dur || 0.5);
}
};
}