Commit Graph
71 Commits
Author SHA1 Message Date
Veikko Sariola 7a9ac3489b Add polyphonism support to bridge.go 2020-10-26 13:06:50 +02:00
Veikko Sariola 1d07b4f192 Change the .asm song format so it's a bit easier to parse, by replacing PORT and GLOBALPORT macros with LOCALPORT and GLOBALPORT.
The LOCALPORT and GLOBALPORT just get numeric parameters (unit, port) and (voice, unit, port), respectively, which should be now quite intuitive as most of the time the port index is one of the parameters visible in the .asm file. Only a few units have extra ports beyond transformed variables. Overall, this should make the parsing of the .asm files a lot easier.
2020-10-26 12:55:15 +02:00
Veikko Sariola f495b0575a Fix bug in song.go: the note was pulled from the song data incorrectly. 2020-10-26 12:55:14 +02:00
Veikko Sariola debeaa181c Fix bug in song.go: len(s.Patterns) should have been len(s.Tracks). 2020-10-26 12:55:14 +02:00
Veikko Sariola acab824523 Update README.md 2020-10-24 23:36:56 +03:00
Veikko Sariola 6c90ba2067 Implement a song struct to hold all the information of a single song (corresponding one .asm file) and Render function for it. 2020-10-24 23:25:23 +03:00
Veikko Sariola be7a4e21f3 Optimize asm player size, removing one unnecessary instruction. 2020-10-24 22:07:58 +03:00
Veikko Sariola 3bb3e5c88e Fix su_render_samples to return correct values when built in 32-bit. 2020-10-24 17:04:27 +03:00
Veikko Sariola aa133b4606 Change bridge.go so that there is just SetPatch(...) function, instead of having to SetCommands, SetValues etc.
Now the patch definition in bridge_test.go and test_envelope.asm appear quite similar, so it's clear how they are related.
2020-10-24 16:15:15 +03:00
Veikko Sariola 1abc6f22d5 Change the Go bridge API to more idiomatic Go, offering a callback when the row advances. 2020-10-24 14:39:10 +03:00
Veikko Sariola c9e8000c5f Remove the cmake magic to create bridge.go from bridge.go.in.
The bridge.go now just assumes that the library you want is built in the build/ directory. It's probably a lot better idea than using wherever the latest build was; this way the same build is always used for the library.
2020-10-23 00:04:54 +03:00
Veikko Sariola 163af33c9b Add .cache/ to .gitignore. 2020-10-22 23:31:05 +03:00
Veikko Sariola 896e7e70b1 Add Opcode type to bridge, and pull the opcodes from the cgo side. 2020-10-22 23:29:37 +03:00
Veikko Sariola af75dd38aa Add common build folder names to .gitignore. 2020-10-22 21:19:14 +03: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 b9ec015b4a Document MinGW build commands in README.md. 2020-10-22 21:19:14 +03:00
Veikko SariolaandGitHub 06e8365c06 Update README.md 2020-10-21 09:50:19 +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 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 Sariola 200937aa50 Fix single shot samples: only first half of them was getting played. 2020-05-27 16:21:49 +03:00
Veikko Sariola 8956f524c9 Only compile introspection.asm when SU_USE_INTROSPECTION is defined. 2020-05-27 16:04:52 +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 b64723323f Move player.asm back to sointu.asm, as they were getting again pretty intertwined. 2020-05-26 21:36:06 +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 3cdada41e0 Rename labels in envelope into more sensible. 2020-05-26 18:34:47 +03:00
Veikko Sariola ceae6ffcba Clean up the op_advance code&comments and remove one unnecessary jump. 2020-05-26 18:13:16 +03:00
Veikko Sariola 91b8912015 Rename all SU_BEGIN_* macros into BEGIN_*; there's no real risk of nameclash and makes the code more readable. 2020-05-26 17:45:37 +03:00
Veikko Sariola efc6db71ab Reverse the logic of USE_SECTIONS (it's now DISABLE_SECTIONS) and then remove unnecessary defines. 2020-05-26 17:30:50 +03:00
Veikko Sariola 3b10476dc2 Remove unused strucs / struc members; in particular: .params /.ports. 2020-05-26 16:35:19 +03:00
Veikko Sariola cf86a951f5 Move all constants into the end of sointu.asm, littering them around started getting messy. 2020-05-26 16:30:57 +03:00
Veikko Sariola 35b8253776 Delete CONCATENATE macro - it is not used anymore. 2020-05-26 14:25:15 +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 17c6afceb4 Fix bug that su_env_map was not compiled when using only compressor, and rename it to su_nonlinear_map. 2020-05-25 20:45:36 +03:00
Veikko Sariola 1f92373a63 Limit compressor stack use. 2020-05-25 20:39:10 +03:00
Veikko Sariola 1eb6974d5d Optimize compressor size. 2020-05-25 20:29:34 +03:00
Veikko Sariola 55d9ca0ffc Reverse the voiceno counter: now it starts from MAX_VOICES and decrements until 0. This way, the VM needs not know anything about MAX_VOICES. 2020-05-25 17:23:54 +03:00
Veikko Sariola a193b8b1ef Inline transform_values into the VM, leading to a slightly more efficient register use. 2020-05-25 16:59:15 +03:00
Veikko Sariola 3198452b9c Add a change log. 2020-05-25 14:14:13 +03:00
Veikko Sariola 33d83d29a5 Update project description & version. 2020-05-25 13:58:29 +03:00
Veikko Sariola 8d0ae21fb6 Remove separate playerstack and clean up the code. 2020-05-25 13:44:30 +03:00
Veikko Sariola 7de7b49e24 Change apply to "do" and add brackets. 2020-05-25 13:44:29 +03:00
Veikko Sariola 2c6f4f44d5 Use some of the unused space of synth object for curvoices. 2020-05-25 13:44:28 +03:00
Veikko Sariola 457c1fdc32 Move things to stack, anticipating support for multicore rendering. 2020-05-25 13:44:28 +03:00
Veikko Sariola 5c25eacd08 Optimize delay for better register use. 2020-05-23 21:06:58 +03:00
Veikko Sariola da52c10f7f Get rid of transformed values and use the header of the voice for that; saves _CX completely for the opcode. 2020-05-23 21:06:57 +03:00
Veikko Sariola 79b384a0d6 Clean up comments and some defines. 2020-05-23 16:02:29 +03:00
Veikko Sariola bd005d52a7 Clean up whitespace. 2020-05-23 15:09:32 +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 afbff66e36 Use strucs for stack locations, instead of hard-coding them everywhere. 2020-05-23 14:56:06 +03:00
Veikko Sariola 654e5868bc Implement support for 64-bit builds.
The implentation is through a few macros to handle the fact in 64-bit, all addresses have to be loaded first to register and only offsets are ok. Also, push only supports 64-bit registers in 64-bit, so we have _AX, _BX, _CX etc. defines, which are eax, ebx and ecx on 32bit and rax, rbx and rcx on 64bit.
2020-05-21 17:18:18 +03:00
Veikko Sariola 5d1145be39 Improve README. 2020-05-17 16:48:28 +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 42ebc52c96 Remove trailing spaces and convert tabs to spaces. 2020-05-16 09:16:23 +03:00
Veikko Sariola d328431413 Improve README. 2020-05-16 08:54:55 +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 3c3fe6caf8 Improve comments and formatting. 2020-05-03 16:34:39 +03:00
Veikko Sariola 212951c75d Make tests rebuild when 4klang.asm and 4klang.inc are changed. 2020-05-03 12:50:42 +03:00
Veikko Sariola 9546574f13 Add regression test for AUX output. 2020-05-03 11:21:09 +03:00
Veikko Sariola c63dfd74f9 Make transform macro definition slightly more readable. 2020-05-03 11:12:53 +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 0c08f3d41c Remove unnecessary short jump. 2020-05-01 09:34:17 +03:00
Veikko Sariola 8dc7a9b5a0 Fix some name manglings. 2020-05-01 09:31:36 +03:00
Veikko Sariola 405ef66b31 Remove unnecessary code from Power-function.
Also, improve comments.
2020-05-01 09:18:10 +03:00
Veikko Sariola 660da68a48 Add regression test for polyphony (MAX_VOICES = 2). 2020-05-01 08:51:43 +03:00
Veikko Sariola 771c0b96e3 Put back 8klang builds. 2020-04-30 13:08:37 +03:00
Veikko Sariola 2bee9edd0b Quick fix so that global store opcode is exported as 12 when glitch is not used. 2020-04-12 22:14:28 +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
Veikko Sariola e180694d9e Switch to CMake for builds and reorganize the source directories. 2020-04-12 22:05:38 +03:00