From f1b3190d41c76393ada2d24a20fd3e51ea107eb2 Mon Sep 17 00:00:00 2001 From: Raphael Forment Date: Thu, 3 Aug 2023 17:12:14 +0200 Subject: [PATCH] flash the screen when using transport commands --- src/API.ts | 14 ++++++++++++-- src/main.ts | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/API.ts b/src/API.ts index 071f711..927fd8c 100644 --- a/src/API.ts +++ b/src/API.ts @@ -7,6 +7,12 @@ import { webaudioOutput, samples } from '@strudel.cycles/webaudio'; // @ts-ignore import { ZZFX, zzfx } from "zzfx"; +interface TimePoint { + bar: number, + beat: number, + pulse: number +} + const sound = (value: any) => ({ @@ -69,7 +75,7 @@ export class UserAPI { strudelSound = webaudioOutput() load: samples - constructor(public app: Editor) { + constructor (public app: Editor) { this.load = samples("github:tidalcycles/Dirt-Samples/master"); } @@ -291,6 +297,7 @@ export class UserAPI { return this.app.clock.bpm if (bpm < 1 || bpm > 500) + console.log(`Setting bpm to ${bpm}`) this.app.clock.bpm = bpm return bpm } @@ -411,6 +418,10 @@ export class UserAPI { return cycle; } + // ============================================================= + // Time zones + // ============================================================= + // ============================================================= // Trivial functions // ============================================================= @@ -419,7 +430,6 @@ export class UserAPI { zzfx = (...thing: number[]) => zzfx(...thing); sound = async (values: object) => { - await this.load; webaudioOutput(sound(values), 0.00) } } diff --git a/src/main.ts b/src/main.ts index 363e16e..878ccc1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -483,6 +483,7 @@ export class Editor { button: "play" | "pause" | "stop" | "clear", highlight: boolean ) { + this.flashBackground('#2d313d', 200) const possible_selectors = [ '[id^="play-button-"]', '[id^="pause-button-"]',