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

weird lfo wave? #19

Closed
Nowhk opened this issue May 19, 2020 · 4 comments
Closed

weird lfo wave? #19

Nowhk opened this issue May 19, 2020 · 4 comments

Comments

@Nowhk
Copy link

Nowhk commented May 19, 2020

I'm trying your fancy MG16, and sometimes I see that generated waveform are a bit "glitchy".

here's a screenshot of a "saw" waveform:

image
That "jump" in the middle of the period is not intended I think (at least, seeing your code). Is it?

I'd like to understand this. Many others waveform have those "glitch" sometimes. Here's a triangle one:

image

@thomassidor
Copy link
Owner

Hi @Nowhk

I think what you are seeing is actually the intended behavior.

The modulation generator generates a "random" waveform each time. It's an weighted average between a square, sine, saw and triangle. The glitch you're seeing is probably because there's a bit of a square waveform in there.

Does that make sense?

Best regards, Thomas

@Nowhk
Copy link
Author

Nowhk commented May 19, 2020

Not sure I got it :)
The regenerate function https://github.com/thomassidor/tinytricks/blob/master/src/modulation-generator.cpp#L26 is called once, when I click Trigger. If I click once, I would expect it select a single lfoWave. Than, on each step, is always use the same (only) waveform, no?

I mean, it will only use sin or tri or saw or sqr for each trigger https://github.com/thomassidor/tinytricks/blob/master/src/modulation-generator.cpp#L80, not mixing them :O

@thomassidor
Copy link
Owner

Hi again :)

Yes, lfoWave is set once - it's a random float value between 0 and 3.

But in line 79 to 84 that float value is used to create a weighted sum of the pure waves - so if lfoWave is 0.5 you'll get both a bit of a sine wave and a triangle wave.

@Nowhk
Copy link
Author

Nowhk commented May 19, 2020

Oh now I see the trick :) Thanks

@Nowhk Nowhk closed this as completed May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants