Midi Note Name to Number

Greg Cerveny's icon

Is there a way to store MIDI Note Number strings?

I would prefer to have lists like "C3 E3 G3" rather than "60 64 67".

I see that I can change the display format of a number object to display the midi note value.

Perhaps there is an object that takes in a string "C3" and converts it to 60?

Floating Point's icon

for problems like this it's always worth checking out maxobjects.com:

http://www.maxobjects.com/?v=objects&id_objet=1543&requested=midi%20note%20name&operateur=AND&id_plateforme=0&id_format=0

Peter Ostry's icon

I don't know an object that does it.
You could use [coll] or [umenu] for translation.

double_UG's icon

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

Greg Cerveny's icon

Cool. Thanks all, this gives me some stuff to get started with.

ben sonic's icon

another approach with nslider

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

ben sonic's icon

and this version works with either single names or lists

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

jrs1's icon

in case it's useful, here is the reverse. Takes a midi note number and converts to string

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

Source Audio's icon

There is no sense displaying note names if they don't
match the note numbers.
Middle C= C4 / midi note 0 = C-1 that is real notation
Middle C= C3 / midi note 0 = C-2 that is wrong numbering
introduced by midi gear ...
P.S. @ JRS1
coll should start with id 0, not 1,
otherwise it will display wrong notes

Roman Thilenius's icon


#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 144 180 50 9109513 + 1;
#P message 69 348 50 9109513 A2;
#P newex 69 316 88 9109513 prepend set;
#P newex 69 118 160 9109513 t b i i;
#P newex 69 262 160 9109513 sprintf %s%s;
#P newex 323 170 67 9109513 loadbang;
#P newex 323 202 246 9109513 list C C# D D# E F F# G G# A Bb B;
#P newex 69 222 85 9109513 zl nth;
#P user incdec 36 65 15 15 0 0;
#P number 69 65 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 219 180 50 9109513 - 1;
#P newex 219 149 50 9109513 / 12;
#P newex 144 149 50 9109513 % 12;
#P connect 3 0 4 0;
#P connect 4 0 3 0;
#P connect 3 0 9 0;
#P connect 6 0 5 0;
#P connect 9 0 5 0;
#P connect 5 0 8 0;
#P connect 8 0 10 0;
#P connect 10 0 11 0;
#P connect 9 1 0 0;
#P connect 0 0 12 0;
#P connect 12 0 5 1;
#P connect 9 2 1 0;
#P connect 1 0 2 0;
#P connect 2 0 8 1;
#P connect 7 0 6 0;
#P window clipboard copycount 13;

Michael's icon

Is there any way to do the opposite of this operation? I'd like to convert a list of numbers into a list of note names.

Source Audio's icon

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

Dan Laüt's icon

Here a way using zl.lookup:

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