diff util/matlab_midi/midi2freq.m @ 81:a30e8bd6d948

matlab_midi scripts
author Ivan <ivan.damnjanovic@eecs.qmul.ac.uk>
date Mon, 28 Mar 2011 17:35:01 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/util/matlab_midi/midi2freq.m	Mon Mar 28 17:35:01 2011 +0100
@@ -0,0 +1,12 @@
+function f = midi2freq(m)
+% f = midi2freq(m)
+%     
+% Convert MIDI note number (m=0-127) to 
+% frequency, f,  in Hz
+% (m can also be a vector or matrix)
+%
+
+% Copyright (c) 2009 Ken Schutte
+% more info at: http://www.kenschutte.com/midi
+
+f = (440/32)*2.^((m-9)/12);