Commit Graph

42 Commits

Author SHA1 Message Date
5684185+vsariola@users.noreply.github.com
95af8da939 fix(vm)!: first modulate delay time, then notetracking
BREAKING CHANGE: the order of these operations was inconsistent
across the different VMs. Go VM was the only one to first modulate
and then apply note tracking multiplication. But that made most
sense. So now all different VM versions work in this same way.
2025-04-16 23:17:08 +03:00
5684185+vsariola@users.noreply.github.com
012ed10851 test: add unit test for unisons with phase = 0
This demonstrates a bug found by Virgill:
the x86 templates optimize away the phase
modulation when all phases are set to 0,
but the unisons need the phase modulation
internally to offset the phase of the different
unison oscillators.
2024-08-17 11:06:17 +03:00
5684185+vsariola@users.noreply.github.com
04fbc9f6a7 feat(vm): add dbgain unit, where gain is defined in decibels
Closes #78
2023-10-23 21:57:29 +03:00
5684185+vsariola@users.noreply.github.com
e5691d670a feat(vm): add frequency modulation for oscillators
Closes #105
2023-10-07 21:48:03 +03:00
5684185+vsariola@users.noreply.github.com
f35f948118 fix(vm/compiler/templates/wasm): add support for mono out
Adds also a test case to make sure mono out also works.
2023-09-24 10:27:34 +03:00
5684185+vsariola@users.noreply.github.com
7df8103bf9 fix(vm): change crush resolution to bits (closes #79)
BREAKING CHANGE: The problem with crush was that it had very few usable values. This changes the crush to map the value nonlinearly, so the crush resolution is bits. Still the upper portion of the values is not very usable (bits 12-24 i.e. hardly any crushing), but at least the lower portion is usable. But now crush resolution has slightly different meaning.
2023-09-23 21:23:05 +03:00
5684185+vsariola@users.noreply.github.com
1ac2ad3c75 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.
2023-09-23 15:56:46 +03:00
5684185+vsariola@users.noreply.github.com
70080c2b9d fix(templates/wasm): $WRK was modified by stereo oscillators, messing up all modulations targeting units after the unit
add also tests to make sure we don't mess it up again
2023-04-06 15:03:16 +03:00
vsariola
f713133a0a feat(tests): test also gain parameter in envelopes 2021-04-10 15:58:02 +03:00
vsariola
42c9e045b7 feat: change the compressor unit to apply post-gain instead of pregain.
Pregaining ran into trouble: could not bring the signal level back to near 0dB. For example, with infinite ratio in the pre-gain system, the signal level was capped at threshold, which in turn ran into trouble with stereo signals.
2021-03-20 17:01:04 +02:00
vsariola
99dbdfe223 feat: add the ability to use Sointu as a sync-tracker
There is a new "sync" opcode that saves the top-most signal every 256 samples to the new "syncBuffer" output. Additionally, you can enable saving the current fractional row as sync[0], avoiding calculating the beat in the shader, but also calculating the beat correctly when the beat is modulated.
2021-03-09 23:52:33 +02:00
vsariola
5f7eed4194 fix(templates/amd64-386, tests): fix global stereo sends and add regression test for future
the send asm code is quite ugly atm (pushf & popf to save stereo flag), but the new regression test should ensure we don't break it again if we eventually refactor it
2021-02-15 14:48:16 +02:00
Veikko Sariola
c02c5c3c3d fix(asm/wasm): oscillator phase was causing rounding errors once large enough
gopher had fixed this, but we foolishly removed it. reintroducing fix, although this could be optional only for those who really care. ultimate size optimizers could still want to get rid of it.
2020-12-30 21:19:27 +02:00
Veikko Sariola
efbcf1454e feat(go4k&sointu): Export .h C header files from the songs using go, also automatically during build for the tests.
The header files are automatically generated during build. No need to #define anything; everything is fixed by the .asm file. This adds go as a dependency to run the unit tests, but this is probably not a bad thing, as go is probably needed anyway if one wants to actually start developing Sointu.
2020-12-03 23:43:39 +02:00
Veikko Sariola
a1e7e82d6d refactor(song): Remove song length from Song and assume the user knows MAX_SAMPLES
Trying to force a specific song length other than the default never quite worked, so we'll only support the default MAX_SAMPLES & will calculate it for the user in the user in the exported .h header file.
2020-11-29 22:12:29 +02:00
Veikko Sariola
1b1dabafb8 fix(asm): Change the scaling to 29 in the speed unti (29 increments = double speed).
The old speed scaling of 24 was ill-chosen so that triplets resulted in a minor buffer overflow error. This was never caught by anyone until Visual Studio 2019 in debug mode. Presumably all compilers allocate some extra space so this didn't matter. Now 29 increments = double speed and speeds with alternating 52 and 81 result in triplets that are just slightly faster then ordinary bpm i.e. the buffer will be slightly underrun, which probably is unnoticable to the user.
2020-11-12 19:46:37 +02:00
Veikko Sariola
ccb6434fac Implement compile definition RUNTIME_TABLES, which enables putting the pointers to delay and sample tables to stack.
Useful for the eventual API to be able to modify the delay and sample tables during runtime.
2020-11-02 23:10:33 +02:00
Veikko Sariola
7aac3917b7 Implement a bridge to call Sointu from Go language.
The main interface is render_samples function, which renders several samples in one call,
to limit the number of calls from Go to C. This is compiled into a library, which is then
linked and called from bridge.go.
2020-10-22 21:19:13 +03:00
Veikko Sariola
7e3dc19c83 Add inverse gain to compressor. The inverse gain is applied to the signal before any compressor calculations. 2020-05-27 18:54:37 +03:00
Veikko Sariola
e049bf2dce Change loadnote to load values from [-1,1], to allow using notes for both positive and negative modulations.
Also change SPEED to take this change into account.
2020-05-26 19:21:35 +03:00
Veikko Sariola
dac5afea60 Implement IN, OUTAUX and AUX opcodes, to conveniently input from or output to global ports. 2020-05-25 23:23:24 +03:00
Veikko Sariola
6f06306f0c Re-engineer delay, to use stack for the delay WRK pointer and to support note-syncing transpose. 2020-05-23 15:05:38 +03:00
Veikko Sariola
dc99157fbb Implement unison oscillators: multiple versions of slightly detuned oscillators that are added up to make a signal. 2020-05-19 22:52:21 +03:00
Veikko Sariola
adc4a6e45f Implement sample-based oscillators, with sample import from gm.dls. 2020-05-19 18:29:47 +03:00
Veikko Sariola
fc0ad4c011 Implement compressor. 2020-05-17 16:37:08 +03:00
Veikko Sariola
71a5a18257 Implement player speed modulation opcode for triplets and such. 2020-05-17 09:51:20 +03:00
Veikko Sariola
15717557f1 Split polyphony test into two tests. 2020-05-17 08:32:35 +03:00
Veikko Sariola
d87d2e22cf Implement new effect: bit-crusher.
Maybe a combined hold/bit-crusher effect is needed someday.
2020-05-16 23:27:29 +03:00
Veikko Sariola
ac5b4dd496 Make clip opcode working and add regression tests to it. 2020-05-16 22:49:59 +03:00
Veikko Sariola
5760f78201 Implement gain and inverse gain effects, for the moments when you just need them. 2020-05-16 22:29:08 +03:00
Veikko Sariola
87264c443c Add tests for opcode stereo variants, squashing several bugs in the process. Implement receive opcode to test stereo sending. 2020-05-16 21:23:41 +03:00
Veikko Sariola
f9388b028a Rename test files to represent better the new opcodes they correspond to. 2020-05-16 18:32:56 +03:00
Veikko Sariola
78d4cd50e8 Rewrote most of the synth to better support stereo signals and polyphony. VSTi removed as there is no plan to update the VSTi to support the new features.
The stereo opcode variants have bit 1 of the command stream set. The polyphony is split into two parts: 1) polyphony, meaning that voices reuse the same opcodes; 2) multitrack voices, meaning that a track triggers more than voice. They both can be flexible defined in any combinations: for example voice 1 and 2 can be triggered by track 1 and use instrument 1, and voice 3 by track 2/instrument 2 and voice 4 by track 3/instrument 2. This is achieved through the use of bitmasks: in the aforementioned example, bit 1 of su_voicetrack_bitmask would be set, meaning "the voice after voice #1 will be triggered by the same track". On the other hand, bits 1 and 3 of su_polyphony_bitmask would be set to indicate that "the voices after #1 and #3 will reuse the same instruments".
2020-05-16 08:25:52 +03:00
Veikko Sariola
6be7959cd1 Refactor the waveshaper function to save some bytes. 2020-05-03 17:02:08 +03:00
Veikko Sariola
9546574f13 Add regression test for AUX output. 2020-05-03 11:21:09 +03:00
Veikko Sariola
53a1be9b61 Refactor all values to have a universal support for modulations.
The modulation is now always added during value transformation.
With this, a lot of *_MOD defines could be removed.
The waveform for some tests changed slightly, because when the
value is saved to memory after modulating it, there is some
rounding errors.
2020-05-03 10:41:24 +03:00
Veikko Sariola
660da68a48 Add regression test for polyphony (MAX_VOICES = 2). 2020-05-01 08:51:43 +03:00
Veikko Sariola
09c497fef6 Add regression tests for delay modulations. 2020-04-25 11:29:14 +03:00
Veikko Sariola
7170b049d3 Add regression tests for VCF opcode and its modulations. 2020-04-24 22:51:42 +03:00
Veikko Sariola
4b9b1710eb Add regression tests for delay (DLL) opcode. 2020-04-23 20:06:41 +03:00
Veikko Sariola
a49fba060c Add regression tests for distortion, including sample-and-hold and modulations. 2020-04-18 21:21:21 +03:00
Veikko Sariola
41222b09a7 Move all raw audio files related to tests into subfolders, to have slightly more clean folder structure and to avoid mixing source files and data files. 2020-04-18 19:47:16 +03:00