remove unessecary changes

This commit is contained in:
Jade (Rose) Rowland 2024-04-06 17:31:56 -04:00
parent 183d3ea4a1
commit cbfa09a2da
3 changed files with 5 additions and 7 deletions

View File

@ -46,7 +46,6 @@ const sendTick = (phase, duration, tick, time) => {
num_seconds_at_cps_change, num_seconds_at_cps_change,
num_seconds_since_cps_change, num_seconds_since_cps_change,
cycle, cycle,
phase,
}); });
num_ticks_since_cps_change++; num_ticks_since_cps_change++;
}; };

View File

@ -12,6 +12,7 @@ export class NeoCyclist {
this.cps = 0.5; this.cps = 0.5;
this.lastTick = 0; // absolute time when last tick (clock callback) happened this.lastTick = 0; // absolute time when last tick (clock callback) happened
this.getTime = getTime; // get absolute time this.getTime = getTime; // get absolute time
this.time_at_last_tick_message = 0;
this.num_cycles_at_cps_change = 0; this.num_cycles_at_cps_change = 0;
this.onToggle = onToggle; this.onToggle = onToggle;
@ -59,19 +60,18 @@ export class NeoCyclist {
end, end,
tickdeadline, tickdeadline,
cycle, cycle,
phase,
} = payload; } = payload;
this.cps = cps; this.cps = cps;
this.cycle = cycle; this.cycle = cycle;
setTimeReference(num_seconds_at_cps_change, num_seconds_since_cps_change, tickdeadline); setTimeReference(num_seconds_at_cps_change, num_seconds_since_cps_change, tickdeadline);
processHaps(begin, end, num_cycles_at_cps_change, num_seconds_at_cps_change, phase); processHaps(begin, end, num_cycles_at_cps_change, num_seconds_at_cps_change);
this.time_at_last_tick_message = this.getTime(); this.time_at_last_tick_message = this.getTime();
}; };
const processHaps = (begin, end, num_cycles_at_cps_change, seconds_at_cps_change, phase) => { const processHaps = (begin, end, num_cycles_at_cps_change, seconds_at_cps_change) => {
if (this.started === false) { if (this.started === false) {
return; return;
} }
@ -86,8 +86,7 @@ export class NeoCyclist {
this.latency + this.latency +
this.worker_time_dif; this.worker_time_dif;
const duration = hap.duration / this.cps; const duration = hap.duration / this.cps;
const deadline = targetTime - phase; onTrigger?.(hap, 0, duration, this.cps, targetTime);
onTrigger?.(hap, deadline, duration, this.cps, targetTime);
} }
}); });
}; };

View File

@ -6,7 +6,7 @@ const OFF_MESSAGE = 0x80;
const CC_MESSAGE = 0xb0; const CC_MESSAGE = 0xb0;
Pattern.prototype.midi = function (output) { Pattern.prototype.midi = function (output) {
return this.onTrigger((time, hap, currentTime, cps, targetTime) => { return this.onTrigger((time_deprecate, hap, currentTime, cps, targetTime) => {
let { note, nrpnn, nrpv, ccn, ccv, velocity = 0.9, gain = 1 } = hap.value; let { note, nrpnn, nrpv, ccn, ccv, velocity = 0.9, gain = 1 } = hap.value;
//magic number to get audio engine to line up, can probably be calculated somehow //magic number to get audio engine to line up, can probably be calculated somehow
const latency = 0.03; const latency = 0.03;