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!
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).
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’ attribute 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. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 673.3ocwV00jaBBE8Y8WACSeLMiPTi1mR+czoyNjHaV1pfifoY6N6+8xWIwr MIZ1539BBWtb43gy8BuFF.WK1SkPv2.+.DD7ZXPf0jwPfeb.rhreSIQZcCxo +Vr9Y3L2TJ5dk0bofTTQkRPZzg4DspRpR8RM0EeHD7S+TOJ3JI6O1IP34Qdy 71JFWuF6NgNYzEoyrVSTadhw29PCcixE+XTpNRfDa6xbSKNZdzwMkUXQpF8e Ek.6fDNoxhD32aXjRnYh2BCMMyFHo7XoPCS3Qr0ninh17.kSVWZicz0HE8RI J3L.bMgucLXH70YHbTlkUbDUVzMon3wkhthtoh7KJWnn5exkvd4HWm6hjVbu jDxFI.N1ROHTxMYI7HyRsUqoMeHgDiOUxHTtkgxrhojaqhPiK+XJwP1R+GYj hVUK.eAMR0dv2asGOk30NoH6frKyI4SRh0wBxIex0iQKbEjw2RmrbR3DUCgK qEMJvJyd.pdwpaf8jR4+7tpPc6bIuFCEWd+JNG6hb25cM5Mcbo21JJu8+oH0 f3Gl9vw+zDHhaVxLSClWzo+wtwmYV0w9wtYcbItiKYcc4jYTJua+N26Lf7hE 8exk5peht0AWxzkWTRz2Bu5TJhO4.rhwAlan2QJaoRvJ8OInR+sjIUTN.8YU dw+XFOatHM9l2CMLdztTXIi+92Da2ei8yIWonsYyg+W+9.NAfBpTw3DESv65 S7YN8Dqnfx6l0TvjlDIK5it3o7PgiV9.P8AmICMlWc2O6zGdpXE0BccD+ITL NYdh9wHHSKNBcXvosY7ve7Pvu9Eg.7zvmCQskOYGu4C.MoSFZVN.zj7gjZnz tZM6ndEatBKj55czFoGDVnqqO+rnwLLclcHi6FZw.rgticv+3PSzdK7ut0vn pB -----------end_max5_patcher-----------
Good stuff, that’s really helpful. Thank you!
Forums > MaxMSP