mock csound

This commit is contained in:
Felix Roos 2022-11-29 22:04:46 +01:00
parent c40078ffc9
commit 0a098e3008
2 changed files with 73 additions and 0 deletions

View File

@ -88,6 +88,9 @@ const toneHelpersMocked = {
strudel.Pattern.prototype.osc = function () {
return this;
};
strudel.Pattern.prototype.csound = function () {
return this;
};
strudel.Pattern.prototype.tone = function () {
return this;
};
@ -170,6 +173,7 @@ evalScope(
{
// gist,
// euclid,
csound: id,
mini,
getDrawContext,
getAudioContext,

View File

@ -1409,6 +1409,75 @@ exports[`renders tunes > tune: chop 1`] = `
]
`;
exports[`renders tunes > tune: csoundMixed 1`] = `
[
"2/3 -> 3/4: {\\"note\\":58.95209612324834,\\"gain\\":1}",
"2/3 -> 3/4: {\\"note\\":61.95209612324834,\\"gain\\":1}",
"2/3 -> 3/4: {\\"note\\":63.95209612324834,\\"gain\\":1}",
"2/3 -> 3/4: {\\"note\\":66.95209612324834,\\"gain\\":1}",
"0/1 -> 1/6: {\\"note\\":\\"c2\\",\\"s\\":\\"sawtooth\\",\\"cutoff\\":277.9313247650862,\\"resonance\\":10,\\"decay\\":0.1,\\"sustain\\":0}",
"0/1 -> 1/6: {\\"note\\":35.95209612324834,\\"s\\":\\"sawtooth\\",\\"cutoff\\":277.9313247650862,\\"resonance\\":10,\\"decay\\":0.1,\\"sustain\\":0}",
"1/3 -> 1/2: {\\"note\\":\\"c2\\",\\"s\\":\\"sawtooth\\",\\"cutoff\\":277.9313247650862,\\"resonance\\":10,\\"decay\\":0.1,\\"sustain\\":0}",
"1/3 -> 1/2: {\\"note\\":35.95209612324834,\\"s\\":\\"sawtooth\\",\\"cutoff\\":277.9313247650862,\\"resonance\\":10,\\"decay\\":0.1,\\"sustain\\":0}",
"1/2 -> 2/3: {\\"note\\":\\"c2\\",\\"s\\":\\"sawtooth\\",\\"cutoff\\":277.9313247650862,\\"resonance\\":10,\\"decay\\":0.1,\\"sustain\\":0}",
"1/2 -> 2/3: {\\"note\\":35.95209612324834,\\"s\\":\\"sawtooth\\",\\"cutoff\\":277.9313247650862,\\"resonance\\":10,\\"decay\\":0.1,\\"sustain\\":0}",
"5/6 -> 1/1: {\\"note\\":\\"c2\\",\\"s\\":\\"sawtooth\\",\\"cutoff\\":277.9313247650862,\\"resonance\\":10,\\"decay\\":0.1,\\"sustain\\":0}",
"5/6 -> 1/1: {\\"note\\":35.95209612324834,\\"s\\":\\"sawtooth\\",\\"cutoff\\":277.9313247650862,\\"resonance\\":10,\\"decay\\":0.1,\\"sustain\\":0}",
"0/1 -> 1/1: {\\"s\\":\\"bd\\",\\"room\\":0.5,\\"speed\\":0.900230494513707}",
"1/3 -> 2/3: {\\"s\\":\\"hh:1\\",\\"room\\":0.5,\\"speed\\":0.900230494513707}",
"2/3 -> 1/1: {\\"s\\":\\"hh:1\\",\\"room\\":0.5,\\"speed\\":0.9009985942422922}",
]
`;
exports[`renders tunes > tune: csoundTest 1`] = `
[
"0/1 -> 2/1: {\\"note\\":\\"B3\\",\\"s\\":\\"sawtooth\\"}",
"0/1 -> 2/1: {\\"note\\":\\"D4\\",\\"s\\":\\"sawtooth\\"}",
"0/1 -> 2/1: {\\"note\\":\\"E4\\",\\"s\\":\\"sawtooth\\"}",
"0/1 -> 2/1: {\\"note\\":\\"G4\\",\\"s\\":\\"sawtooth\\"}",
"0/1 -> 2/1: {\\"note\\":\\"c2\\",\\"s\\":\\"sawtooth\\"}",
]
`;
exports[`renders tunes > tune: csoundTest2 1`] = `
[
"0/1 -> 511525/2531369: {\\"note\\":\\"D3\\"}",
"-1/4 -> -1508319/10125476: {\\"note\\":\\"Bb3\\"}",
"1/4 -> 4577469/10125476: {\\"note\\":\\"F3\\"}",
"0/1 -> 511525/5062738: {\\"note\\":\\"F4\\"}",
"1/2 -> 3554419/5062738: {\\"note\\":\\"C4\\"}",
"-1/4 -> -1508319/10125476: {\\"note\\":\\"A4\\"}",
"1/4 -> 3554419/10125476: {\\"note\\":\\"A4\\"}",
"1/4 -> 3554419/10125476: {\\"note\\":\\"A4\\"}",
"3/4 -> 9640207/10125476: {\\"note\\":\\"E4\\"}",
]
`;
exports[`renders tunes > tune: csoundTest3 1`] = `
[
"0/1 -> 1/1: {\\"note\\":\\"D3\\"}",
"-1/4 -> 1/4: {\\"note\\":\\"Bb3\\"}",
"1/4 -> 5/4: {\\"note\\":\\"F3\\"}",
"0/1 -> 1/2: {\\"note\\":\\"F4\\"}",
"1/2 -> 3/2: {\\"note\\":\\"C4\\"}",
"-1/4 -> 1/4: {\\"note\\":\\"A4\\"}",
"1/4 -> 3/4: {\\"note\\":\\"A4\\"}",
"1/4 -> 3/4: {\\"note\\":\\"A4\\"}",
"3/4 -> 7/4: {\\"note\\":\\"E4\\"}",
]
`;
exports[`renders tunes > tune: csoundTest4 1`] = `
[
"0/1 -> 2/1: {\\"note\\":\\"B3\\",\\"gain\\":0.5}",
"0/1 -> 2/1: {\\"note\\":\\"D4\\",\\"gain\\":0.5}",
"0/1 -> 2/1: {\\"note\\":\\"E4\\",\\"gain\\":0.5}",
"0/1 -> 2/1: {\\"note\\":\\"G4\\",\\"gain\\":0.5}",
"0/1 -> 2/1: {\\"note\\":\\"c2\\",\\"s\\":\\"sawtooth\\",\\"cutoff\\":800,\\"resonance\\":10,\\"shape\\":0.3}",
"0/1 -> 2/1: {\\"note\\":36.1,\\"s\\":\\"sawtooth\\",\\"cutoff\\":800,\\"resonance\\":10,\\"shape\\":0.3}",
]
`;
exports[`renders tunes > tune: delay 1`] = `
[
"0/1 -> 1/2: {\\"s\\":\\"bd\\",\\"delay\\":0,\\"delaytime\\":0.16,\\"delayfeedback\\":0.8,\\"speed\\":-1}",