Files
stk/doc/html/Skini_8h-source.html
2013-09-29 23:44:33 +02:00

102 lines
9.8 KiB
HTML

<HTML>
<HEAD>
<TITLE>The Synthesis ToolKit in C++ (STK)</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<img src="princeton.gif"> &nbsp; <img src="ccrma.gif"> &nbsp; <img src="mcgill.gif"><P>
<a class="qindex" href="index.html">Home</a> &nbsp; <a class="qindex" href="information.html">Information</a> &nbsp; <a class="qindex" href="classes.html">Classes</a> &nbsp; <a class="qindex" href="download.html">Download</a> &nbsp; <a class="qindex" href="usage.html">Usage</a> &nbsp; <a class="qindex" href="maillist.html">Mail List</a> &nbsp; <a class="qindex" href="system.html">Requirements</a> &nbsp; <a class="qindex" href="links.html">Links</a> &nbsp; <a class="qindex" href="faq.html">FAQ</a> &nbsp; <a class="qindex" href="tutorial.html">Tutorial</a></CENTER>
<HR>
<!-- Generated by Doxygen 1.5.8 -->
<div class="navpath"><a class="el" href="dir_d499f4756a454d8a02faa5ebe57d576f.html">include</a>
</div>
<div class="contents">
<h1>Skini.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef STK_SKINI_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define STK_SKINI_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include "Stk.h"</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &lt;fstream&gt;</span>
<a name="l00008"></a>00008
<a name="l00009"></a>00009 <span class="keyword">namespace </span>stk {
<a name="l00010"></a>00010
<a name="l00011"></a>00011 <span class="comment">/***************************************************/</span>
<a name="l00036"></a>00036 <span class="comment">/***************************************************/</span>
<a name="l00037"></a>00037
<a name="l00038"></a><a class="code" href="classstk_1_1Skini.html">00038</a> <span class="keyword">class </span><a class="code" href="classstk_1_1Skini.html" title="STK SKINI parsing class.">Skini</a> : <span class="keyword">public</span> <a class="code" href="classstk_1_1Stk.html" title="STK base class.">Stk</a>
<a name="l00039"></a>00039 {
<a name="l00040"></a>00040 <span class="keyword">public</span>:
<a name="l00041"></a>00041
<a name="l00043"></a><a class="code" href="structstk_1_1Skini_1_1Message.html">00043</a> <span class="keyword">struct </span><a class="code" href="structstk_1_1Skini_1_1Message.html" title="A message structure to store and pass parsed SKINI messages.">Message</a> {
<a name="l00044"></a><a class="code" href="structstk_1_1Skini_1_1Message.html#bbc0624b287332dc4fb6bdb2ab60e9c0">00044</a> <span class="keywordtype">long</span> <a class="code" href="structstk_1_1Skini_1_1Message.html#bbc0624b287332dc4fb6bdb2ab60e9c0">type</a>;
<a name="l00045"></a><a class="code" href="structstk_1_1Skini_1_1Message.html#c1bc8970386267cf1e2ef4158423a674">00045</a> <span class="keywordtype">long</span> <a class="code" href="structstk_1_1Skini_1_1Message.html#c1bc8970386267cf1e2ef4158423a674">channel</a>;
<a name="l00046"></a><a class="code" href="structstk_1_1Skini_1_1Message.html#edd07a24e5cdb48f813ae09163e37734">00046</a> StkFloat <a class="code" href="structstk_1_1Skini_1_1Message.html#edd07a24e5cdb48f813ae09163e37734">time</a>;
<a name="l00047"></a><a class="code" href="structstk_1_1Skini_1_1Message.html#8bcc16021f56dbded308672d87f8199e">00047</a> std::vector&lt;StkFloat&gt; <a class="code" href="structstk_1_1Skini_1_1Message.html#8bcc16021f56dbded308672d87f8199e">floatValues</a>;
<a name="l00048"></a><a class="code" href="structstk_1_1Skini_1_1Message.html#18dc93937487044b992468875abdc4dd">00048</a> std::vector&lt;long&gt; <a class="code" href="structstk_1_1Skini_1_1Message.html#18dc93937487044b992468875abdc4dd">intValues</a>;
<a name="l00049"></a><a class="code" href="structstk_1_1Skini_1_1Message.html#3afd9e17a7df379d3b78c72e8c591836">00049</a> std::string <a class="code" href="structstk_1_1Skini_1_1Message.html#3afd9e17a7df379d3b78c72e8c591836">remainder</a>;
<a name="l00051"></a>00051 <span class="comment">// Default constructor.</span>
<a name="l00052"></a>00052 <a class="code" href="structstk_1_1Skini_1_1Message.html" title="A message structure to store and pass parsed SKINI messages.">Message</a>()
<a name="l00053"></a>00053 :<a class="code" href="structstk_1_1Skini_1_1Message.html#bbc0624b287332dc4fb6bdb2ab60e9c0">type</a>(0), <a class="code" href="structstk_1_1Skini_1_1Message.html#c1bc8970386267cf1e2ef4158423a674">channel</a>(0), <a class="code" href="structstk_1_1Skini_1_1Message.html#edd07a24e5cdb48f813ae09163e37734">time</a>(0.0), <a class="code" href="structstk_1_1Skini_1_1Message.html#8bcc16021f56dbded308672d87f8199e">floatValues</a>(2), <a class="code" href="structstk_1_1Skini_1_1Message.html#18dc93937487044b992468875abdc4dd">intValues</a>(2) {}
<a name="l00054"></a>00054 };
<a name="l00055"></a>00055
<a name="l00057"></a>00057 <a class="code" href="classstk_1_1Skini.html#ed904de40a0fa1d22dbb08bc4517f4c8" title="Default constructor.">Skini</a>();
<a name="l00058"></a>00058
<a name="l00060"></a>00060 <a class="code" href="classstk_1_1Skini.html#7c960798afad4b53065ebb26ff00495a" title="Class destructor.">~Skini</a>();
<a name="l00061"></a>00061
<a name="l00063"></a>00063
<a name="l00067"></a>00067 <span class="keywordtype">bool</span> <a class="code" href="classstk_1_1Skini.html#30eb5f5238c552d042b8eb510aa8d241" title="Set a SKINI formatted file for reading.">setFile</a>( std::string fileName );
<a name="l00068"></a>00068
<a name="l00070"></a>00070
<a name="l00076"></a>00076 <span class="keywordtype">long</span> <a class="code" href="classstk_1_1Skini.html#675f2a9841c4b84e161de651eed4412d" title="Parse the next file message (if a file is loaded) and return the message type.">nextMessage</a>( <a class="code" href="structstk_1_1Skini_1_1Message.html" title="A message structure to store and pass parsed SKINI messages.">Skini::Message</a>&amp; message );
<a name="l00077"></a>00077
<a name="l00079"></a>00079
<a name="l00083"></a>00083 <span class="keywordtype">long</span> <a class="code" href="classstk_1_1Skini.html#d3e29f6ca88052e95698137ec2e545ad" title="Attempt to parse the given string and returning the message type.">parseString</a>( std::string&amp; line, <a class="code" href="structstk_1_1Skini_1_1Message.html" title="A message structure to store and pass parsed SKINI messages.">Skini::Message</a>&amp; message );
<a name="l00084"></a>00084
<a name="l00086"></a>00086 <span class="keyword">static</span> std::string <a class="code" href="classstk_1_1Skini.html#fae7977e19f7b7f647ee2c6ade62a199" title="Return the SKINI type string for the given type value.">whatsThisType</a>(<span class="keywordtype">long</span> type);
<a name="l00087"></a>00087
<a name="l00089"></a>00089 <span class="keyword">static</span> std::string <a class="code" href="classstk_1_1Skini.html#30c34ff9ffd7646165155fa4d62dee6c" title="Return the SKINI controller string for the given controller number.">whatsThisController</a>(<span class="keywordtype">long</span> number);
<a name="l00090"></a>00090
<a name="l00091"></a>00091 <span class="keyword">protected</span>:
<a name="l00092"></a>00092
<a name="l00093"></a>00093 <span class="keywordtype">void</span> tokenize( <span class="keyword">const</span> std::string&amp; str, std::vector&lt;std::string&gt;&amp; tokens, <span class="keyword">const</span> std::string&amp; delimiters );
<a name="l00094"></a>00094
<a name="l00095"></a>00095 std::ifstream file_;
<a name="l00096"></a>00096 };
<a name="l00097"></a>00097
<a name="l00098"></a>00098 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> Midi2Pitch[129] = {
<a name="l00099"></a>00099 8.18,8.66,9.18,9.72,10.30,10.91,11.56,12.25,
<a name="l00100"></a>00100 12.98,13.75,14.57,15.43,16.35,17.32,18.35,19.45,
<a name="l00101"></a>00101 20.60,21.83,23.12,24.50,25.96,27.50,29.14,30.87,
<a name="l00102"></a>00102 32.70,34.65,36.71,38.89,41.20,43.65,46.25,49.00,
<a name="l00103"></a>00103 51.91,55.00,58.27,61.74,65.41,69.30,73.42,77.78,
<a name="l00104"></a>00104 82.41,87.31,92.50,98.00,103.83,110.00,116.54,123.47,
<a name="l00105"></a>00105 130.81,138.59,146.83,155.56,164.81,174.61,185.00,196.00,
<a name="l00106"></a>00106 207.65,220.00,233.08,246.94,261.63,277.18,293.66,311.13,
<a name="l00107"></a>00107 329.63,349.23,369.99,392.00,415.30,440.00,466.16,493.88,
<a name="l00108"></a>00108 523.25,554.37,587.33,622.25,659.26,698.46,739.99,783.99,
<a name="l00109"></a>00109 830.61,880.00,932.33,987.77,1046.50,1108.73,1174.66,1244.51,
<a name="l00110"></a>00110 1318.51,1396.91,1479.98,1567.98,1661.22,1760.00,1864.66,1975.53,
<a name="l00111"></a>00111 2093.00,2217.46,2349.32,2489.02,2637.02,2793.83,2959.96,3135.96,
<a name="l00112"></a>00112 3322.44,3520.00,3729.31,3951.07,4186.01,4434.92,4698.64,4978.03,
<a name="l00113"></a>00113 5274.04,5587.65,5919.91,6271.93,6644.88,7040.00,7458.62,7902.13,
<a name="l00114"></a>00114 8372.02,8869.84,9397.27,9956.06,10548.08,11175.30,11839.82,12543.85,
<a name="l00115"></a>00115 13289.75};
<a name="l00116"></a>00116
<a name="l00117"></a>00117 } <span class="comment">// stk namespace</span>
<a name="l00118"></a>00118
<a name="l00119"></a>00119 <span class="preprocessor">#endif</span>
<a name="l00120"></a>00120 <span class="preprocessor"></span>
<a name="l00121"></a>00121
</pre></div></div>
<HR>
<table>
<tr><td><A HREF="http://ccrma.stanford.edu/software/stk/"><I>The Synthesis ToolKit in C++ (STK)</I></A></td></tr>
<tr><td>&copy;1995-2009 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
</table>
</BODY>
</HTML>