add drum machines and bank parameter

This commit is contained in:
2023-11-18 15:08:58 +01:00
parent baf258f3f5
commit 9a6d6b914f
3 changed files with 3723 additions and 4 deletions

View File

@ -30,6 +30,7 @@ import { getScaleNotes } from "zifferjs";
import { OscilloscopeConfig, blinkScript } from "./AudioVisualisation"; import { OscilloscopeConfig, blinkScript } from "./AudioVisualisation";
import { SkipEvent } from "./classes/SkipEvent"; import { SkipEvent } from "./classes/SkipEvent";
import { AbstractEvent, EventOperation } from "./classes/AbstractEvents"; import { AbstractEvent, EventOperation } from "./classes/AbstractEvents";
import drums from "./tidal-drum-machines.json";
interface ControlChange { interface ControlChange {
channel: number; channel: number;
@ -49,6 +50,7 @@ export async function loadSamples() {
samples("github:Bubobubobubobubo/Dough-Amiga/main"), samples("github:Bubobubobubobubo/Dough-Amiga/main"),
samples("github:Bubobubobubobubo/Dough-Amen/main"), samples("github:Bubobubobubobubo/Dough-Amen/main"),
samples("github:Bubobubobubobubo/Dough-Waveforms/main"), samples("github:Bubobubobubobubo/Dough-Waveforms/main"),
samples(drums, "github:ritchse/tidal-drum-machines/main/machines/")
]); ]);
} }
@ -1279,7 +1281,7 @@ export class UserAPI {
const results: boolean[] = nArray.map( const results: boolean[] = nArray.map(
(value) => (value) =>
(this.app.clock.pulses_since_origin - Math.floor(nudge * this.ppqn())) % (this.app.clock.pulses_since_origin - Math.floor(nudge * this.ppqn())) %
Math.floor(value * this.ppqn()) === Math.floor(value * this.ppqn()) ===
0 0
); );
return results.some((value) => value === true); return results.some((value) => value === true);
@ -1299,7 +1301,7 @@ export class UserAPI {
const results: boolean[] = nArray.map( const results: boolean[] = nArray.map(
(value) => (value) =>
(this.app.clock.pulses_since_origin - nudgeInPulses) % (this.app.clock.pulses_since_origin - nudgeInPulses) %
Math.floor(value * barLength) === Math.floor(value * barLength) ===
0 0
); );
return results.some((value) => value === true); return results.some((value) => value === true);
@ -1899,8 +1901,8 @@ export class UserAPI {
// ============================================================= // =============================================================
register = (name: string, operation: EventOperation<AbstractEvent>): void => { register = (name: string, operation: EventOperation<AbstractEvent>): void => {
AbstractEvent.prototype[name] = function (this: AbstractEvent, ...args: any[]) { AbstractEvent.prototype[name] = function(this: AbstractEvent, ...args: any[]) {
return operation(this, ...args); return operation(this, ...args);
}; };
} }

View File

@ -39,6 +39,7 @@ export class SoundEvent extends AudibleEvent {
volume: ["volume", "vol"], volume: ["volume", "vol"],
zrand: ["zrand", "zr"], zrand: ["zrand", "zr"],
curve: ["curve"], curve: ["curve"],
bank: ["bank"],
slide: ["slide", "sld"], slide: ["slide", "sld"],
deltaSlide: ["deltaSlide", "dslide"], deltaSlide: ["deltaSlide", "dslide"],
pitchJump: ["pitchJump", "pj"], pitchJump: ["pitchJump", "pj"],

3716
src/tidal-drum-machines.json Normal file

File diff suppressed because it is too large Load Diff