Commit Graph
100 Commits
Author SHA1 Message Date
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 a69f0a1924 feat(tracker): Add keys for holding & releasing a note 2020-12-29 16:32:14 +02:00
Veikko Sariola 29ba6b3658 feat(tracker): use slightly more interesting default instruments 2020-12-29 16:31:28 +02:00
Veikko Sariola cd498e775b refactor(tracker): Rewrote the sequencer loop to use simple mutex 2020-12-29 16:30:44 +02:00
Veikko Sariola 8029dbd1a8 feat(CI): setup Webassembly Binary Toolkit in cloud to run wasm tests 2020-12-27 15:45:31 +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 7e4bcf18e4 Update README.md. 2020-12-18 22:51:32 +02:00
Veikko Sariola 7f049acf88 feat(cli): Re-engineer CLIs, split play & compile
Play depends on bridge and compile on compiler package. Before, the compiler depended on bridge, but we could not use the compiler to build the library, as the bridge depends on the library. Also, play can now start having slightly more options e.g. wav out etc.
2020-12-18 20:25:49 +02:00
Veikko Sariola 2d00640e06 Update README.md 2020-12-17 00:01:27 +02:00
Veikko Sariola 358db1ca46 Update README.md 2020-12-16 23:56:07 +02:00
Veikko Sariola e6feed1e26 fix(go): Remove remaining references to go4k. 2020-12-16 21:39:23 +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
Veikko Sariola 92c8b70fd2 refactor(tests): Save .yml in the repo; auto-generate .asm when needed 2020-12-09 13:48:19 +02:00
Veikko Sariola a03d46284c refactor(asm): Put a high alignment on the uninitialized sections so the pointers have less entropy. 2020-12-08 10:58:32 +02:00
Veikko Sariola 41fa46e954 fix(asm/RECEIVE): Enabling stereo receive broke mono receive versions. 2020-12-08 10:58:01 +02:00
Veikko Sariola 8ec3a1208b refactor(asm): Implement the Stereo IN opcode with less bytes & entropy. 2020-12-08 10:57:48 +02:00
Veikko Sariola 2106ebde56 feat(sointu-cli): Support importing/exporting in YAML 2020-12-08 10:57:23 +02:00
Veikko Sariola fa163b3884 feat(sointu-cli): Add ability to adjust HOLD value of the patterns 2020-12-07 11:47:17 +02:00
Veikko Sariola fee637b02a refactor(go4k): Rename DeserializeAsm & SerializeAsm to ParseAsm & FormatAsm
Following the naming in strconv.
2020-12-07 11:14:46 +02:00
Veikko Sariola c75e54212b refactor(asmformat): Rewrite DeserializeAsm to take advantage of the consistent syntax in the .asm file.
It is now much shorter, which is probably a good thing.
2020-12-07 11:08:42 +02:00
Veikko Sariola 1a633778bc feat(Song): Support HOLD definition, allowing using other values than 1 as the hold. 2020-12-07 09:01:53 +02:00
Veikko Sariola 975a171d8c feat(sointu-cli): Glob directories also for .json songs. 2020-12-06 20:08:25 +02:00
Veikko Sariola 9e4bee1b67 feat(asmformat): Remove special treatment of oscillator types to ease the parsing of asmformat
BREAKING CHANGE: They are now numeric values like all the rest macro parameters, instead of %defined constants.
2020-12-06 15:05:12 +02:00
Veikko Sariola 1b1a4af5ea refactor(asmformat): .asm starts and stops with BEGIN_SONG and END_SONG which define all the magic defines and BPMs.
Now, every setting is visible to the user, so no need to guess magic defines.
2020-12-06 01:35:54 +02:00
Veikko Sariola e1e8d8cae3 refactor(asm): Remove unused MAX_SAMPLES macro 2020-12-05 23:19:59 +02:00
Veikko Sariola 50ca02442d feat(bridge): Return sensible error messages from bridge and test that patches that should fail actually do. 2020-12-05 21:55:49 +02:00
Veikko Sariola cd95c5ae37 fix(libsointu): Return error as soon as possible, exiting the rendering loop immediately on error. 2020-12-05 20:53:22 +02:00
Veikko Sariola 7bb60de74e feat(libsointu): make su_render return some error codes, typically due to FPU stack errors. 2020-12-05 16:41:07 +02:00
Veikko Sariola 83937bb2ee fix(sointulib): Reset the FPU on each call to render, seems to take away the undeterministic behaviour. 2020-12-05 14:21:53 +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 06cb4c521c refactor(asm): Remove introspection.inc, it is not needed anymore. 2020-12-05 00:40:25 +02:00
Veikko Sariola 6b67d6b544 feat(CI): Fix alsa.pc not found on ubuntu-latest. 2020-12-05 00:29:10 +02:00
Veikko Sariola d19d513ea8 feat(sointu-cli): Merge the asmfmt and sointuplayer to generic command line utility for processing song files.
Currently supports: playing, exporting .asm (reformatting), exporting .h, exporting .raw (raw float32 buffer), exporting .json.
2020-12-05 00:01:24 +02:00
Veikko Sariola 726e79809d feat(sointu-player): If json parsing fails, try parsing it as .asm song. 2020-12-04 00:11:35 +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 SariolaandGitHub e2c6d4b70c fix(CI): Cgo linker flags stopped working.
They caused the tests to fail completely, but without them, the builds only give some warnings. So disabling them for now.
2020-11-20 22:54:33 +02:00
Veikko Sariola 95c8c9c2b7 refactor(go4k): Remove all special treatment from samples and map Song 1-1 to what's in the .asm file.
Whoever uses it, probably wants their own Patch format, as now it is pretty cumbersome to work with sampleoffsets and delays, as the user needs to construct the delaytimes tables and sampleoffset tables.
2020-11-20 22:21:21 +02:00
Veikko Sariola f076409eb1 Update CHANGELOG.md 2020-11-17 00:12:10 +02:00
Veikko Sariola 725f2096fe Commit go.sum to repository. 2020-11-16 23:59:30 +02:00
Veikko Sariola 335d2af05b feat(asm&CI): Add support for macho-formats to header.inc and run tests also on MacOS.
Mac was giving errors about position dependent code, so had to add linker flag -Wl,-no_pie to ld & cgo.
2020-11-16 23:59:13 +02:00
Veikko SariolaandGitHub a799ee2b6d Update README.md: add Tests/Passing badge. 2020-11-12 13:05:05 +02:00
Veikko Sariola c153239710 feat(go4k): Document all the UnitTypes in a 'constant' table. Tells what parameters each unit takes. 2020-11-08 20:49:38 +02:00
Veikko Sariola bcbb5aaf19 feat: Delays and samples are now working through the bridge.
One should call bridge.Init() once during the initialization of the program to load the static sample table. On linux, bridge.Init() does nothing.
2020-11-08 16:03:10 +02:00
Veikko Sariola e65b08d2b3 fix(tracker): Change the "flags" parameter to "type", because this is what the bridge nowadays expects. 2020-11-08 14:19:54 +02:00
Veikko Sariola 05899fc185 Merge branch 'draft/go-tracker' 2020-11-08 14:15:29 +02:00
Veikko Sariola d5886c0920 Change unison to be in the range of 0 - 3.
With this change, forgetting to initialize unison results in the default behaviour: 0 means one oscillator, 3 means four oscillators in unison.
2020-11-08 10:17:43 +02:00
Veikko SariolaandGitHub 910bf42da9 Update README.md 2020-11-07 21:31:24 +02:00
Veikko Sariola 9209aa1cba Implement .asm parsing in go4k, and run succesfully almost all tests/ through the bridge.
Delays and samples are not implemented yet and thus the tests are skipped, as these require parsing the delay and sample tables also. Various macronames were changed to be more sensible and consistent i.e. ATTAC was changed to ATTACK. GatesLow and GatesHigh was removed for the time being and the tracker will just have to know they are the SHAPE and COLOR parameters. SU_SPEED was changed to take a parameter so the parser picks it up.
2020-11-07 21:05:55 +02:00
Veikko Sariola f584138572 Remove expressions from parameters, so the future .asm parser does not need expression evaluator. 2020-11-04 23:31:08 +02:00
Veikko Sariola df83001a64 Change delay macros to use FLAGS(NOTETRACKING) and FLAGS(NONE)
Previously it was + NOTETRACKING. This new way of using FLAGS(...) is more consistent with other macros, making the .asm format easier to parse.
2020-11-04 23:29:16 +02:00
Veikko Sariola d99cfd92d9 Change LOCALPORT and GLOBALPORT macros so that SU_SEND commands are easier to parse.
The new format is to give either 5 or 6 parameters to SU_SEND, corresponding to local and global send, respectively. For example, a global send:
        SU_SEND     MONO,AMOUNT(128),VOICE(2),UNIT(0),PORT(1),FLAGS(SEND_POP)

The SU_SEND macro does the address packing into word.
2020-11-04 23:11:51 +02:00
Veikko SariolaandGitHub 4eaa54ecee Update LICENSE: Fix whitespace. 2020-11-02 23:14:01 +02:00
Veikko SariolaandGitHub b94bb79366 Update README.md 2020-11-02 22:43:15 +02:00
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