Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Idea: Make it possible to tie LFO to delay-time with tickbox? #36

Open
esaruoho opened this issue Oct 6, 2017 · 11 comments
Open

Idea: Make it possible to tie LFO to delay-time with tickbox? #36

esaruoho opened this issue Oct 6, 2017 · 11 comments

Comments

@esaruoho
Copy link
Contributor

esaruoho commented Oct 6, 2017

would it be possible to tie LFO to Delay/Echo clarification: LFO to Delay Time and Pan with tickboxes? would be real swell :)

@vsariola
Copy link
Contributor

vsariola commented Oct 8, 2017

I think the panning works pretty close what you are thinking: when slide the panning slider all the way to the right, it does not mean that the sound comes from right channel. Instead, it means that the sound continuously (sinusoidally) alternate between left and right. You can use the panning frequency to control how fast it happens.

Regarding delay tied to LFO, how often you would use it? In principle, it could be added without breaking too much: fxLFO could include two bit flags on how the LFO behaves. That would be backward compatible solution too. But I checked the player-small.js; adding the feature would take something of the order of ~20 bytes and might make it slightly slower (LFO oscillator would be called always).

In particular, the solution would be something like:

o = oscLFO(lfoFreq * k) * lfoAmt + 0.5; // reused in two places
...
if (fxLFO & 1) { ... }
...
z = dlyAmt * (fxLFO & 2 ? o : 1);
lsample += chnBuf[k-dly+1] * z;
rsample += chnBuf[k-dly] * z;

Marcus?

@mbitsnbites
Copy link
Owner

I feel that every time I make a change like this (e.g. when I added the arpeggio effect) the player routine grows slightly, and all the small increases in size add up.

At some point it would be nice to have some automatic player routine generation based on song data analysis (e.g. if the arpeggio effect is not used, exclude the arpeggio generation code). So far I have manually edited the player routine myself to remove the parts that I do not use, and I think that as long as it easy to remove the unused parts (e.g. an effect is implemented as a single block of code that you can keep or remove), it's ok if a feature adds a few bytes to the player routine.

Regarding your solution, it looks fine. It won't change the song format, and it would be fairly easy to remove the code if you wish to trim a few bytes.

@vsariola
Copy link
Contributor

vsariola commented Oct 8, 2017

Esa, one more clarification: did you mean tying the LFO to the delay time or the delay amount. Now that I think of it, tying it to delay time could potentially produce pretty funky sounds, but maybe Esa can comment what he was trying to achieve.

@esaruoho
Copy link
Contributor Author

esaruoho commented Oct 8, 2017

@vsariola LFO->delay time :)

edited issue title, and original posting to clarify it's definitely LFO -> Delay Time.

@esaruoho esaruoho changed the title Idea: Make it possible to tie LFO to delay/echo and Pan with tickboxes? Idea: Make it possible to tie LFO to delay-time with tickbox? Oct 8, 2017
@mbitsnbites
Copy link
Owner

As @vsariola said, I suspect that the controlling the delay time with an LFO can produce undesired effects.

@esaruoho
Copy link
Contributor Author

esaruoho commented Oct 8, 2017

@mbitsnbites thing is, i think when @vsariola used the words "pretty funky", he meant "cool" as opposed to "crappy" ;)

@mbitsnbites
Copy link
Owner

I did a quick hack (modulated the delay time with the LFO), and it sounded like lo-fi frequency modulation (Doppler effect or similar). Cool effect, but useful?

@mbitsnbites
Copy link
Owner

@esaruoho If you'd like to try it out, I did a branch with delay time modulation (not sure if it's an optimal implementation in the player routine yet): https://github.com/mbitsnbites/soundbox/tree/feature/lfo_for_delay_time

@mbitsnbites
Copy link
Owner

Here's the diff: a3bcae4

@esaruoho
Copy link
Contributor Author

@mbitsnbites Hi! How much of a size increase do you think this will cause for 4Kb intros, if used?

@mbitsnbites
Copy link
Owner

Looking at my patch, I'd say that the size increase would be minimal (i.e. only a few bytes, less than 100 bytes for sure).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants