mirror of
https://codeberg.org/uzu/strudel
synced 2026-12-05 05:21:10 -05:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7af792116a |
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
deprecated.mjs - Deprecated pattern functions for backwards compatibility
|
||||
Copyright (C) 2026 Strudel contributors - see <https://codeberg.org/uzu/strudel/src/branch/main/packages/core/deprecated.mjs>
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Pattern } from './pattern.mjs';
|
||||
import { register } from './register.mjs';
|
||||
import {
|
||||
zip,
|
||||
stepalt,
|
||||
stepcat,
|
||||
shrinklist,
|
||||
shrink,
|
||||
expand,
|
||||
extend,
|
||||
tour,
|
||||
contract,
|
||||
drop,
|
||||
take,
|
||||
pace,
|
||||
polymeter,
|
||||
} from './stepwise.mjs';
|
||||
|
||||
/**
|
||||
* Plays the pattern at the given cycles per minute.
|
||||
* @tags temporal
|
||||
* @deprecated
|
||||
* @name cpm
|
||||
* @memberof Pattern.prototype
|
||||
* @example
|
||||
* s("<bd sd>,hh*2").cpm(90) // = 90 bpm
|
||||
*/
|
||||
// this is redefined in repl.mjs, using the current cps as divisor
|
||||
export const cpm = register('cpm', function (cpm, pat) {
|
||||
return pat._fast(cpm / 60 / 1);
|
||||
});
|
||||
|
||||
// Deprecated stepwise aliases
|
||||
export const s_cat = stepcat;
|
||||
export const s_alt = stepalt;
|
||||
export const s_polymeter = polymeter;
|
||||
Pattern.prototype.s_polymeter = Pattern.prototype.polymeter;
|
||||
export const s_taper = shrink;
|
||||
Pattern.prototype.s_taper = Pattern.prototype.shrink;
|
||||
export const s_taperlist = shrinklist;
|
||||
Pattern.prototype.s_taperlist = Pattern.prototype.shrinklist;
|
||||
export const s_add = take;
|
||||
Pattern.prototype.s_add = Pattern.prototype.take;
|
||||
export const s_sub = drop;
|
||||
Pattern.prototype.s_sub = Pattern.prototype.drop;
|
||||
export const s_expand = expand;
|
||||
Pattern.prototype.s_expand = Pattern.prototype.expand;
|
||||
export const s_extend = extend;
|
||||
Pattern.prototype.s_extend = Pattern.prototype.extend;
|
||||
export const s_contract = contract;
|
||||
Pattern.prototype.s_contract = Pattern.prototype.contract;
|
||||
export const s_tour = tour;
|
||||
Pattern.prototype.s_tour = Pattern.prototype.tour;
|
||||
export const s_zip = zip;
|
||||
Pattern.prototype.s_zip = Pattern.prototype.zip;
|
||||
export const steps = pace;
|
||||
Pattern.prototype.steps = Pattern.prototype.pace;
|
||||
@@ -20,7 +20,6 @@ export * from './values.mjs';
|
||||
export * from './atoms.mjs';
|
||||
export * from './misc.mjs';
|
||||
export * from './stepwise.mjs';
|
||||
export * from './deprecated.mjs';
|
||||
export * from './pick.mjs';
|
||||
export * from './signal.mjs';
|
||||
export * from './state.mjs';
|
||||
|
||||
@@ -342,7 +342,7 @@ export function stackBy(by, ...pats) {
|
||||
left: stackLeft,
|
||||
right: stackRight,
|
||||
expand: stack,
|
||||
repeat: (...args) => polymeter(...args).steps(steps),
|
||||
repeat: (...args) => polymeter(...args).pace(steps),
|
||||
};
|
||||
return by
|
||||
.inhabit(lookup)
|
||||
|
||||
@@ -2867,29 +2867,6 @@ exports[`runs examples > example "cosine" example index 0 1`] = `
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`runs examples > example "cpm" example index 0 1`] = `
|
||||
[
|
||||
"[ 0/1 → 1/3 | s:hh ]",
|
||||
"[ 0/1 → 2/3 | s:bd ]",
|
||||
"[ 1/3 → 2/3 | s:hh ]",
|
||||
"[ 2/3 → 1/1 | s:hh ]",
|
||||
"[ 2/3 → 4/3 | s:sd ]",
|
||||
"[ 1/1 → 4/3 | s:hh ]",
|
||||
"[ 4/3 → 5/3 | s:hh ]",
|
||||
"[ 4/3 → 2/1 | s:bd ]",
|
||||
"[ 5/3 → 2/1 | s:hh ]",
|
||||
"[ 2/1 → 7/3 | s:hh ]",
|
||||
"[ 2/1 → 8/3 | s:sd ]",
|
||||
"[ 7/3 → 8/3 | s:hh ]",
|
||||
"[ 8/3 → 3/1 | s:hh ]",
|
||||
"[ 8/3 → 10/3 | s:bd ]",
|
||||
"[ 3/1 → 10/3 | s:hh ]",
|
||||
"[ 10/3 → 11/3 | s:hh ]",
|
||||
"[ 10/3 → 4/1 | s:sd ]",
|
||||
"[ 11/3 → 4/1 | s:hh ]",
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`runs examples > example "crush" example index 0 1`] = `
|
||||
[
|
||||
"[ 0/1 → 1/6 | s:hh crush:16 ]",
|
||||
|
||||
Reference in New Issue
Block a user