mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-18 21:14:31 -04:00
fix(vm/compiler): invert the logic of the release flag in the voices (closes #102)
This makes all envelopes released by default, instead of attacking. Add also test to demonstrate the buggy behaviour.
This commit is contained in:
parent
20b0598a57
commit
1ac2ad3c75
@ -162,7 +162,8 @@ regression_test(test_delay_flanger "ENVELOPE;FOP_MULP;PANNING;VCO_SINE;SEND")
|
||||
regression_test(test_envelope_mod "VCO_SINE;ENVELOPE;SEND")
|
||||
regression_test(test_envelope_16bit ENVELOPE "" test_envelope "-i")
|
||||
|
||||
regression_test(test_polyphony "ENVELOPE;VCO_SINE")
|
||||
regression_test(test_polyphony "ENVELOPE;VCO_SINE" POLYPHONY)
|
||||
regression_test(test_polyphony_init POLYPHONY)
|
||||
regression_test(test_chords "ENVELOPE;VCO_SINE")
|
||||
regression_test(test_speed "ENVELOPE;VCO_SINE")
|
||||
regression_test(test_sync "ENVELOPE" "" "" "-r")
|
||||
|
BIN
tests/expected_output/test_polyphony_init.raw
Normal file
BIN
tests/expected_output/test_polyphony_init.raw
Normal file
Binary file not shown.
18
tests/test_polyphony_init.yml
Normal file
18
tests/test_polyphony_init.yml
Normal file
@ -0,0 +1,18 @@
|
||||
bpm: 100
|
||||
rowsperbeat: 4
|
||||
score:
|
||||
rowsperpattern: 16
|
||||
length: 1
|
||||
tracks:
|
||||
- numvoices: 2
|
||||
order: [0]
|
||||
patterns: [[0,0, 0, 0, 64, 1, 0, 0, 64, 1, 64, 1, 0, 0, 0, 0]]
|
||||
patch:
|
||||
- numvoices: 2
|
||||
units:
|
||||
- type: envelope
|
||||
parameters: {attack: 32, decay: 32, gain: 64, release: 64, stereo: 0, sustain: 64}
|
||||
- type: envelope
|
||||
parameters: {attack: 32, decay: 32, gain: 64, release: 64, stereo: 0, sustain: 64}
|
||||
- type: out
|
||||
parameters: {gain: 128, stereo: 1}
|
@ -26,10 +26,11 @@ void SU_CALLCONV su_render_song(float* buffer) {
|
||||
synth->RandSeed = 1;
|
||||
// triger first voice
|
||||
synth->SynthWrk.Voices[0].Note = 64;
|
||||
synth->SynthWrk.Voices[0].Sustain = 1;
|
||||
samples = SU_LENGTH_IN_SAMPLES / 2;
|
||||
time = INT32_MAX;
|
||||
retval = su_render(synth, buffer, &samples, &time);
|
||||
synth->SynthWrk.Voices[0].Release++;
|
||||
synth->SynthWrk.Voices[0].Sustain = 0;
|
||||
buffer = buffer + SU_LENGTH_IN_SAMPLES;
|
||||
samples = SU_LENGTH_IN_SAMPLES / 2;
|
||||
time = INT32_MAX;
|
||||
|
@ -37,6 +37,7 @@ int main(int argc, char* argv[]) {
|
||||
buffer = (float*)malloc(2 * sizeof(float) * su_max_samples);
|
||||
// triger first voice
|
||||
synth->SynthWrk.Voices[0].Note = 64;
|
||||
synth->SynthWrk.Voices[0].Sustain = 1;
|
||||
totalrendered = 0;
|
||||
// First check that when we render using su_render with 0 time
|
||||
// we get nothing done
|
||||
@ -110,7 +111,7 @@ int main(int argc, char* argv[]) {
|
||||
goto fail;
|
||||
}
|
||||
if (i == 8)
|
||||
synth->SynthWrk.Voices[0].Release++;
|
||||
synth->SynthWrk.Voices[0].Sustain = 0;
|
||||
}
|
||||
if (totalrendered != su_max_samples)
|
||||
{
|
||||
|
Reference in New Issue
Block a user