adding access to synthesizers
This commit is contained in:
276
src/Sound.ts
276
src/Sound.ts
@ -1,4 +1,4 @@
|
|||||||
import { type Editor } from './main';
|
import { type Editor } from "./main";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
superdough,
|
superdough,
|
||||||
@ -6,164 +6,182 @@ import {
|
|||||||
} from "superdough";
|
} from "superdough";
|
||||||
|
|
||||||
export class Sound {
|
export class Sound {
|
||||||
|
values: { [key: string]: any };
|
||||||
|
|
||||||
values: { [key: string]: any }
|
constructor(sound: string, public app: Editor) {
|
||||||
|
this.values = { s: sound, dur: 0.5 };
|
||||||
|
}
|
||||||
|
|
||||||
constructor(sound: string, public app: Editor) {
|
unit = (value: number): this => {
|
||||||
this.values = { 's': sound }
|
this.values["unit"] = value;
|
||||||
}
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
unit = (value: number): this => {
|
freq = (value: number): this => {
|
||||||
this.values['unit'] = value
|
this.values["freq"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
freq = (value: number): this => {
|
fmi = (value: number): this => {
|
||||||
this.values['freq'] = value
|
this.values["fmi"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
nudge = (value: number): this => {
|
fmh = (value: number): this => {
|
||||||
this.values['nudge'] = value
|
this.values["fmh"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
cut = (value: number): this => {
|
nudge = (value: number): this => {
|
||||||
this.values['cut'] = value
|
this.values["nudge"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
loop = (value: number): this => {
|
cut = (value: number): this => {
|
||||||
this.values['loop'] = value
|
this.values["cut"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
clip = (value: number): this => {
|
loop = (value: number): this => {
|
||||||
this.values['clip'] = value
|
this.values["loop"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
n = (value: number): this => {
|
clip = (value: number): this => {
|
||||||
this.values['n'] = value
|
this.values["clip"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
note = (value: number): this => {
|
n = (value: number): this => {
|
||||||
this.values['note'] = value
|
this.values["n"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
speed = (value: number): this => {
|
note = (value: number): this => {
|
||||||
this.values['speed'] = value
|
this.values["note"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
begin = (value: number): this => {
|
speed = (value: number): this => {
|
||||||
this.values['begin'] = value
|
this.values["speed"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
end = (value: number): this => {
|
begin = (value: number): this => {
|
||||||
this.values['end'] = value
|
this.values["begin"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
gain = (value: number): this => {
|
end = (value: number): this => {
|
||||||
this.values['gain'] = value
|
this.values["end"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
cutoff = (value: number): this => {
|
gain = (value: number): this => {
|
||||||
this.values['cutoff'] = value
|
this.values["gain"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
resonance = (value: number): this => {
|
cutoff = (value: number): this => {
|
||||||
this.values['resonance'] = value
|
this.values["cutoff"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
hcutoff = (value: number): this => {
|
resonance = (value: number): this => {
|
||||||
this.values['hcutoff'] = value
|
this.values["resonance"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
hresonance = (value: number): this => {
|
hcutoff = (value: number): this => {
|
||||||
this.values['hresonance'] = value
|
this.values["hcutoff"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
bandf = (value: number): this => {
|
hresonance = (value: number): this => {
|
||||||
this.values['bandf'] = value
|
this.values["hresonance"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
bandq = (value: number): this => {
|
bandf = (value: number): this => {
|
||||||
this.values['bandq'] = value
|
this.values["bandf"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
coarse = (value: number): this => {
|
bandq = (value: number): this => {
|
||||||
this.values['coarse'] = value
|
this.values["bandq"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
crush = (value: number): this => {
|
coarse = (value: number): this => {
|
||||||
this.values['crush'] = value
|
this.values["coarse"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
shape = (value: number): this => {
|
crush = (value: number): this => {
|
||||||
this.values['shape'] = value
|
this.values["crush"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
pan = (value: number): this => {
|
shape = (value: number): this => {
|
||||||
this.values['pan'] = value
|
this.values["shape"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
vowel = (value: number): this => {
|
pan = (value: number): this => {
|
||||||
this.values['vowel'] = value
|
this.values["pan"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
delay = (value: number): this => {
|
vowel = (value: number): this => {
|
||||||
this.values['delay'] = value
|
this.values["vowel"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
delayfeedback = (value: number): this => {
|
delay = (value: number): this => {
|
||||||
this.values['delayfeedback'] = value
|
this.values["delay"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
delaytime = (value: number): this => {
|
delayfeedback = (value: number): this => {
|
||||||
this.values['delaytime'] = value
|
this.values["delayfeedback"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
orbit = (value: number): this => {
|
delaytime = (value: number): this => {
|
||||||
this.values['orbit'] = value
|
this.values["delaytime"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
room = (value: number): this => {
|
orbit = (value: number): this => {
|
||||||
this.values['room'] = value
|
this.values["orbit"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
size = (value: number): this => {
|
room = (value: number): this => {
|
||||||
this.values['size'] = value
|
this.values["room"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
velocity = (value: number): this => {
|
size = (value: number): this => {
|
||||||
this.values['velocity'] = value
|
this.values["size"] = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
out = (): object => {
|
velocity = (value: number): this => {
|
||||||
return superdough(this.values, this.app.clock.pulse_duration);
|
this.values["velocity"] = value;
|
||||||
}
|
return this;
|
||||||
}
|
};
|
||||||
|
|
||||||
|
dur = (value: number): this => {
|
||||||
|
this.values["dur"] = value;
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
out = (): object => {
|
||||||
|
return superdough(
|
||||||
|
this.values,
|
||||||
|
this.app.clock.pulse_duration,
|
||||||
|
this.values.dur
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user