Bubobubobubobubo / sardine

Python's missing "algorave" module. Live code music with Python using MIDI, OSC and/or SuperCollider.
https://sardine.raphaelforment.fr
GNU General Public License v3.0
189 stars 32 forks source link

Tempo change will unsync patterns until re-evaluation #231

Closed Rhoumi closed 2 weeks ago

Rhoumi commented 1 year ago

When you make a big clock.tempo change, you need to re-evaluate your swimming functions. Here is an example with a change from clock.tempo=670 to clock.tempo=170:

clock.tempo=670

Ps * d("(eu {sid:0 sid:4} 2 3)", p=0.25, leg = 0.15,
        speed="({1 0.98})/2!16 ({1 0.98})/1.5!15 ({2 2.98})",
        note="C0", octer = 0.8, octersub=1,
        )

Pj >> d("(eu kick:2 13 16)", p=1,
        gain=0.8, octersub=2, speed=0.92)

Pk * d("kick:[6] {hihat:[12] kick:6} {snare:[5] snare:8} hihat:[12]",
        leg=0.2, p=0.5,orbit="{0 1}", 
        shape=0.3, room=0.5, gain=0.9, pan="{0 1}",
        )

clock.tempo=170

Pk, Ps and Pj are unsynced, re-evaluation needed.

Bubobubobubobubo commented 1 year ago

@Rhoumi: Can you check the clock-fixes branch and tell me if it solved your issue?

Bubobubobubobubo commented 1 year ago

There is a fix on this branch that is now causing another problem with the internal-clock.

Bubobubobubobubo commented 2 weeks ago

After quite a long time.. I just tested this issue with this code:

clock.tempo = 70

Pa * d("kick . kick .", p=0.5)
Pb * d(". clap . clap", p=0.5)
Pc * d(". . snare .", p=0.5)

clock.tempo = 170

I don't hear any desynchronization between patterns. I'm closing this issue for now. Feel free to re-open a new one if you experience any problem.