Skip to content

Commit

Permalink
remove console statement
Browse files Browse the repository at this point in the history
  • Loading branch information
daslyfe committed Sep 11, 2024
1 parent 44886ad commit e1bf7d2
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 2 deletions.
54 changes: 54 additions & 0 deletions packages/core/controls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,60 @@ export const { delaytime, delayt, dt } = registerControl('delaytime', 'delayt',
*
*/
export const { lock } = registerControl('lock');


/**
* Sets the level of the delay signal.
*
* When using mininotation, you can also optionally add the 'delaytime' and 'delayfeedback' parameter,
* separated by ':'.
*
*
* @name shimmer
* @param {number | Pattern} level between 0 and 1
* @example
* s("bd bd").shimmer("<0 .25 .5 1>")
* @example
* s("bd bd").shimmer("0.65:0.25:0.9 0.65:0.125:0.7")
*
*/
export const { shimmer } = registerControl(['shimmer', 'delaytime', 'delayfeedback']);


/**
* Sets mix of the chorus effect
*
* When using mininotation, you can also optionally add the 'delaytime' and 'delayfeedback' parameter,
* separated by ':'.
*
*
* @name chorus
* @param {number | Pattern} level between 0 and 1
* @example
*
*/
export const { chorus } = registerControl(['chorus', 'chorusdepth', 'chorusspeed']);

/**
* Sets depth of modulation
*
* @name chorus
* @param {number | Pattern} depth between 0 and 1
* @example
*
*/
export const { chorusdepth } = registerControl(['chorusdepth']);

/**
* Sets depth of modulation
*
* @name chorusspeed
* @param {number | Pattern} frequency
* @example
*
*/
export const { chorusspeed } = registerControl(['chorusspeed'], 'chorusfreq');

/**
* Set detune for stacked voices of supported oscillators
*
Expand Down
3 changes: 2 additions & 1 deletion packages/core/util.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ export class ClockCollator {
getTargetClockTime = getUnixTimeSeconds,
weight = 16,
offsetDelta = 0.005,
checkAfterTime = 2,
checkAfterTime = 0.5,
resetAfterTime = 8,
}) {
this.offsetTime;
Expand Down Expand Up @@ -417,6 +417,7 @@ export class ClockCollator {
this.offsetTime = rollingOffsetTime;
}
}


return this.offsetTime;
}
Expand Down
7 changes: 6 additions & 1 deletion packages/osc/osc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ export function parseControlsFromHap(hap, cps) {
}
controls.bank && (controls.s = controls.bank + controls.s);
controls.roomsize && (controls.size = parseNumeral(controls.roomsize));
if (controls.sustain != null) {
controls.hold = controls.sustain;
delete controls.sustain;
}


// speed adjustment for CPS is handled on the DSP side in superdirt and pattern side in Strudel,
// so we need to undo the adjustment before sending the message to superdirt.
controls.unit === 'c' && controls.speed != null && (controls.speed = controls.speed / cps);
Expand All @@ -64,7 +70,6 @@ export async function oscTrigger(t_deprecate, hap, currentTime, cps = 1, targetT
const osc = await connect();
const controls = parseControlsFromHap(hap, cps);
const keyvals = Object.entries(controls).flat();

const ts = Math.round(collator.calculateTimestamp(currentTime, targetTime) * 1000);
const message = new OSC.Message('/dirt/play', ...keyvals);
const bundle = new OSC.Bundle([message], ts);
Expand Down

0 comments on commit e1bf7d2

Please sign in to comment.