Commit Graph

55 Commits

Author SHA1 Message Date
5684185+vsariola@users.noreply.github.com
84d90cf0f3 fix(vm/compiler): use more yasm-compatible syntax
Closes #134.
2024-05-05 11:34:47 +03:00
5684185+vsariola@users.noreply.github.com
10d20cd26f fix(vm/compiler): export as su_pow, instead of su_power
The export redefinition of label, even though the labels were on the
same line. This was an issue for yasm.

Related to #134.
2024-05-05 11:33:47 +03:00
5684185+vsariola@users.noreply.github.com
4a8d4c5a29 fix(vm/compiler/templates): modulating delaytime in wasm could crash
The modulated delay time was converted to int with i32.trunc_f32_u.
This throws runtime error if the modulations caused the delaytime
to become negative, because _u implied that it should be unsigned
integer and negative numbers were out of range. Using
i32.trunc_f32_s fixed this.
2024-04-08 20:06:20 +03:00
5684185+vsariola@users.noreply.github.com
6d4529971c feat(vm/compiler): export su_power function in case user needs it 2024-04-05 15:49:00 +03:00
5684185+vsariola@users.noreply.github.com
17312bbe4e feat: add ability to disable units temporarily
Quite often the user wants to experiment what particular unit(s) add
to the sound. This commit adds ability to disable any set of units
temporarily, without actually deleting them. Ctrl-D disables and
re-enables the units. Disabled units are considered non-existent in
the patch.

Closes #116.
2024-02-19 21:36:14 +02:00
5684185+vsariola@users.noreply.github.com
d92426a100 feat!: rewrote the GUI and model for better testability
The Model was getting unmaintanable mess. This is an attempt to refactor/rewrite the Model so that data of certain type is exposed in standardized way, offering certain standard manipulations for that data type, and on the GUI side, certain standard widgets to tied to that data.

This rewrite closes #72, #106 and #120.
2024-02-17 18:16:06 +02:00
5684185+vsariola@users.noreply.github.com
6d3c65e11d fix(templates): avoid clobbering ebx in su_load_gmdls
Fixes #130
2024-02-16 20:09:20 +02: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
64270eaf68 refactor: rename FindSendTarget to FindUnit 2023-10-19 13:31:34 +03:00
5684185+vsariola@users.noreply.github.com
43707e5fd6 style(vm): group public/private member types; delete unused types 2023-10-19 13:07:24 +03:00
5684185+vsariola@users.noreply.github.com
fdad626279 style(vm): replace sointu.Unit{...} with {...} when allowed 2023-10-19 13:00:34 +03:00
5684185+vsariola@users.noreply.github.com
960bddfae0 refactor(vm): use vm.GoSynther{}.Synth instead of vm.Synth
vm.Synth was used only in a few places, reduce the number of
exported functions. Also, if we ever add some global configuration
to GoSynther e.g. samplerate, we have a mechanism to do so, instead
of the Synth function.
2023-10-19 12:52:05 +03:00
5684185+vsariola@users.noreply.github.com
7675121a78 style(vm): group public/private member types and rename privates 2023-10-19 12:47:38 +03:00
5684185+vsariola@users.noreply.github.com
e28891abd5 refactor: move ConstructPatterns into compiler package
ConstructPatterns was never used except during compilation, so it
makes sense to have it closer where it is used. We could consider
making it even private function, as the pattern table construction
is quite specific to how compiler compiles and probably not that
reusable elsewhere.
2023-10-19 12:38:18 +03:00
5684185+vsariola@users.noreply.github.com
e010b2da9d docs: improve go doc comments for vm package 2023-10-19 11:54:12 +03:00
5684185+vsariola@users.noreply.github.com
5bbec75120 refactor: rename sointu.Render as AudioBuffer.Fill
The Render name misleading as it did not do the same thing as normal
Synth.Render, because it disregarded time limits. Conceptually, as
the function modifies the state of the synth, it would be better to
be synth.Fill(audioBuffer), but we cannot define methods on
interfaces; therefore, it is audioBuffer.Fill(synth) now.
2023-10-19 11:14:44 +03:00
5684185+vsariola@users.noreply.github.com
b6815f70cb feat: remove unreleased parameter from Play function
The VMs now release all envelopes by default, so this mechanism was
useless / did not actually start them as unreleased even when you
thought they did.
2023-10-19 10:42:20 +03:00
5684185+vsariola@users.noreply.github.com
9f7bbce761 refactor(vm): rename Encode to NewBytecode 2023-10-19 10:32:34 +03:00
5684185+vsariola@users.noreply.github.com
01bf409929 refactor(vm): rename Commands/Values to Opcodes/Operands
The commands and values were not very good names to what the
byte sequences actually are: opcodes and their operands. In
many other places, we were already calling the byte in the Command
stream as Opcode, so a logical name for a sequence of these is
Opcodes. Values is such a generic name that it's not immediately
clear that this sequence is related to the opcodes. Operands is not
perfect but clearly suggests that this sequence is related to
the Opcodes.
2023-10-18 19:53:47 +03:00
5684185+vsariola@users.noreply.github.com
87604dd92e refactor(vm): rename BytePatch to Bytecode 2023-10-18 19:12:34 +03:00
5684185+vsariola@users.noreply.github.com
0a67129a0c refactor!: rename SynthService to Synther and related types
The -er suffix is more idiomatic for single method interfaces, and
the interface is not doing much more than converting the patch to a
synth. Names were updated throughout the project to reflect this
change. In particular, the "Service" in SynthService was not telling
anything helpful.
2023-10-18 17:32:13 +03:00
5684185+vsariola@users.noreply.github.com
33625c6f40 fix(vm): stereo delay flipped taps for right and left channel 2023-10-18 13:54:26 +03:00
5684185+vsariola@users.noreply.github.com
38e9007bf8 refactor: use [][2] as audio buffers, instead of []float32
Throughout sointu, we assume stereo audiobuffers, but were passing
around []float32. This had several issues, including len(buf)/2 and
numSamples*2 type of length conversion in many places. Also, it
caused one bug in a test case, causing it to succeed when it should
have not (the test had +-1 when it should have had +-2). This
refactoring makes it impossible to have odd length buffer issues.
2023-10-18 13:51:02 +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
12dd3dada0 refactor(vm): rewrote BytePatch Encode to use a builder struct
(cherry picked from commit fdf119e50ce62619f508cc423c2ebaa000a1d540)
2023-10-07 14:07:47 +03:00
5684185+vsariola@users.noreply.github.com
8c8232f76e feat(vm)!: implement cross-instrument modulation of all voices
The "auto" was misleading, as it meant self modulation when targetting a unit within instrument itself and just voice 0 when cross-instrument modulation. This feature changes the "auto" meaning "self" for instruments self-modulating, and "all" voices for cross-instrument modulations. "all" is implemented by compiling a single send into multiple repeated sends, with only the last popping the stack (if necessary).

