Commit Graph

38 Commits

Author SHA1 Message Date
vsariola
f3cf4a52ce feat(compiler, wasm): do not hard code memory addresses to uninitialized sections
Rather, allocate unitialized segments as needed.
2021-04-15 23:24:58 +03:00
vsariola
f2f54c1579 optimize(templates): Use {{.DI}} consistently in the sinks to improve compression ratio. 2021-03-28 16:52:58 +03:00
vsariola
9a798df55a optimize(templates): use pushf / popf to save & recall stereo bit, instead of bt [...] 2021-03-28 12:38:09 +03:00
vsariola
d5d9f48d2d optimize(templates): use workspace instead of stack for filter temp var, results in less bytes & entropy 2021-03-28 12:37:26 +03:00
vsariola
822cb7bac5 optimize(templates): replace fld / fmulp with a direct fmul 2021-03-27 16:35:58 +02:00
vsariola
4c04f7a38c optimize(templates): use test ah or test al instead of test {{.AX}} in op_send 2021-03-27 16:03:47 +02:00
vsariola
763c4f5136 fix(templates): unison sample oscillators crashed on amd64 2021-03-24 23:49:14 +02:00
vsariola
b0918e65ff fix(templates): add denormalization to compressor filter 2021-03-24 22:05:43 +02:00
vsariola
0c2b1a3856 fix(templates): stereo oscillators were messing up WRK 2021-03-24 00:18:12 +02:00
vsariola
dfc864d131 optimize(templates): allow distort to flow into su_waveshaper (again) 2021-03-23 15:07:45 +02:00
vsariola
4b90c1c50a optimize(templates): don't call compressor_mono if only using stereo compressor 2021-03-21 12:14:28 +02:00
vsariola
d2f4d5d851 optimize(templates): only include lfo if it's actually used 2021-03-21 12:06:58 +02:00
vsariola
3cbc500361 optimize(templates): don't use LEA in player, use MOV
Compresses better.
2021-03-21 11:46:51 +02:00
vsariola
c28bacdfc7 feat(templates): remove clipping from waveshaper; user can clip manually if needed 2021-03-21 11:28:03 +02: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
76cf47a070 optimize(templates): inline calls to __imp__*File on x86
(cherry picked from commit e8bf9cb6467686ba35895094ab804360ab736b5f)
2021-03-20 16:24:53 +02:00
vsariola
0f34674d7f feat(templates): remove etc/drivers from gm.dls to optimize size 2021-03-20 16:24:43 +02: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
a3bdf565fd feat(templates/amd64-386): add define to tell if we are using float samples 2021-03-05 20:50:43 +02:00
vsariola
b15de7f54a fix(templates): the polyphonic player forgot about one push and read stack wrongly 2021-03-05 09:07:47 +02:00
vsariola
6d2b63a5e9 feat(sointu, vm): implement pure-Go interpreter for bytecode
The old "native" compiler bridged version is now started with cmd/sointu-nativetrack,
while the new pure-Go bytecode implemented bytecode interpreter is started with
cmd/sointu-track

Thus, you do not need any of the CMake / cgo stuff to run cmd/sointu-track
2021-03-03 23:55:58 +02:00
vsariola
3e7064e166 refactor(templates, tests): rename C-header defines consistently with Score.go 2021-02-28 16:07:55 +02:00
vsariola
248ca6e30b templates: optimize sources.asm size 2021-02-28 15:14:06 +02:00
vsariola
adcf3ebce8 feat(sointu, tracker,...): restructure domain & tracker models
send targets are now by ID and Song has "Score" part, which is the notes for it. also, moved the model part separate of the actual gioui dependend stuff.

sorry to my future self about the code bomb; ended up too far and did not find an easy way to rewrite the history to make the steps smaller, so in the end, just squashed everything.
2021-02-28 14:24:54 +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
vsariola
3f494661e3 feat(sointu): add RowsPerBeat so non-power of 2 beat divisions are easier 2021-02-01 18:33:52 +02:00
vsariola
61437db0d6 refactor(sointu): add explicit RowsPerPattern to the song 2021-01-21 13:16:41 +02:00
vsariola
1187c2a200 refactor(compiler): remove EncodedSong and pass patterns & sequences separately 2021-01-05 19:25:46 +02:00
vsariola
588488ce54 feat(sointu): remove 16-bit output toggle from song; make it compile time option 2021-01-05 18:08:13 +02:00
vsariola
30379c981d feat: remove hold from song
assume songs code it as 1 always; implementations are free to change this during compilation, but this should be a compile time flag / optimization; not a concern of song.
2021-01-05 15:50:27 +02:00
vsariola
5dd81430b7 feat(sointu): make patterns local to track
The global pattern table is constructed only during compilation. At this point, we can do also all sorts of optimizations / changes e.g. remove unnecessary releases and reuse patterns if there's a pattern already that could be used.
2021-01-03 01:06:59 +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
7974f0ff82 fix(x86): denormalize delay damp filters
the damp filters, after input was switched off, cause the CPU to spike up and causing the tracker audio to start chopping
2020-12-30 19:50:38 +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
224b8dcb70 refactor(go): Move everything from go4k to root package sointu 2020-12-16 21:35:53 +02:00
Veikko Sariola
d0bd877b3f feat(asm&go4k): Rewrote both library & player to use text/template compiler
There is no more plain .asms, both library & player are created from the templates using go text/template package.
2020-12-16 17:23:50 +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