implement loopAt with pat state
This commit is contained in:
parent
8052e10f0c
commit
0a82471112
2 changed files with 1 additions and 12 deletions
|
|
@ -2359,15 +2359,10 @@ export const splice = register(
|
||||||
false, // turns off auto-patternification
|
false, // turns off auto-patternification
|
||||||
);
|
);
|
||||||
|
|
||||||
// this function will be redefined in repl.mjs to use the correct cps value.
|
|
||||||
// It is still here to work in cases where repl.mjs is not used
|
|
||||||
|
|
||||||
export const { loopAt, loopat } = register(['loopAt', 'loopat'], function (factor, pat) {
|
export const { loopAt, loopat } = register(['loopAt', 'loopat'], function (factor, pat) {
|
||||||
return _loopAt(factor, pat, 1);
|
return new Pattern((state) => _loopAt(factor, pat, state.controls._cps).query(state));
|
||||||
});
|
});
|
||||||
|
|
||||||
// the fit function will be redefined in repl.mjs to use the correct cps value.
|
|
||||||
// It is still here to work in cases where repl.mjs is not used
|
|
||||||
/**
|
/**
|
||||||
* Makes the sample fit its event duration. Good for rhythmical loops like drum breaks.
|
* Makes the sample fit its event duration. Good for rhythmical loops like drum breaks.
|
||||||
* Similar to `loopAt`.
|
* Similar to `loopAt`.
|
||||||
|
|
|
||||||
|
|
@ -107,11 +107,6 @@ export function repl({
|
||||||
const setCps = (cps) => scheduler.setCps(cps);
|
const setCps = (cps) => scheduler.setCps(cps);
|
||||||
const setCpm = (cpm) => scheduler.setCps(cpm / 60);
|
const setCpm = (cpm) => scheduler.setCps(cpm / 60);
|
||||||
|
|
||||||
// the following functions use the cps value, which is why they are defined here..
|
|
||||||
const loopAt = register('loopAt', (cycles, pat) => {
|
|
||||||
return pat.loopAtCps(cycles, scheduler.cps);
|
|
||||||
});
|
|
||||||
|
|
||||||
Pattern.prototype.p = function (id) {
|
Pattern.prototype.p = function (id) {
|
||||||
pPatterns[id] = this;
|
pPatterns[id] = this;
|
||||||
return this;
|
return this;
|
||||||
|
|
@ -143,7 +138,6 @@ export function repl({
|
||||||
}
|
}
|
||||||
|
|
||||||
evalScope({
|
evalScope({
|
||||||
loopAt,
|
|
||||||
all,
|
all,
|
||||||
hush,
|
hush,
|
||||||
setCps,
|
setCps,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue