Does anyone know if there already exists a Maxforlive sequencer that only advances steps when a midi note is received?

I’d like a sequencer that I can clock with very irregular clocks and I have never really managed to build a working patch myself so creating this seems daunting.

Check out Live.Stepper, which works in that way, sort of like the SH-101 sequencer:

https://maxforlive.com/library/device/2433/live-stepper

2 Likes

Did you get an answer yet? I haven’t dug into 3D stuff in a while, but I’ve used poly~ for jitter in multiple use cases and it’s worked well. The method depends on what you’re doing with the models – there’s jit.gl.multiple and Poly~. These Claire Steger tutorials on jit.gl.multiple really helped me when I was doing more of this stuff. IIRC jit.gl.multiple loads copies of the same model that can then be manipulated individually (i.e. particles and stuff) whereas poly~ might be better suited for an arbitrary number of unique models. Feel free to report back what you find!

i ended up getting it working in JS ! i had to do some tricky vector / quaternion math on each model too that i think i felt a little more comfortable doing in js anyway, so i think it worked out. good to know about those techniques tho ! i kind of forgot that there wasn’t any reason that poly~ wouldn’t work for this

edit: here’s what I made :rainbow:

4 Likes

Surprisingly, this would actually be an excellent first patch to attempt, as live.step does all the heavy lifting.

  1. Create a Max MIDI Effect
  2. Add a live.step object. To create this, hit “n” to create a new object and type “live.step”.
  3. Add a “next” message. To create this, hit “m” to create a message and type “next” (without quotes).
  4. Optionally, add a “reset” message as well.

You can already test this sequencer visually by clicking on the messages when the patch is locked. To add MIDI output:

  1. Create an “unjoin 6” object (not message). This breaks apart a list to six outlets. The first live.step outlet is a list providing index, note, velocity, duration, extra1, and extra2.
  2. Plug outputs 2, 3, and 4 from unjoin into makenote’s inputs. These are note, velocity, and duration.
  3. The midiformat object prepares messages for output. It expects a pitch + velocity list. So, add a “join 2” object to pack makenote’s outputs up and send that list to midiformat’s first input. Connect midiformat’s first output to midiout and you’re good to go.

image

The input is slightly more complicated:
image

  1. midiparse breaks down incoming MIDI messages into multiple outlets. The first outlet is a note/velocity list. We can assume that all “Velocity 0” messages are note offs, so we want any non-zero velocity.
  2. We use “unjoin 2” to break that list into separate note and velocity outputs.
  3. We then use a “route” object, which routes an input to different outputs depending on value matching. Here, we say “route 0” to route all velocity 0 (note off) messages to the first output. Thus, the second output is presumably all note on messages.
  4. We attach this to the “next” message.

At this point, the sequencer is good to go. It takes an MIDI Note On message to advance the sequencer.

Next steps:

  1. Make “next” respond to a specific MIDI note and “reset” to another. Use route to match pitch information…
  2. Add different behaviors for different MIDI notes. Maybe have a certain pitch advance the step sequencer by 2 or 3, or backwards by 2 or 3. You’ll need to use the “counter” object for this and replace the “next” message with a “step $1” message.

EDIT: I saved it as an M4L object with presentation mode if you want to hack it from there: https://www.dropbox.com/s/hhrty53a7iztbcu/ManuallyClockedSeq.amxd?dl=0

DOUBLE EDIT: I highly, highly recommend buying this book, which is all about hacking the live.step object for more advanced behaviors: https://cycling74.com/products/books

10 Likes

@trickyflemming

You are a hero. Thanks for the file link. The book looks quite useful too.

I will be honest and say that most of that post makes so little sense to me hence why I have only ever used devices built by others. It is likely being on the receiving end of the conversation I had with an elderly aunt about what FaceTime is. :wink:

1 Like

It’s a daunting language at first. I’d hold off on Step by Step, as it is more of an intermediate level book. If you open up Help->Max Reference, the most important steps would be knowing bang, messages, and lists. Alternatively Max MSP Jitter For Music by VJ Manzo would be a solid first step.

Quick breakdown, top-to-bottom:

midiin - All MIDI from Live (CC, Notes, etc.)
midiparse - Object to help break complex MIDI messages down to more relevant bits, in this case pitch and velocity.
unjoin 2 - Breaks a list down into two components. In this case, pitch and velocity.
route 0 - If the input is 0, send it to one outlet. If not, send it out the other.
next/reset - Max messages. These are text instructions sent to objects generally to trigger a type of event or to set a parameter value.

live.step - huge compound object dedicated to monophonic step sequencing. Has pitch, velocity, duration, two “extra” parameters, and a loop brace.

unjoin 6 - Breaks a list down into six components. In this case, index, pitch, velocity, duration, extra1, and extra2.
makenote - This object takes arguments for pitch, velocity, and duration. It generates a MIDI note with note on and note off messages.
join 2 - This takes makenote’s output (pitch and velocity) and coverts it into a two-item list, which is the required input for midiformat.
midiformat - This is sort of the inverse of the midiparse object at the top of the patch. This takes simple values and converts them into the more complicated MIDI message.
midiout - This is the MIDI output back to Live.

One cool aspect if you’re learning Max: Alt-clicking on an object will pop open an interactive help patch with a more detailed description along with patch examples.

2 Likes

I’m determined to learn some max basics during lockdown and these posts are very helpful. I think starting with grid studies was a mistake for me, they’re obviously great tutorials but as someone who’s not very technical I found it very intimidating. Maybe playing with some midi is a safer intro. Thanks for breaking it down so clearly.

Heads-up: the Kadenze course mentioned earlier in this thread is starting again tomorrow: https://www.kadenze.com/courses/programming-max-structuring-interactive-software-for-digital-arts/info

6 Likes

Fwiw I think a mixed approach to learning max is a good thing.

I’ve spent an equal amount of time:

If something feels too complex it can be worth just moving on and coming back to it.

Gregory Taylor’s LFO tutorial is one of my faves: https://cycling74.com/tutorials/lfo-tutorial-1-the-zen-of-the-silent-patch - so much clicked into place for me with that one.

8 Likes

and it works very well. i need to do something with it for my students whiff we return to brick and mortar studio

Am i confounding this idea with Barry Truax’s acoustic ecologies idea?

Hi, I have two input sources. I want to be able to push a toggle button and have one of the inputs sent to the output, depending on the state of the toggle. I’ve tried switch, select, pak, and other things to no avail. This is sorta stressing me out because of how simple it is.
Thanks.

Try gswitch:

Thanks I’ll try it. (extra text cause posts have to be 20 characters)

My previous message was a bit terse as I wrote it at 3 AM from the cell phone after getting woken up by the baby :laughing:

Okay, more detail:

“switch” will do what you want, but it requires an extra step. You’ll need to put a “+ 1” object between the toggle and the switch selector. State “0” is completely off (https://docs.cycling74.com/max8/refpages/switch), so you want states “1” and “2” for your two inputs. The advantage of switch over gswitch is that you can do more than 2 inputs.

“gswitch” is a quicker (and visual) solution for your problem, since it always allows one of the two inputs and it expects a toggle. It only permits two inputs, though.

Even though I’ve used Max for years, I still occasionally do the “wait, what’s that object called?” dance. Two fast ways to find what you’re looking for:

  1. Find an object that’s close to what you need. Open its reference or interactive help (alt-click on the object when unlocked). Look at the “See Also” section to find related and similar objects.
  2. The object thesaurus: https://docs.cycling74.com/max7/vignettes/thesaurus
3 Likes

Thank you for your advice. I followed it, but it unfortunately did not work. I have attached a video detailing the problem I am having when I use the toggle switch. This may have more to do with the inputs to the switch device than the method of switching. Using the toggle switch does not send the corresponding input to the output, unless the message is clicked on or the value of the number box is changed.

Also excuse the granulizer thing haha

1 Like

ah! [switch]'s switcher inlet is cold (basically, a change is stored), whereas the other two inlets are hot (changes are immediate). when you toggle the [switch], it’s saying “okay, I know that the next time I get something through one of my hot inlets, I should switch.” so, you need to then execute a change on one of those hot inlets to actually see the output switchover.

try replacing with this

----------begin_max5_patcher----------
482.3ocuUtsaiCBDF9Z6mBD2tdiL9Tb6qRUUENA4kJGvBvsYUUe2WXvdS1sN
Iz5jdCHFOd94ClY3s3HbibOSiQ2id.EE8VbTDXxYHZbcDdGc+lNpFbCKF10v
T3D+m5olM+hKZeRw1X7ggTc2pzDTdQgapL0MlksJE833+XifbvzwLP.yFsx2
BgW177OIYSg26m428Lerw3DDtgJZw+MZ8TEcGyvTOwDzlNvwzCJwESBQb1dO
N1MjDHr6XZMskMscLr8.j3pyve1ZhG4JX5tUkmkexL7mdZ9ONJGXK6JxV44X
KuZgrU+cflf8pUqOP1OPjKm2t.1pNIabg41imA0f3WFPRMIH.movr7j.B0jI
mCzuR4mQ111wB.oB+cVwzX32Y4gcmcS6xbh6S8qbKvAjwtt1Msd8E5zNWmlO
a0X9Q3Adf63h++ADXq5r+uLqkCpMSweLcBcXytkoMbA0vkhi7w0K7Hmjps1G
ebG9ydNeMUtddgIKVXxEDtxK7hzoJji1qfNjPzI6ZHTZfDksPgpCTGxB0IO.
cJ+vAmuli12+BSoGcFjv1Q4YIjfVm.K4B+RnpGqXuvm7OGrPU11IFaujAErs
v6qJv9eUZS0EC7wrcKbVIgtUBaOPcO0yAzTK983+.v3IXgG
-----------end_max5_patcher-----------

…which uses a [t b i] from the [toggle] to:

  • first, pass the integer (1/0)
  • then execute a bang after, which is connected to the other two numbers/messages

[t b i] (and variants) cascades its output, so you always get the rightmost argument first, then the one to its left, then the one to its left, etc etc. it’s perfect for situations where you want to execute a change on a cold inlet immediately.

please lmk if this helps!

5 Likes

Thank you so much! This certainly helped.

1 Like

is anyone aware of MSP object(s) for computing the sliding average and/or range of a signal? (not minmax~, which requires an explicit reset)

if not i’ll make one

Is what avg~ does different to sliding average, or can you get it with rampsmooth~ in front?