Simple question about makenote object

Mar 17, 2012 at 8:27pm

Simple question about makenote object

I’m working on a project, part of which needs to generate MIDI notes of varying length (quarter notes, eighth notes, sixteenth notes etc).

I’m using a [metro] object to generate ticks that drive a [transport] object, and feeding the units from the transport into a [counter] to make things happen at various points within the beat.

I can trigger events well enough, it’s working fine, but I want to vary the duration parameter of the [makenote] object so that when I play a quarter note (for example) the tone sounds for the duration of a quarter note.

I can see that you can do things like [makenote 124 4n] to generate a quarter note, but the duration of this note appears to be determined by the master transport and I want it to be determined by a named transport.

My question is, how do I make the duration of the note generated by [makenote] correlate to the tempo in my named transport. To put it another way, when my named transport has a tempo of 60, the duration of the quarter note generated by [makenote] should be double the duration of a quarter note generated by [makenote] when my named transport has a tempo of 120.

Any thoughts would be welcome!

#62445
Mar 17, 2012 at 10:35pm

You can calculate the duration (msec) of a quarter note from the tempo, using the formula 60000/BPM.
For other note values multiply with a corresponding factor (eg. 0.5 for 8th notes).

#225568
Mar 17, 2012 at 11:56pm

Or you can use the translate object to provide the ms equivalent for whatever note value you specify.

IMHO, the makenote object should have a ‘transport’ object like all the other tempo-relative objects, and the lack of it is almost worthy of a bug report (or at least a frowny face). But the translate object does have a ‘transport’ attribute, so you can use it and get the same effect.

– Pasted Max Patch, click to expand. –
#225569
Mar 18, 2012 at 7:28am

Good stuff, that’s really helpful. Thank you!

#225570
May 20, 2013 at 1:01pm

Pinging this thread to agree with Christopher Dobrian. Although there are workarounds an @transport attribute for [makenote] would be most welcome.

#249970

You must be logged in to reply to this topic.