A simple script to loop through .wav files in a directory named with scientific pitch notation and rename the .wav files to the midi number corresponding to the note name.
Installation
git clone https://github.com/devegoo/midi-note-name-to-number.git
cd midi-note-name-to-number/
sudo su
chmod +x install.sh
./install.sh
command to rename samples :
cd /to/samples/dir/
nametonote
accepted file names for example :
C0.wav
c#0.wav
....
Full list with coressponding numer names:
"C0" : 0, "C#0" : 1, "D0" : 2,
"D#0" : 3, "E0" : 4, "F0" : 5,
"F#0" : 6, "G0" : 7, "G#0" : 8,
"A0" : 9, "A#0" : 10, "B0" : 11,
"C1" : 12, "C#1" : 13, "D1" : 14,
"D#1" : 15, "E1" : 16, "F1" : 17,
"F#1" : 18, "G1" : 19, "G#1" : 20,
"A1" : 21, "A#1" : 22, "B1" : 23,
"C2" : 24, "C#2": 25, "D2" : 26,
"D#2" : 27, "E2" : 28, "F2" : 29,
"F#2" : 30, "G2" : 31, "G#2" : 32,
"A2" : 33, "A#2" : 34, "B2" : 35,
"C3" : 36, "C#3" : 37, "D3" : 38,
"D#3" : 39, "E3" : 40, "F3" : 41,
"F#3" : 42, "G3" : 43, "G#3" : 44,
"A3" : 45, "A#3" : 46, "B3" : 47,
"C4" : 48, "C#4" : 49, "D4" : 50,
"D#4" : 51, "E4" : 52, "F4" : 53,
"F#4" : 54, "G4" : 55, "G#4" : 56,
"A4" : 57, "A#4" : 58, "B4" : 59,
"C5" : 60, "C#5" : 61, "D5" : 62,
"D#5" : 63, "E5" : 64, "F5" : 65,
"F#5" : 66, "G5" : 67, "G#5" : 68,
"A5" : 69, "A#5" : 70, "B5" : 71,
"C6" : 72, "C#6" : 73, "D6" : 74,
"D#6" : 75, "E6" : 76, "F6" : 77,
"F#6" : 78, "G6" : 79, "G#6" : 80,
"A6" : 81, "A#6" : 82, "B6" : 83,
"C7" : 84, "C#7" : 85, "D7" : 86,
"D#7" : 87, "E7" : 88, "F7" : 89,
"F#7" : 90, "G7" : 91, "G#7" : 92,
"A7" : 93, "A#7" : 94, "B7" : 95,
"C8" : 96, "C#8" : 97, "D8" : 98,
"D#8" : 99, "E8" : 100, "F8" : 101,
"F#8" : 102, "G8" : 103, "G#8" : 104,
"A8" : 105, "A#8" : 106, "B8" : 107,
"C9" : 108, "C#9" : 109, "D9" : 110,
"D#9" : 111, "E9" : 112, "F9" : 113,
"F#9" : 114, "G9" : 115, "G#9" : 116,
"A9" : 117, "A#9" : 118, "B9" : 119,
"C10" : 120, "C#10" : 121, "D10" : 122,
"D#10" : 123, "E10" : 124, "F10" : 125,
"F#10" : 126, "G10" : 127
"c0" : 0, "c#0" : 1, "d0" : 2,
"d#0" : 3, "e0" : 4, "f0" : 5,
"f#0" : 6, "g0" : 7, "g#0" : 8,
"a0" : 9, "a#0" : 10, "b0" : 11,
"c1" : 12, "c#1" : 13, "d1" : 14,
"d#1" : 15, "e1" : 16, "f1" : 17,
"f#1" : 18, "g1" : 19, "g#1" : 20,
"a1" : 21, "a#1" : 22, "b1" : 23,
"c2" : 24, "c#2": 25, "d2" : 26,
"d#2" : 27, "e2" : 28, "f2" : 29,
"f#2" : 30, "g2" : 31, "g#2" : 32,
"a2" : 33, "a#2" : 34, "b2" : 35,
"c3" : 36, "c#3" : 37, "d3" : 38,
"d#3" : 39, "e3" : 40, "f3" : 41,
"f#3" : 42, "g3" : 43, "g#3" : 44,
"a3" : 45, "a#3" : 46, "b3" : 47,
"c4" : 48, "c#4" : 49, "d4" : 50,
"d#4" : 51, "e4" : 52, "f4" : 53,
"f#4" : 54, "g4" : 55, "g#4" : 56,
"a4" : 57, "a#4" : 58, "b4" : 59,
"c5" : 60, "c#5" : 61, "d5" : 62,
"d#5" : 63, "e5" : 64, "f5" : 65,
"f#5" : 66, "g5" : 67, "g#5" : 68,
"a5" : 69, "a#5" : 70, "b5" : 71,
"c6" : 72, "c#6" : 73, "d6" : 74,
"d#6" : 75, "e6" : 76, "f6" : 77,
"f#6" : 78, "G6" : 79, "g#6" : 80,
"a6" : 81, "a#6" : 82, "b6" : 83,
"c7" : 84, "c#7" : 85, "d7" : 86,
"d#7" : 87, "e7" : 88, "f7" : 89,
"f#7" : 90, "g7" : 91, "g#7" : 92,
"a7" : 93, "a#7" : 94, "b7" : 95,
"c8" : 96, "c#8" : 97, "d8" : 98,
"d#8" : 99, "e8" : 100, "f8" : 101,
"f#8" : 102, "g8" : 103, "g#8" : 104,
"a8" : 105, "a#8" : 106, "b8" : 107,
"c9" : 108, "c#9" : 109, "d9" : 110,
"d#9" : 111, "e9" : 112, "f9" : 113,
"f#9" : 114, "g9" : 115, "g#9" : 116,
"a9" : 117, "a#9" : 118, "b9" : 119,
"c10" : 120, "c#10" : 121, "d10" : 122,
"d#10" : 123, "e10" : 124, "f10" : 125,
"f#10" : 126, "g10" : 127