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

LFO drifts from song master BPM #2501

Closed
klopsi opened this issue Jan 3, 2016 · 7 comments
Closed

LFO drifts from song master BPM #2501

klopsi opened this issue Jan 3, 2016 · 7 comments
Assignees
Milestone

Comments

@klopsi
Copy link

klopsi commented Jan 3, 2016

A common technique in electronic music is to link a LFO square wave to the amplitude of a sound, then sync that to the track BPM. The LFO on LMMS synths can be synched to track BPM by right clicking the LFO rate and selecting a note duration, for e.g. 1/8 th notes.

After a period of time, the LFO timing drifts away from the track timing, so that at some point the sound is playing on the off-beat instead of the on-beat, as initially set. This is problematic when you want the sound to be in-sync with other elements in the track.

Attached file lfotest.mmpz (zip)

lfotest.zip

@klopsi
Copy link
Author

klopsi commented Jan 3, 2016

Thanks to softrabbit, I discovered a workaround.

THe LFO Controller in the Controller Rack does NOT drift.

So to get a non-drifting amplitude modulation, Add a controller to the Controller Rack, then (in Song-Editor) right-click the volume knob of the instrument you want to modulate, and select Connect to controller. Then by adjusting the controls of the LFO in the controller rack (Base, Amt, Phase) you can get the desired effect.

@zonkmachine
Copy link
Member

zonkmachine commented Aug 4, 2016

ticksoff

The instrument track gets all shifted. Look at the ticks. When I substitute the long note for the same amount of one bar notes they come out the same wrong. It's in the instrument track. Fixing...
Edit: The ticks being drawn off is a separate bug. Not in 1.1.3

@zonkmachine zonkmachine self-assigned this Aug 4, 2016
@zonkmachine zonkmachine added this to the 1.2.0 milestone Aug 4, 2016
@lukas-w
Copy link
Member

lukas-w commented Aug 25, 2016

The cause seems to be AutomatableModel.cpp#L224.

void AutomatableModel::setValue( const float value )
{
    m_oldValue = m_value;
    ++m_setValueDepth;
    const float old_val = m_value;

    m_value = fittedValue( value, true ); //<== L224
    if( old_val != m_value )
    {

Changing it to

    m_value = fittedValue( value ); //<== L224

fixes the issue, as values are not forced to align to the model's step size anymore. That true parameter was introduced in 44f1d3d via #788.

@zonkmachine
Copy link
Member

👍 Cool! I'm away for some more days. Can you issue a PR for this and/or assign this to yourself?

@lukas-w lukas-w assigned lukas-w and unassigned zonkmachine Aug 26, 2016
@zonkmachine
Copy link
Member

zonkmachine commented Aug 29, 2016

This doesn't work for me. (manually applied the fix to latest master) If I render the test project in lfotest.zip, before and after this fix, and mix down the tracks side by side with one of them inverted, I get a 246 samples long glitch in the beginning where the amplitude is about 3 times what it was before. The rest is just silence (tracks are identical).

Edit: All this with the BBTrack muted
Edit2: Either unmuting the BBTrack or setting the level of the 3xOsc to 100% removes the glitch. This volume knob related glitch is very similar in behaviour to one discussed here

@lukas-w
Copy link
Member

lukas-w commented Aug 29, 2016

Thanks for testing @zonkmachine. I tested using the same project, but with a lower bpm, which indeed shows a difference to before the fix. I'll do some more testing with the original bpm.

@lukas-w
Copy link
Member

lukas-w commented Aug 29, 2016

67e9371 (PR #3003, branch iss-2501) fixes the issue you're experiencing. Due to the way settings were loaded in TempoSyncKnobModel, the correctly calculated speed was overwritten by the old, aligned, value that was written to the file as well.

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

No branches or pull requests

4 participants