removing stuff
This commit is contained in:
@ -55,9 +55,6 @@
|
|||||||
<p id="blinker-9" class="text-white text-5xl">•</p>
|
<p id="blinker-9" class="text-white text-5xl">•</p>
|
||||||
</div>
|
</div>
|
||||||
-->
|
-->
|
||||||
<span id="clockviewer" class="font-mono font-semibold mr-6 py-1 bg-white text-black rounded align-center text-normal px-2">
|
|
||||||
Clock
|
|
||||||
</span>
|
|
||||||
<a id="play-button-1" class="mr-5">
|
<a id="play-button-1" class="mr-5">
|
||||||
<svg class="w-8 h-8" fill="currentColor" viewBox="0 0 14 16">
|
<svg class="w-8 h-8" fill="currentColor" viewBox="0 0 14 16">
|
||||||
<path d="M0 .984v14.032a1 1 0 0 0 1.506.845l12.006-7.016a.974.974 0 0 0 0-1.69L1.506.139A1 1 0 0 0 0 .984Z"/>
|
<path d="M0 .984v14.032a1 1 0 0 0 1.506.845l12.006-7.016a.974.974 0 0 0 0-1.69L1.506.139A1 1 0 0 0 0 .984Z"/>
|
||||||
|
|||||||
@ -1003,6 +1003,7 @@ export class UserAPI {
|
|||||||
length: number,
|
length: number,
|
||||||
rotate: number = 0
|
rotate: number = 0
|
||||||
): boolean[] {
|
): boolean[] {
|
||||||
|
if (pulses == length) return Array.from({ length }, () => true);
|
||||||
function startsDescent(list: number[], i: number): boolean {
|
function startsDescent(list: number[], i: number): boolean {
|
||||||
const length = list.length;
|
const length = list.length;
|
||||||
const nextIndex = (i + 1) % length;
|
const nextIndex = (i + 1) % length;
|
||||||
@ -1199,7 +1200,7 @@ export class UserAPI {
|
|||||||
|
|
||||||
|
|
||||||
sound = (sound: string) => {
|
sound = (sound: string) => {
|
||||||
return new Sound(sound);
|
return new Sound(sound, this.app);
|
||||||
}
|
}
|
||||||
|
|
||||||
samples = samples;
|
samples = samples;
|
||||||
|
|||||||
@ -45,7 +45,7 @@ export class Clock {
|
|||||||
this.time_signature = [4, 4];
|
this.time_signature = [4, 4];
|
||||||
this.tick = 0;
|
this.tick = 0;
|
||||||
this.bpm = 120;
|
this.bpm = 120;
|
||||||
this.ppqn = 48;
|
this.ppqn = 24;
|
||||||
this.transportNode = null;
|
this.transportNode = null;
|
||||||
this.ctx = ctx;
|
this.ctx = ctx;
|
||||||
ctx.audioWorklet.addModule(TransportProcessor).then((e) => {
|
ctx.audioWorklet.addModule(TransportProcessor).then((e) => {
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import { type Editor } from './main';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
superdough,
|
superdough,
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -7,7 +9,7 @@ export class Sound {
|
|||||||
|
|
||||||
values: { [key: string]: any }
|
values: { [key: string]: any }
|
||||||
|
|
||||||
constructor(sound: string) {
|
constructor(sound: string, public app: Editor) {
|
||||||
this.values = { 's': sound }
|
this.values = { 's': sound }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,6 +164,6 @@ export class Sound {
|
|||||||
}
|
}
|
||||||
|
|
||||||
out = (): object => {
|
out = (): object => {
|
||||||
return superdough(this.values, 0.0);
|
return superdough(this.values, this.app.clock.pulse_duration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -37,7 +37,7 @@ export class TransportNode extends AudioWorkletNode {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const now = performance.now();
|
const now = performance.now();
|
||||||
this.app.clock.time_position = futureTimeStamp;
|
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(
|
tryEvaluate(
|
||||||
this.app,
|
this.app,
|
||||||
this.app.global_buffer,
|
this.app.global_buffer,
|
||||||
@ -66,7 +66,7 @@ export class TransportNode extends AudioWorkletNode {
|
|||||||
this.startTime = null;
|
this.startTime = null;
|
||||||
this.elapsedTime = null;
|
this.elapsedTime = null;
|
||||||
this.app.clock.tick = 0;
|
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");
|
this.port.postMessage("stop");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user