Max servo control robot drummer

Tommy DOG's icon

I'm rusty as hell here and I'm trying to figure out how to be able to have 4 solenoids moving. one tied to keep in time with the metro like a metronome, the rest randomly on and off.

The issue is completely a me being rusty and forgetting how to deal with the data pre makenote.
If someone could look t the code and maybe point out the obvious, it would be appreciated.

Tommy

interface-beta.maxpat
Max Patch
Rodrigo's icon

Do you mean solenoids (on/off) or servos (position data)?
From the patch it looks like you're randomly setting one 4 servo positions each 1.5seconds.

So it's possible that each servo might not move for a long time.

Either way, I would probably break out each servo into its own data path, so its easier to read the state if nothing else.

Max Patch
Copy patch and select New From Clipboard in Max.

Perhaps this helps (it kind of does what I think you want, with control over the probability of each additional servo changing).

Tommy DOG's icon

Thanks Rodrigo,

I will take a look at what you did. Thank you for that.

I've actually used solenoids for this sort of thing but they are indeed servo motors.
I think you expressed the crux of my problem, I do need to break up the data into 4 or 5 stems BUT because I am so out of practice I can't figure out where to make that change and then how to bring it all back together and output.

I hope this clarifies.

Tommy

Rodrigo's icon

Yeah if that's the case I would do it something like what I did, have a 'top level' bang/metro/whatever, then a stem for each solenoid you want to control.

Probability is a good way to handle it if you want each solenoid to trigger only sometimes but still have its own random data. You could make it more elegant by having a fade time between each position so it moves to the new position over the period of time between teach change.

Another improvement would be to time to see how long it takes the solenoid to move around, and then build that latency into the patch, so if it takes 500ms to move 360degrees, then make sure you trigger 125ms early if you want it to move from midi values 32 to 64.

Tommy DOG's icon

Thanks.
I see what you've done. It makes sense, though I have to play around with it and see.

I will have to see if I can essentially make one motor the constant dominant movement and have the others work at fractions of the metro.

The way the fader works in the original patch controls how much the movement the motor makes.

Rodrigo's icon

If that's the case you should look at metro using 4n 8n arguments. I've not actually used it, so can't comment or help out, but it's designed to do exactly what you want (subdivision to a master clock pulse).

Or you can look at rate~/phasor~ if you want to step into the signal domain.

Tommy DOG's icon

In the original patch I am able to use the fader to change the range one the rotation o the servo motors (currently assigned to #2) but I haven't figured out how to do that so that each motor has that as an individual option. So 4 channels, each with fader control so I can spot adjust the motors each time I set up.
-the robot stands in front of percussion so the arms are adjusted depending on what 4 things he's banging on.

I appreciate the help, it been so long since I've worked with MIDI in max and mathematics are very much a weak point.
Tommy

interface-beta3.maxpat
Max Patch
image1.jpeg
jpeg
Rick's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Here's an example of the n arguments Rodrigo was talking about and I also threw in a way to use makenote to return the servo to zero. HTH

Tommy DOG's icon

Thanks Rick, that's really useful and I dare say even musical.
I very well may use some of that.

I'm still a bit lost in terms of the handling of the multiple channels going into the notein in terms of whether I need to parse them in some way. But I'm slowly getting back to understanding the generation of the notes and will make some subpatches.

Tommy

Tommy DOG's icon

Okay, as I break apart this project into segments I keep coming into new areas I've completely forgotten.
I have the beginning of a note order chooser. The premise being that one clicks get's a group of notes and that plays as a loop.
What I haven't figured out is what goes next. does it go straight into a noteout object?

Tommy "the rusty one" Dog

list-order-chooser.maxpat
Max Patch
Rick's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Naw you need some kind of playback to feed the noteout. There are lots of ways of creating that, here's a couple of simple ones.

Tommy DOG's icon

Thanks for that.
I have to start consolidating parts into subpatchers and seeing if I can replaces parts of the original patch which did at least work in the basic sense.

Tommy

Tommy DOG's icon

It seems the two sketches I have screwed with enough to get a sense of whether they will work are both from Rick. Since I haven't noticed any contact info, please feel free to get in touch so I can give credit where credit is due.

I am still having some difficulty replacing the elements of the old patch with the "Rick" version of the output section.

interface-beta4.maxpat
Max Patch
rick-edit.maxpat
Max Patch
Rick's icon
Max Patch
Copy patch and select New From Clipboard in Max.

See if this gets you a bit closer.

Tommy DOG's icon

Aww, thanks man.
yeah, the bits are making sense and I can get them tightened up.
It's strange to be so out of practice that I'm hitting the wall on the basic stuff but impetus to push through will prevail.
Tommy

Tommy DOG's icon

I have continued the hunt and peck method of trying to fine tune this patch but certain things allude me.

1. The fader that specifies stages of movement needs to have some slight variation and I haven't found a range small enough that works.

2. The area "patcher note chooser" isn't quite right. I'd like to be able to click to choose 4 notes between 0+5 in a "random" order and then when I hit play I have those notes looping unless I re-tap that button.

I hope this makes sense and I appreciate all the help and support Ive received. If anyone is doing anything like this in NYC and wants to trade notes, share tools whatever please feel free to get in touch.

Tommy

interface-V2-beta-4.1-note-1.maxpat
Max Patch
Rick's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Does this work for 2?

Tommy DOG's icon

Thanks Rick that gave me some ideas.
Unfortunately Ive run into a situation where I have to rethink how the servos are physically set up because the current way they are being used to too hard on the motors and they are dying in the field.

I again appreciate the help and I hope that there are people learning something from my mistakes.
Tommy