Audio samples are now played as one shots in the documentation

This commit is contained in:
2023-08-27 22:14:12 +02:00
parent 26099758c0
commit 9792d4458e
3 changed files with 24 additions and 3 deletions

View File

@ -1,6 +1,6 @@
import { seededRandom } from "zifferjs";
import { MidiConnection } from "./IO/MidiConnection";
import { tryEvaluate } from "./Evaluator";
import { tryEvaluate, evaluateOnce } from "./Evaluator";
import { DrunkWalk } from "./Utils/Drunk";
import { scale } from "./Scales";
import { Editor } from "./main";
@ -80,6 +80,13 @@ export class UserAPI {
);
};
_playDocExampleOnce = (code?: string) => {
this.play();
console.log("Executing documentation example: " + this.app.selectedExample);
evaluateOnce(this.app, code as string);
};
_all_samples = (): object => {
return soundMap.get();
};