better FM
This commit is contained in:
@ -9,6 +9,7 @@ import {
|
||||
samples,
|
||||
initAudioOnFirstClick,
|
||||
registerSynthSounds,
|
||||
soundMap,
|
||||
// @ts-ignore
|
||||
} from "superdough";
|
||||
|
||||
@ -59,7 +60,7 @@ export class UserAPI {
|
||||
load: samples;
|
||||
|
||||
constructor(public app: Editor) {
|
||||
this.load = samples("github:tidalcycles/Dirt-Samples/master");
|
||||
//this.load = samples("github:tidalcycles/Dirt-Samples/master");
|
||||
}
|
||||
|
||||
// =============================================================
|
||||
@ -1151,6 +1152,7 @@ export class UserAPI {
|
||||
};
|
||||
snd = this.sound;
|
||||
samples = samples;
|
||||
soundMap = soundMap;
|
||||
|
||||
log = console.log;
|
||||
|
||||
|
||||
@ -2,6 +2,8 @@ const key_shortcut = (shortcut: string): string => {
|
||||
return `<kbd class="lg:px-2 lg:py-1.5 px-1 py-1 lg:text-sm text-xs font-semibold text-gray-800 bg-gray-100 border border-gray-200 rounded-lg dark:bg-gray-600 dark:text-gray-100 dark:border-gray-500">${shortcut}</kbd>`;
|
||||
};
|
||||
|
||||
const injectAvailableSamples = (): string => {};
|
||||
|
||||
const introduction: string = `
|
||||
# Welcome
|
||||
|
||||
@ -317,6 +319,15 @@ No sound will play until you add <icode>.out()</icode> at the end of the chain.
|
||||
| <icode>out()</icode> | Returns an object processed by the <icode>superdough</icode> function, using the current values in the <icode>values</icode> object and the <icode>pulse_duration</icode> from the <icode>app.clock</icode>. |
|
||||
`;
|
||||
|
||||
const samples: string = `
|
||||
# Audio Samples
|
||||
|
||||
## Available audio samples
|
||||
|
||||
${injectAvailableSamples()}
|
||||
|
||||
`;
|
||||
|
||||
const about: string = `
|
||||
# About Topos
|
||||
|
||||
|
||||
11
src/Sound.ts
11
src/Sound.ts
@ -46,6 +46,17 @@ export class Sound {
|
||||
return this;
|
||||
};
|
||||
|
||||
fm = (value: number | string): this => {
|
||||
if (typeof value === "number") {
|
||||
this.values["fmi"] = value;
|
||||
} else {
|
||||
let values = value.split(":");
|
||||
this.values["fmi"] = parseFloat(values[0]);
|
||||
if (values.length > 1) this.values["fmh"] = parseFloat(values[1]);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
fmi = (value: number): this => {
|
||||
this.values["fmi"] = value;
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user