mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-23 19:48:31 +00:00
Fixes fit so it works after a chop or slice (#1171)
* fix fit so it works after a chop or slice * format
This commit is contained in:
parent
39006e4d71
commit
263c13c36e
@ -2957,11 +2957,14 @@ export const { loopAt, loopat } = register(['loopAt', 'loopat'], function (facto
|
|||||||
export const fit = register('fit', (pat) =>
|
export const fit = register('fit', (pat) =>
|
||||||
pat.withHaps((haps, state) =>
|
pat.withHaps((haps, state) =>
|
||||||
haps.map((hap) =>
|
haps.map((hap) =>
|
||||||
hap.withValue((v) => ({
|
hap.withValue((v) => {
|
||||||
...v,
|
const slicedur = ('end' in v ? v.end : 1) - ('begin' in v ? v.begin : 0);
|
||||||
speed: (state.controls._cps || 1) / hap.whole.duration,
|
return {
|
||||||
unit: 'c',
|
...v,
|
||||||
})),
|
speed: ((state.controls._cps || 1) / hap.whole.duration) * slicedur,
|
||||||
|
unit: 'c',
|
||||||
|
};
|
||||||
|
}),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user