Sequencer w adjustable length help
Hi!
I've followed the tutorials below to make a step sequencer with adjustable length. What I'm having trouble with is the ability to keep the note values and on/off values of higher steps when the sequence is shortened.
For example if I have a 16 note sequence I like, to be able to shorten it to 11 notes, and then lengthen back to 16 and have the original 16 note sequence I liked (with the same note values in the multi-slider and same on/off triggers in the matrixctrl).
Is this possible and if so I'd really appreciate any help - thanks so much!
you need to shorten count of the steps
not the list itself, which would remove values from it.
for example if you use multislider set to 16 sliders,
don't cange the list, only change counter that recalls them.
Thanks for this - I've got it almost working now, but still have a couple issues.
When a step is "off" in the mtrixctrl, I am getting a change (in snapshot~) to the note on index zero in the multislider.
When I have multiple steps of the same note adjacent to each other, I get no output.
Even if 2 is solved it doesn't work when the sequence length is 1 step (bc counter doesn't change)
1 - I have no idea why it's happening, and unsure how to solve it.
2 - I understand why it's happening but unsure the best way to solve it.
3 - Same as 2
Any advice would be really super nice to hear.

I would not use mix of dsp and non-dsp objects in first place.
definitely not for midi notes.
if you insist on phasor~ based timing, then replace all objects after counter
and grab multislider values directly.
makenote needs to know what to do with repeated held notes.
you either limit note length to less then counter interval,
or set some rules.
look into makenote help file under repeat modes.
Hey appreciate the reply.
I see what you're saying to not mix dsp and non dsp, but I'm at a loss to how to go forward. Is it possible to say more specifically how I might re-work this to better achieve desired results?
Replace objects after counter with what?
How would I implement grabbing slider values directly?
Happy new year by the way - and thanks again!
these are all only our personal opinions and experiences (the same applies to anythign you can find on youtube)... but using signal objects to make a midi sequencer makes only sense when you have a good reason: for example when you need to synchronize your midi sequencer with playing audiofiles from within the same max patch, or smoething releated to the clock of your audio interface. otherwise using [metro] is still ten times more accurate than physical MIDI connections are.
for a simple signal-only version i would start with wysiwyg solutions based on %~, trunc~, /~, i.e. work with signals as "integers" asap, then run that 1. 2. 3. 4. 5. signal into something which reads from buffers (such as play~ or wave~)
using phasor-subdiv-stash-whatnot will of course work somehow if copied correctly from an example, but you learn nothing from it in the end.
~ Happy New Year ~
example using gate

you could also use zl.filter, coll and similar to filter out disabled steps
but it would be a bit more complex.
one could use step enabled = 0 to turn previous note off ...
Thanks - following some of the advice here I got a working version of the sequencer. However I'm running into some trouble trying to implement swing. The first image is the working version without swing. The second is my (possibly terrible) attempt at creating parameters for 8th and 16th note swing control. The issue I'm having is that the 2 step counters for each stream of triggers (8ths, 16ths) don't seem to be consistently lining up as they should. I tried sending a reset to the phasor when starting the sequencer (transport), but that didn't seem to work either. Possibly related - sometimes the swing of the 8th notes seems to work "backwards" (i.e. it moves the second of each pair of 8th notes earlier in time rather than later).
A secondary issue is anytime I increase the value of the live dials controlling the swing amount, it causes the "what" objects to send a rapid succession of triggers.
I'd be most thankful for any advice in getting the swing to work here :)


to swing, one delays off beats by swing amount.
you do that rather at counter output, not by creating another counter.
split even and odd numbers and then
Swing me baby, swing me all night long ... ♪ ♪ ♪ ♪

transport phasor~ subdiv~ swing~ what~ change~ edge~ counter noteout. hilarious.
'the band is ON tonight baby!
jazz is not about the right notes, it is about having fun!
Thanks for this - I learned a lot spending a few hours modifying it to fit my patch. A couple of delay and pipes, maybe not ideal. That aside I have one final problem which is that when I use the random pattern for the sequencer counter, the swing breaks.
Is there any way to solve that without scrapping most of this? Or if not, other suggestions on how to build this so that random can work? Sorry if it's obvious but my brain hurts after several hours looking at this :)
Also any other general suggestions on things I could have done better are most welcome. Thanks again!

it is wrong what you are doing.
if you want to pick whatever numbers from the stream,
route them and add pipe amount to match them.
and use single pipe object
that if objects are also wrong.

