• ### Sequencer - skipping a step

Help for a noob?
I'm building a sequencer and would like to be able to skip steps entirely (as opposed to playing a rest) if I select 'skip' for that step. (so the sequence would for example read 0 1 2 3 {skip 4 entirely without a pause} 5 etc.
At first I presumed I would need to change the numbers in my basic [select 0 1 2 3 4 ...] object that we are counting through to disinclude the step I want to skip. (Which is also not something I know how to do anyway) I think this is incorrect because I am using metro and modulo to count through the steps, and step 5 (e.g.) will not come up until metro & modulo get around to it, so it would be the same effect as playing step 4 as a rest.

I've been roaming around forums randomly picking up oddly shaped bits of advice from previous queries and tutorials hoping they are the tool I need but I need a learning strategy for this particular thing, I'm getting a bit discouraged. Hope you can offer a bit of help or a point in the right direction. Thank you,

• Posts 13 | Views 2641
• at the output of step 4 at your select you could increment the counter again instead of having step 4 go to your sequencer

alternatively, one pattern I used in my sequencer was to have every step have its own 'step to jump to' value (which would by default be the next step). Instead of having a counter, each step sets the next step to go to.

you can put these 'next step' values into an array and lookup by the current step using [tabread]. (so by default step 0 would map to 1, 1 would map to 2, etc.). but in your case you could just change step 3 to map to 5.

• @frenziedcurtain This mostly works, it needs some reset logic since it can reset or double hit when you enable/disable a step depending on where it is in the count, I forgot to deal with that and I am out of time.
seq.pd

Edit1: I feel like I am over complicating things.
Edit2: Yup, I was, really time to go!
seq1.pd

Edit: fixed an error, the [0( on the right outlet of [list store] is going to the wrong inlet of [f]

• Ah great, thank you folks, lots to chew on there - I can juust about understand it, which I think is the sweet spot for me kludging my way through and possibly learning something in the process! Thanks a million everyone.

• @oid Thanks so much for this gold mine. I'm trying to figure it out just now. However, in the example as per the picture (with the zero on the right hand side of the list store going to the right hand inlet of the float, as described) I still get " Bad arguments for message 'get' to object 'list store' " with every bang from metro. I'll keep tinkering with it and read up on lists to see if I can figure out what I'm missing.

• @seb-harmonik.ar I didn't really mention this at the time, but I'm trying to do something vaguely similar to create a snake sequencer and have presets for 'snake patterns' that have the sequence wander about over a 4x4 grid of steps. I'm using one sequence to count off 1 through 16 and another to tell 1 through 16 which location to actually fire. (so e.g. sequence step 5 might actually bang location 9). I'm currently beginning to experiment with arrays to store these patterns. thanks for the tip, I hope I can understand enough to make use of it.

• @frenziedcurtain That zero on the right outlet of [list store] should be going to the left inlet of the [f], I added a note to my post and updated the patch but not the image, this would not cause your issue just cause it to add an off beat. I can not see why you would get that error or get my patch to give me that error, Did you download my patch or repatch it yourself? Are you using pd vanilla or one of the forks, if a fork it is likely a fault in the fork and checking/filing bug reports may help. Or I might be missing something obvious, I am good at that.

I did notice both of mine will cause a stack overflow if all steps are off, I suspect there is a simple solution to this but I am missing it at this moment.

• @oid Hmm. I just downloaded seq1.pd again so I can be sure I haven't edited anything. It looks my screenshot below, which is broadly identical to your image except for the fix to the float inlet you described. I'm running pd-vanilla.
FWIW I have checked and unchecked all the steps & am still getting the "Bad arguments for message 'get' to object 'list store'" message each time metro lights up.
Am I meant to edit anything to see it working? (All I'm currently doing is toggling metro while in run mode and hoping to see the bangs light up at the end.)
I'm so sorry if I'm being a dope - thank you for your patience!
screenSeq01.png

• @frenziedcurtain Odd, I can not come up with a reason this would fail even if you were using an old version of pd, unless old version of [list store] do not take arguments, you can try sending a list to the right inlet of [list store], just a message with 5 zeros [0 0 0 0 0( will do, but if that was an issue than you should be getting errors from the [set \$1 n( messages every time you click a toggle as well. If you have not restarted pd since you started in on this than you can try restarting pd, sometimes it gets confused and a restart helps. If that does not help than I am stumped on this one, perhaps update your pd, there is a new version as of a day or two ago.

But we can rework it to an array and an array has some advantages, it is fixed size so can be faster than [list store] or [text] which automatically resize themselves but in this case they should all be about the same since [list store] and [text] have a default size of 100 and do not start reallocating until you get over 100.
seq2.pd

• Hi again. Seq2.pd is working beautifully! I think you are on to the root of my problem with the version I'm using though, I have a new installation of Raspian on a RPi4 & sudo apt-get upgrade only takes me up to Pure Data 0.51.4 (looking thorough the change notes I see that "new methods were added to list store" from 52 onwards, which I suspect is where our trouble is). I was stumped because I'd assumed 'get me the newest version' would actually do just that, but it transpires that in RPi world this is apparently not the case

Seq1 works fine (with the previously mentioned stack overflow) on my Mac which has 0.53.2. I was also mucking about with Seq1 on my work windows laptop in odd moments (it didn't work) and I suspect it too has a crusty old version of pd on it, though I expect I can upgrade that easily enough.

I'm not sure where I'd get later versions of Pd suitable for the raspberry Pi 4. I do see some later official Linux distributions at https://puredata.info/downloads/pure-data/releases but I'm unsure how to install them or whether they are suitable. But that's a problem for another day.

I'm going to soldier on with the array solution you gifted me with seq2 and see how far it takes me. I do want to update my Pi at some point because I'm trying to create a mobile sequencer, so it'll be worth sorting out. Thank you so much for your patience and support, I truly appreciate it!

• @frenziedcurtain Just looked at 51.4, I forgot the [get( method required two arguments back then, element and number of elements to get, so [get \$1 1( instead of [get \$1( would solve that error but you would still get errors for the [set( method which apparently was introduced in 52, thought that was one of the original methods. Mystery solved. If your rpi has the dev tools installed (compiler and all that) than pd is very simple to build from source, but for making a sequencer it will not be a must to have the most recent pd, there might be the odd time things would be slightly easier with a newer version but as you can see we have other ways to go. [list store] is my goto anytime when I am dealing with short lists since it has some useful methods like {insert( and [delete( which are more awkward to do with [array] and [text].

• Thanks again & yes turned out the laptop was grinding along on 41-something. Once I get this sequencing wish done I want to work on some more fundamentals. Thanks so much for everything.

• hey, I saw this post and thought skipping a step is an interesting idea.

Here's one version I came up with, but the skipped step is randomized

Posts 13 | Views 2641
Internal error.

Oops! Looks like something went wrong!