From ab482b38b2d0e1e9e00814abbf471a88af078845 Mon Sep 17 00:00:00 2001 From: Raphael Forment Date: Thu, 17 Aug 2023 13:04:45 +0200 Subject: [PATCH] removing stuff --- index.html | 3 --- src/API.ts | 3 ++- src/Clock.ts | 2 +- src/Sound.ts | 6 ++++-- src/TransportNode.js | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index 8d4611f..d82fbea 100644 --- a/index.html +++ b/index.html @@ -55,9 +55,6 @@

--> - - Clock - diff --git a/src/API.ts b/src/API.ts index 05ac71d..d8e13c0 100644 --- a/src/API.ts +++ b/src/API.ts @@ -1003,6 +1003,7 @@ export class UserAPI { length: number, rotate: number = 0 ): boolean[] { + if (pulses == length) return Array.from({ length }, () => true); function startsDescent(list: number[], i: number): boolean { const length = list.length; const nextIndex = (i + 1) % length; @@ -1199,7 +1200,7 @@ export class UserAPI { sound = (sound: string) => { - return new Sound(sound); + return new Sound(sound, this.app); } samples = samples; diff --git a/src/Clock.ts b/src/Clock.ts index 223a0b3..8d396ef 100644 --- a/src/Clock.ts +++ b/src/Clock.ts @@ -45,7 +45,7 @@ export class Clock { this.time_signature = [4, 4]; this.tick = 0; this.bpm = 120; - this.ppqn = 48; + this.ppqn = 24; this.transportNode = null; this.ctx = ctx; ctx.audioWorklet.addModule(TransportProcessor).then((e) => { diff --git a/src/Sound.ts b/src/Sound.ts index e802a60..80734dd 100644 --- a/src/Sound.ts +++ b/src/Sound.ts @@ -1,3 +1,5 @@ +import { type Editor } from './main'; + import { superdough, // @ts-ignore @@ -7,7 +9,7 @@ export class Sound { values: { [key: string]: any } - constructor(sound: string) { + constructor(sound: string, public app: Editor) { this.values = { 's': sound } } @@ -162,6 +164,6 @@ export class Sound { } out = (): object => { - return superdough(this.values, 0.0); + return superdough(this.values, this.app.clock.pulse_duration); } } \ No newline at end of file diff --git a/src/TransportNode.js b/src/TransportNode.js index 08df2ff..6d72c0b 100644 --- a/src/TransportNode.js +++ b/src/TransportNode.js @@ -37,7 +37,7 @@ export class TransportNode extends AudioWorkletNode { setTimeout(() => { const now = performance.now(); this.app.clock.time_position = futureTimeStamp; - this.$clock.innerHTML = `[${futureTimeStamp.bar}:${futureTimeStamp.beat}:${zeroPad(futureTimeStamp.pulse, '2')}]`; + // this.$clock.innerHTML = `[${futureTimeStamp.bar}:${futureTimeStamp.beat}:${zeroPad(futureTimeStamp.pulse, '2')}]`; tryEvaluate( this.app, this.app.global_buffer, @@ -66,7 +66,7 @@ export class TransportNode extends AudioWorkletNode { this.startTime = null; this.elapsedTime = null; this.app.clock.tick = 0; - this.$clock.innerHTML = `[${1} | ${1} | ${zeroPad(1, '2')}]`; + // this.$clock.innerHTML = `[${1} | ${1} | ${zeroPad(1, '2')}]`; this.port.postMessage("stop"); }