as first you match 1 instead of 0.
what for is else out2 left in there ?
nothing against else out2, but he forgot to use it.
I understand yes - using route could be a good alternative to what I did.
I don't see how that can fix the problem with the swing pattern getting messed up when the sequence is "random" . Is there any advice on how to solve that?
if a sequence is "random" you can re-apply an index number to its content which again represents the beat numbers sorted by time.
1 4, 2 3, 3 1, 4 1...
if it still has all beats no rests/ including rests) you can just [prepend] values from a new [counter] to it for that purpose ... or maybe you have even kept the original step numbers from before ...
I would like it to work even when changing the number of beats or removing some notes (rests) from the sequence. So it doesn't sound like that will be a good solution for me.
Just to clarify I would like the swing pattern to stay in multiples of 4 and remain a consistent rhythm even if there are odd numbers of beats or rests (the rest would not be played but the swing pattern should still advance to the next timing offset on the following note).
I don't understand what should be random, and anyway
that swing stuff is so outdated in my eyes.
it is only notation form, so that one does not need to write that many triplets
or tupplets for simplest form of "swing".
using delay allowes only 1 2 3, which is totally boring in "swinging" step sequencer
how do you 1 2 3 ?
but anyway ...
you might want random pitches, random note lengths, random rhythm ...
what is it exactly that you want ?
if you have a steady stream of numbers, say 16
you can delay any of them after they get received
no matter when and what they trigger.
if you use pipe, flush it before retriggering it.
delay does it if new input arrives before output
Just to clarify I would like the swing pattern to stay in multiples of 4 and remain a consistent rhythm even if there are odd numbers of beats or reststhis is known as
very confusing
from a composer standpoint
//
forget the swing for a minute, that is just a feel
as source audio said... lets look at 1 . 3 1 . 3 1 . 3
What do you consider ODD numbers of beats to be?
(the rest would not be played but the swing pattern should still advance to the next timing offset on the following note).Do you want polymeter?
Or sounds link you want to have 2 voices, 1 voice is steady swing pattern, 2nd voice is random amount of beats, and if is less or more than 1 basic swing measure, the extra space gets filled in with rests?
I am not going to look at your patch because all I do all day is create crazy mixtures of polymeter and polyrhythm, whatever you are doing is a total mess
//
ALWAYS pretend your computer music is a person NOT a computer when making music as you mentioned 'Swing)
What is happening then? and how many people does it take to make it happen? (you can always go faster and further and more crazy later with computer
but you need to be able to create and explain what you want to do in simple baby terms. then walk. then run.
I'm sorry if it was confusing or unclear.
Firstly to clarify @source audio, by random I am referring to the random counter object in the patch, which is simply randomizing what steps are fetched from the multislider. But nevermind that because the swing pattern also becomes irregular on any of the counter patterns other than "up"
@wil I'm not looking for two voices. I'd like to have (rhythmically) a 4 step figure, decided by two individual adjustable delay amounts. One of these would apply to the even steps of the 4 step pattern (I'm calling this 16th swing), and the other would apply only to the 3rd step of the 4 step pattern (I'm calling this 8th note swing).
The sequence length should be irrelevant to the rhythmic pattern. So if it's 7 steps for example, the rhythm of the 7 note pattern will change each time until 28 steps have occurred. Because 7 note steps x 4 rhythm steps = 28
This should now be more clear- I like your idea that you should be able to explain it as if you are working with real musicians, but in this particular case I think that would just make it even more confusing :')
you should ask yourself what the scrambled numbers should represent now, when they represented "beat" before the were scrambled.
which lead us to en even easier solution (if you dont want to try my last suggestion):
you could use the masterclock / original non-scrambled sequence in parallel to the scrambled one to set up the delay times for [pipe] right before needed by the events coming into it.
the "swing" will in this case permanently be calculated, even if nothing plays.
So I could just send the sequence note numbers to the right inlet of a single message box, have the swing counted by a separate counter, and have the bangs from the pipes going to the single message box. I would use the same gate coming from the matrixctrl to dictate when a bang comes through to the message box or not... I think this would work but can't test right now. But thanks again hopefully I'm getting closer to a solution!
I again don't manage to understand this.
Again, you have a stream of numbers, which are steady.
You want to randomise which index in a list,
or multislider ... whatever, input numbers trigger.
so that for example count 1 is not fixed to 1st index in the list, but can become 13 , by gambling.
What does that have to do with delaying specific number from input stream ?
same as for beat count.
you run 16, but want to reduce it to 7 steps at output, but input allways
runs through same "swing" pattern.
run 0 - 15 count through % 7 ,
link "swinged" steps with input, NOT output count.
you can also limit and offset it, like 5 ~ 11, or 3 ~ 14
here one example using rslider:

I think I have this working well now! Thanks to everyone for the help. It was really simple once I realized what needed to happen. All the suggestions were very valuable.
@source audio - sorry it's still confusing. I admit it's a bit complicated and I may not have done the best job explaining it. It comes from the idea of a "clock-swing" that exists on an Organelle (pure data based) patch that employs swing at the clock level. The swing beat stays consistent regardless of anything else that happens. Hopefully it's more clear now that I've simplified and completed the patch! By the way thanks for the idea of the limit/offset - that's really cool! I will incorporate that for sure now that I have everything else working :)
I'll post the full patch here so that anyone looking might benefit from it in the future.
Thanks again everyone!!!

edit: for anyone seeing this in the future "ms-per-count" should actually be labeled "ms-per-beat"