Closes #107
2023-10-07 14:07:39 +03:00
5684185+vsariola@users.noreply.github.com
00850c8001 code/text formatting and cleaning up whitespace 2023-09-24 10:47:54 +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
Alexander Kraus
607e5b5da0 Added x86 asm and C wav writer and player examples.
Specifically:
* Added win32, elf32 and elf64 asm player and wav writers using winmm.
* Added dsound player in C.
* Separated the ALL target and the examples; introduced a new examples target.
2023-08-31 14:15:52 +03:00
Alexander Kraus
d0efcc3001 Added usage examples in C; Added asm include file with track info to sointu-compile. 2023-08-29 09:09:02 +03:00
5684185+vsariola@users.noreply.github.com
7dd2c246a0 feat(vm): add support for gm.dls samples in the go virtual machine (closes #75) 2023-08-28 22:44:37 +03:00
5684185+vsariola@users.noreply.github.com
d82d151f49 fix: native synth building on go 1.21
go v1.21 is more strict about giving methods to C.structs and was complaining about "cannot define new methods on non-local type *C.Synth". The solution was a local type alias: type BridgeSynth C.Synth
2023-08-27 12:24:06 +03:00
5684185+vsariola@users.noreply.github.com
8ffe4a70dd feat(vm/compiler): embed templates to executable 2023-07-08 16:39:41 +03:00
5684185+vsariola@users.noreply.github.com
248ba483c6 feat: add ability to import 4klang patches and instruments 2023-07-06 23:47:55 +03:00
5684185+vsariola@users.noreply.github.com
cd700ed954 feat!: implement vsti, along with various refactorings and api changes for it
The RPC and sync library mechanisms were removed for now; they never really worked and contained several obvious bugs. Need to consider if syncs are useful at all during the compose time, or just used during intro.
2023-05-13 17:56:13 +03:00
vsariola
a8f8911f03 refactor(sointu): Change the signature of Play to accept SynthService instead of Synth
This is more logical as every single use of Play started with compiling the patch of a song with a SynthService.
2021-08-30 22:24:42 +03:00
vsariola
203e8a3ccc refactor(vm): simplify flattenSequence code 2021-05-12 22:44:03 +03:00
vsariola
a2723829da refactor: implement Order and Pattern types: slices returning default values for out of bound indices 2021-05-12 12:08:55 +03:00
vsariola
e9834110ec fix(bridge): respect the hard limit of 64 delay lines to avoid crashes. 2021-05-08 16:51:45 +03:00
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
9b4608e31e feat(vm): construct minimal delaytime table using greedy matching
The idea is to find a minimal array that contains all the delay times and then point all delay times into this array.
2021-03-26 23:07:20 +02:00
vsariola
c5972bc023 fix(vm): skip empty units when detecting what units are used 2021-03-24 00:17:10 +02:00
vsariola
cce99e6508 feat(vm): make the all empty pattern the zero pattern
Perhaps helps compression
2021-03-21 13:30:16 +02:00
vsariola
452a2f6f04 feat(vm): reuse delaytimes if one has already been used before 2021-03-21 10:22:47 +02:00
vsariola
eb61fcb130 fix(vm): parameters with default values (no key in the unit parameter map) were not considered to be used in featureset 2021-03-20 18:46:10 +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
f9225d70a9 refactor(vm): extract polyphony bitmask calculation to its own function & document better 2021-03-10 09:34:23 +02:00
vsariola
43ef6fa72c fix(sointu): fix sync data getting output from play & test it 2021-03-10 09:06:42 +02:00