Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrigger switch on oscillators? #147

Closed
LeStahL opened this issue Sep 5, 2024 · 3 comments
Closed

Retrigger switch on oscillators? #147

LeStahL opened this issue Sep 5, 2024 · 3 comments
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@LeStahL
Copy link
Contributor

LeStahL commented Sep 5, 2024

Would it be possible to add a "retrigger" switch to oscillators, that allows non-retriggered LFOs without using an envelope-less instrument?

@vsariola
Copy link
Owner

vsariola commented Sep 5, 2024

Not really, not at least easily. Whenever there is a new note, the entire workspace (i.e. all state of all units) is wiped with a single rep stosd. The only exception is the delay lines, which use a different workspace to store the delay buffer, but the whole thing is such a kludge that I am worried what happens if we start storing the oscillator state there. And then it becomes a question how do we control this per oscillator (wipe, no wipe).

The usual solution is to put the LFOs in Global and send the signal elsewhere.

@vsariola vsariola added the enhancement New feature or request label Sep 6, 2024
@vsariola
Copy link
Owner

vsariola commented Sep 6, 2024

There's also the additional difficulty here that we are really out of flags at the moment: oscillator has a single flag byte argument, where:

bit 7 = sample based oscillator
bit 6 = sinewave
bit 5 = trisaw
bit 4 = pulse
bit 3 = lfo enabled
bit 2 = gate
bits 0 - 1 = number of unisons

Now, the flags are extremely wasteful: only one of bits 2, 4, 5, 6, or 7 is ever set. But it was done like this to have maximal compressibility: this makes 0x40 (which is also 64 aka neutral value for most oscillators) indicate that the oscillator is sine, which should also be a pretty common occurrence, and also 0x20 correspond to trisaw etc.

This can be changed, to make room for one more toggleable flag, but we should really be careful to not increase size of prods. This goes back to 4klang and it looked a bit weird when I saw it, but I assume gopher did it with a good purpose (compressibility).

@vsariola vsariola added the wontfix This will not be worked on label Oct 18, 2024
@vsariola
Copy link
Owner

vsariola commented Oct 18, 2024

I am closing this as this would fundamentally change how the sointu VM works & there is a way to avoid this, by putting the LFOs in Global. It may be a bit extra work to send from there, but this also likely saves bytes: the send code is already available vs. adding extra code to oscillators to check if we should store the state somewhere else than the usual place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants