Commit Graph

23 Commits

Author SHA1 Message Date
5684185+vsariola@users.noreply.github.com
00850c8001 code/text formatting and cleaning up whitespace 2023-09-24 10:47:54 +03:00
vsariola
fc89973848 fix(tests): make test_renderer return 1 if not enough parameters 2021-04-10 15:14:19 +03:00
vsariola
05e6f6da4e fix(tests): in test_renderer.c, print errors to stderr instead of stdout 2021-04-10 15:13:45 +03:00
vsariola
38c0cea40f refactor(templates,tests): make sync an extern instead of parameter to render
This is to be able to use CreateThread with su_render_song; let's worry about multicore rendering sometime in the future.
2021-03-20 16:23:51 +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
1be75362d0 refactor(tests): remove copying files to output directory; tests accept path to expected instead 2021-01-05 18:18:48 +02:00
Veikko Sariola
e4490faa2e feat(compiler): Add support for targeting WebAssembly.
The working principle is similar as before with x86, but instead of outputting .asm, it outputs .wat. This can be compiled into .wasm by using the wat2wasm assembler.
2020-12-26 23:16:18 +02:00
Veikko Sariola
2ad61ff6b2 feat(asm&go4k): Preprocess asm code using go text/template
The preprocessing is done sointu-cli and (almost) nothing is done by the NASM preprocessor anymore (some .strucs are still there.
Now, sointu-cli loads the .yml song, defines bunch of macros (go functions / variables) and passes the struct to text/template parses.
This a lot more powerful way to generate .asm code than trying to fight with the nasm preprocessor.

At the moment, tests pass but the repository is a bit of monster, as the library is still compiled using the old approach. Go should
generate the library also from the templates.
2020-12-14 15:44:16 +02:00
Veikko Sariola
e7ae775842 refactor(test_renderer): Allocate buffers statically instead of dynamically, so the tests are closer how Sointu will be eventually used. 2020-12-05 01:06:04 +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
6d883f43ab fix(test_renderer): Add include <string.h> as linux builds were giving warnings for implicit declaration of memset. 2020-11-12 19:50:59 +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
64afa9fb48 Change the C-API to roughly match the new Go-API.
The parameter order is now so that all the in/out int parameters are in the end of the signature.
2020-10-27 21:58:56 +02:00
Veikko Sariola
95b70018cc Fix all CMake tests passing on MinGW: consider minor (< 1e-6) errors in waveform shape successes.
Such errors are due to floating point rounding errors.
2020-10-22 21:19:14 +03:00
Veikko Sariola
c5b6e6e28c Move su_load_gmdls into the responsibility of the intro to call, anticipating multicore rendering so it is called once before all the cores are spun up. 2020-05-27 18:54:34 +03:00
Veikko
5e05057240 Fix builds and tests to pass on Linux.
Builds on both 32-bit and 64-bit executables and all tests (except gm.dls stuff obviously, which was excluded) pass on 64-bit Linux. Cannot test the 32-bit executables, as WSL does not support running 32-bit.
2020-05-27 10:54:37 +03:00
Veikko Sariola
42ebc52c96 Remove trailing spaces and convert tabs to spaces. 2020-05-16 09:16:23 +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
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
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
Veikko Sariola
9c7db45a46 Rewrote parts of the test renderer to read the whole data from disk in one fread. 2020-04-16 14:05:17 +03:00
Veikko Sariola
83e3ab165e Add test for 16-bit output, also moving the testname for test_renderer into compiler definition to avoid rewriting it everytime. 2020-04-15 23:17:03 +03:00
Veikko Sariola
8d984cbc38 Implement ctest unit test, first test simply testing that envelope works as it used to. 2020-04-12 22:05:39 +03:00