This commit is contained in:
Felix Roos 2022-11-29 00:10:21 +01:00
parent eab86840d3
commit 729e0afdbe
2 changed files with 4 additions and 3 deletions

View File

@ -22,11 +22,12 @@ Pattern.prototype.csound = async function () {
const deadline = time - currentTime;
const midi = toMidi(getPlayableNoteValue(hap));
// TODO: find out how to send a precise ctx based time
const ctime = `next_time(.000001)+${deadline.toFixed(6)}`;
// const ctime = `${deadline.toFixed(6)}`;
// const ctime = `next_time(0.0001)+${deadline.toFixed(4)}`;
const ctime = `${deadline.toFixed(8)}`;
const cmidi = `cpsmidinn(${midi})`;
const cgain = gain ? `ampdbfs(-32 + 32*${gain})` : `0`;
const code = `schedule(1, ${ctime}, .125, ${cmidi}, ${cgain})`;
// console.log('code', code);
csound.evalCode(code);
});
};

View File

@ -4,7 +4,7 @@
-o dac --port=10000
</CsOptions>
<CsInstruments>
sr=48000x
sr=48000
ksmps=64
nchnls=2
0dbfs=1