📄 mid2note.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><html><head> <title>Description of mid2note</title> <meta name="keywords" content="mid2note"> <meta name="description" content="mid2note: Mid to note transformation"> <meta http-equiv="Content-Type" content="text/html; charset=big5"> <meta name="generator" content="m2html © 2003 Guillaume Flandin"> <meta name="robots" content="index, follow"> <link type="text/css" rel="stylesheet" href="../m2html.css"></head><body><a name="_top"></a><div><a href="../index.html">Home</a> > <a href="index.html">melodyRecognition</a> > mid2note.m</div><!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png"> Master index</a></td><td align="right"><a href="index.html">Index for melodyRecognition <img alt=">" border="0" src="../right.png"></a></td></tr></table>--><h1>mid2note</h1><h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>mid2note: Mid to note transformation</strong></div><h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>function note = mid2note(mid, timeStep) </strong></div><h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="fragment"><pre class="comment"> mid2note: Mid to note transformation
Usage: note = mid2note(mid, timeStep)
mid = [semitone1, semitone2, ...] at time unit of timeStep
(Default value of timeStep is 1/16 second.)
note = [semitone1, time1, semitone2, time2, ...] with time
unit of 1/64 second</pre></div><!-- crossreference --><h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>This function calls:<ul style="list-style-image:url(../matlabicon.gif)"></ul>This function is called by:<ul style="list-style-image:url(../matlabicon.gif)"></ul><!-- crossreference --><h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function note = mid2note(mid, timeStep)</a>0002 <span class="comment">% mid2note: Mid to note transformation</span>0003 <span class="comment">% Usage: note = mid2note(mid, timeStep)</span>0004 <span class="comment">% mid = [semitone1, semitone2, ...] at time unit of timeStep</span>0005 <span class="comment">% (Default value of timeStep is 1/16 second.)</span>0006 <span class="comment">% note = [semitone1, time1, semitone2, time2, ...] with time</span>0007 <span class="comment">% unit of 1/64 second</span>0008 0009 <span class="comment">% Roger Jang, 20001209</span>0010 0011 <span class="keyword">if</span> nargin<20012 timeStep = 1/16;0013 <span class="keyword">end</span>0014 prev = mid(1);0015 time = 1;0016 note = [];0017 <span class="keyword">for</span> i=2:length(mid),0018 <span class="keyword">if</span> mid(i)==prev,0019 time = time+1;0020 <span class="keyword">else</span>0021 note = [note, prev, time];0022 prev = mid(i);0023 time = 1;0024 <span class="keyword">end</span>0025 <span class="keyword">end</span>0026 0027 note = [note, prev, time];0028 note(2:2:end) = note(2:2:end)*timeStep*64;</pre></div><hr><address>Generated on Thu 30-Oct-2008 12:52:18 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> © 2003</address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -