White Whale: Ping-pong playback mode

Feature request! Actually looking at the code I think this should be pretty easy.
When reaching the end of the current sequence play the same sequence in reverse, a la Metropolis.

I would be happy to try and implement the feature myself – is there a preferred IDE people are using for this? Or how would I get started?

EDIT: I should note – I have about a decade of Objective-C, Java, and C++ experience, never coded strictly in C before but it doesn’t look too foreign to me

3 Likes

If I understand what you are asking for, you can do this now. Hold the top, right pad. Then press the pad 1 down and 1 to the left.

No, that would just be reverse mode. What I’m suggesting is a mode where it alternates playing in forward and reverse, potentially making a 64 step pattern with a mirror image

it’s would be a great add !

Go for it. There are lots of us that can help.

First thing to start with it is getting WW to compile on your computer. Have a look here for details for all the modules:

(shout out if you need Windows instructions)

1 Like

Thanks! I’ll be on OSX, hopefully I can take a stab at it later this week.

1 Like

+1 and should be really simple to implement.

that would be good,
but coming from a non coder person… the great implementation for whitewhale would be to have pleyback mode per track :slight_smile:
don’t know if it’s even possible but it’s just my idea
… and track length? :wink:
anyways, everything is welcome and thanks in advance if you put some time on improving whitewhale for everybody!

What do you mean by per track? Like the trigger outs playing forwards, CV1 playing backwards, and CV2 playing in reverse? Could work, but also could get pretty confusing

let’s say you have 4 tracks, cvs goes toghether with it’s own track, 1 and 2
then:
track 1 backwards
track 2 random
track 3 reverse
track 4 drunk

does it make sense? for example i would use it a lot because i could mix 2 tracks for beats allways on playback forward, and maybe two melodies in random to get some random results allways changing

Ah interesting. I’m not sure of how the UI would work for that, but it could create some interesting rhythms.

Here is what may be totally off - have not spent much time with the code yet - but hopefully will be a start of adding Ping Pong order to WW:

White Whale Ping Pong

  1. add 1 var to line 77
    mPingpong

  2. insert following else clause at line 299

else if(w.wp[pattern].step_mode == mPingpong) { // PINGPONG
if(w.wp[pattern].loop_dir == 1 && next_pos < w.wp[pattern].loop_start)
next_pos = w.wp[pattern].loop_start;
else if(w.wp[pattern].loop_dir == 1 && next_pos > w.wp[pattern].loop_end)
next_pos = w.wp[pattern].loop_end;
else if(w.wp[pattern].loop_dir == 1 && next_pos > w.wp[pattern].loop_start)
next_pos = next_pos++;
else if(w.wp[pattern].loop_dir == 2 && next_pos < w.wp[pattern].loop_end)
next_pos = next_pos–;
cut_pos = 0; // not certain purpose of this var
}

I’m not set up to compile, so code is untested.

And this may be a start at adding an ‘odd’ and ‘even’ step playback:

else if(w.wp[pattern].step_mode == mFwdOdd) { // ODD
if(pos >= LENGTH) next_pos = 0;
else next_pos = pos + 2;
cut_pos = 0;
} /** My Even hack **/
else if(w.wp[pattern].step_mode == mFwdEven) { // EVEN
if(pos >= LENGTH) next_pos = 1;
else next_pos = pos + 2;
cut_pos = 0;
}

Begs the question, do you play the start/end point once or twice? 1,2,3,3,2,1,1,2… vs 1,2,3,2,1,2… Possibly a matter of choice?

The snippet doesn’t flip the sense of loop_dir. It would seem like having loop_dir as +/-1, would also make the increment easier.

1 Like

Audio Damage’s Sequencer 1 has separate selections for the type of ping pong ordering you suggest, @GoneCaving. I imagine we’d need that as well.

I scoured the code for the spot where ‘loop_dir’ is modified. Couldn’t locate. Perhaps it’s handled by the ‘w.wp’ class? Wonder where that code is…?

loop_dir is used to indicate if a loop wraps around the end (so the starting pos is greater than the end position), so you can’t use it to track the current direction - you’ll need to add another variable for that.

couple more things to consider: cutting to a position - probably just keep the current direction in this case. and for series you need to decide what constitutes a full loop - start…end…start likely, so you go to the next pattern when you hit the start point while in reverse direction.

btw, you can format code easily by putting it between ``` (or using the < / > button above)

Just came to the same conclusion :slight_smile: Regarding pattern change, I think I agree, though originally was thinking that you could jump when hitting either start or end.

Thanks for code tag mention, @scanner_darkly.

I originally had created vars for forward and reverse direction. Then noticed loop_dir being used in another example and thought it might be the key.

I should have looked through the code docs first.

no worries - this is why we have this thread! there are no docs really, it’s just reading the source code, and i’ll be happy to help with any questions, i’ve been looking at the ww code a lot for a mod i’m working on.

Yea I’ve been pondering this myself, and I can see both being pretty useful. Repeating the start and end points maintains the time signature of the original selection, but not repeating might yield some more interesting possibilities.

Personally I think I would end up selecting 5 or 9 steps (assuming I wanted something to remain in 4/4) and not repeating so that you get:
1 2 3 4 | 5 4 3 2 | 1 2 3 4 | 5 4 3 2

But the ability to have all 16 steps selected, creating a 32 step pattern would be really powerful with repetitions:
1 2 3 4 | 5 6 7 8 | 9 10 11 12 | 13 14 15 16 | 16 15 14 13 | 12 11 10 9 | 8 7 6 5 | 4 3 2 1

So maybe this will have to be a 5th (ping pong) and 6th (ping pong repeating) playback mode.

2 Likes