mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 21:58:37 +00:00
controls (renamed from packages/osc/superdirt.mjs
This commit is contained in:
parent
acca363a4e
commit
64ea9b7c8b
37
packages/core/controls.mjs
Normal file
37
packages/core/controls.mjs
Normal file
@ -0,0 +1,37 @@
|
||||
import { Pattern, sequence } from '@strudel.cycles/core/strudel.mjs';
|
||||
|
||||
const _name = (name, ...pats) => sequence(...pats).withValue((x) => ({ [name]: x }));
|
||||
|
||||
const _unionise = (func) =>
|
||||
function (...pats) {
|
||||
return this.union(func(...pats));
|
||||
};
|
||||
|
||||
export const s = (...pats) => _name('s', ...pats);
|
||||
Pattern.prototype.s = _unionise(s);
|
||||
export const sound = s;
|
||||
Pattern.prototype.sound = Pattern.prototype.s;
|
||||
|
||||
export const n = (pat) => _name('n', pat);
|
||||
Pattern.prototype.n = _unionise(n);
|
||||
export const number = n;
|
||||
Pattern.prototype.number = Pattern.prototype.n;
|
||||
|
||||
export const room = (pat) => _name('room', pat);
|
||||
Pattern.prototype.room = _unionise(room);
|
||||
|
||||
export const size = (pat) => _name('size', pat);
|
||||
Pattern.prototype.size = _unionise(size);
|
||||
|
||||
export const speed = (pat) => _name('speed', pat);
|
||||
Pattern.prototype.speed = _unionise(speed);
|
||||
|
||||
export const squiz = (pat) => _name('squiz', pat);
|
||||
Pattern.prototype.squiz = _unionise(squiz);
|
||||
|
||||
// currently overwritten by tone package
|
||||
export const gain = (pat) => _name('gain', pat);
|
||||
Pattern.prototype.gain = _unionise(gain);
|
||||
|
||||
export const vowel = (pat) => _name('vowel', pat);
|
||||
Pattern.prototype.vowel = _unionise(vowel);
|
||||
Loading…
x
Reference in New Issue
Block a user