Tidal icon indicating copy to clipboard operation
Tidal copied to clipboard

Transitions are broken

Open nkleemann opened this issue 1 year ago • 1 comments

No matter which orbit a pattern is currently playing on, after using any transition (like xfade or clutch), this pattern get's re-routed to d1.

How to reproduce:

-- plays on second orbit
d2 $ s "bd(3,8)" 

-- bug, now plays on first orbit
xfade 2 $ s "arpy*4" 

However, when orbit is excplicitely given, the bug disappears:

-- plays on second orbit
d2 $ s "bd(3,8)" # orbit 1
-- stays on second orbit, as it should
xfade 2 $ s "arpy*4" # orbit 1

In the Tidal Discord I uploaded a video demo: here

Tidal: 1.9.4 Supercollider: 3.13.0

nkleemann avatar Oct 15 '23 15:10 nkleemann

I have found the source of the bug:

The definition of d2 is https://github.com/tidalcycles/Tidal/blob/6ffb9c4a6213e686b1073cd56c622f2a36ced7eb/src/Sound/Tidal/Safe/Boot.hs#L66

p is just streamReplace https://github.com/tidalcycles/Tidal/blob/6ffb9c4a6213e686b1073cd56c622f2a36ced7eb/src/Sound/Tidal/Safe/Boot.hs#L33

And streamReplace replaces a pattern based on it's ID https://github.com/tidalcycles/Tidal/blob/6ffb9c4a6213e686b1073cd56c622f2a36ced7eb/src/Sound/Tidal/Stream.hs#L590-L592

The implementation of xfade acts like a streamReplace but during a transition it fades between the patterns. Notice line 76 which is the end state where your new pattern fully replaces the original pattern https://github.com/tidalcycles/Tidal/blob/fcc4c5d53a72dcf2b8f4c00cc1c1b3c75eef172d/src/Sound/Tidal/Transition.hs#L74-L77

But since your new pattern has not been modified by . (|< orbit 1), the orbit is lost.

I guess the best solution would be if instead of xfade 2 $ pattern you could write xfade $ d2 $ pattern or similar.

Zalastax avatar Nov 02 '23 15:11 Zalastax