Hi,
I don't know, if that has been implemented by someone already. Just in case it hasn't, the attachment contains a display of standard midi keyboard highlighting pressed keys.
It contains global sends and receives so only one instance of it can be used in a session. If someone has an idea how to implement this with localized sends and receives without using makesymbol or other non-native pd objects, let me know.
Nice extensions would be to reflect velocities with shade and display different midi channels with different colors, but I could never figure out pd's coloring scheme. Maybe a nice exercise for the reader?
-- Orm
On Tue, 22 Feb 2005, Orm Finnendahl wrote:
Nice extensions would be to reflect velocities with shade and display different midi channels with different colors, but I could never figure out pd's coloring scheme.
It's not too hard, but it's a little annoying to use.
Pd's first colouring scheme is the numbers from 0 to 29 corresponding to the 30 colours you see in some property dialogs.
The second colouring scheme is more interesting. You have three separate channels (RGB) and each channel goes from 0 to 63. You multiply them by (1,64,4096) respectively and you add them. Then, to distinguish them from the other colouring scheme, you substract that value from -1.
There's an alternate version of the second scheme using values ranging from 0 to 255 and the constants (1,256,65536); that's 24-bit colour instead of 18-bit. This one gets used in runtime configuration (sending "color -256" to a [hsl] makes it turn blue) while the other second scheme is used in saving colours.
Note that although Pd floats are exactly precise enough for this last colour system, you can't store those colours as-is in your patch because the .pd file encoder starts dropping digits at smaller numbers than that (argh) so you have to save them decomposed and recompute them at load time.
(now don't ask me why it's like that...)
Things become alot easier once you have an abstraction that does the computation for you.
Mathieu Bouchard -=- Montréal QC Canada -=- http://artengine.ca/matju