forked from pschatzmann/arduino-stk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGranulate_8h_source.html
204 lines (204 loc) · 29.7 KB
/
Granulate_8h_source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Arduino STK: Granulate.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Arduino STK
 <span id="projectnumber">4.6.2</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Granulate.h</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="preprocessor">#ifndef STK_GRANULATE_H</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="preprocessor">#define STK_GRANULATE_H</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>  </div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="preprocessor">#include <vector></span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="preprocessor">#include "Generator.h"</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="preprocessor">#include "Envelope.h"</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="preprocessor">#include "Noise.h"</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="preprocessor">#include "MemoryFS.h"</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>  </div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="keyword">namespace </span><a class="code" href="namespacestk.html">stk</a> {</div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>  </div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">/***************************************************/</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="comment">/***************************************************/</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  </div>
<div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="classstk_1_1Granulate.html"> 29</a></span> <span class="keyword">class </span><a class="code" href="classstk_1_1Granulate.html">Granulate</a>: <span class="keyword">public</span> <a class="code" href="classstk_1_1Generator.html">Generator</a></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> {</div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="classstk_1_1Granulate.html#a78af615a331de9b643dfabb8e106883f"> 33</a></span>  <a class="code" href="classstk_1_1Granulate.html#a78af615a331de9b643dfabb8e106883f">Granulate</a>( <span class="keywordtype">void</span> );</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  </div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="classstk_1_1Granulate.html#aaff22b306824e885191892bbab35b9f6"> 36</a></span>  <a class="code" href="classstk_1_1Granulate.html#aaff22b306824e885191892bbab35b9f6">Granulate</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nVoices, std::string fileName, <span class="keywordtype">bool</span> typeRaw = <span class="keyword">false</span> );</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  </div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="classstk_1_1Granulate.html#a42eb1f39bd88eb8d4ca55972e7711313"> 39</a></span>  <a class="code" href="classstk_1_1Granulate.html#a42eb1f39bd88eb8d4ca55972e7711313">~Granulate</a>( <span class="keywordtype">void</span> );</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  </div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  <a class="code" href="classstk_1_1Granulate.html#a78af615a331de9b643dfabb8e106883f">Granulate</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nVoices, <a class="code" href="classstk_1_1MemoryFS.html">MemoryFS</a> &memoryFile);</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  <span class="keywordtype">void</span> openMemory(<a class="code" href="classstk_1_1MemoryFS.html">MemoryFS</a> &memoryFile);</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  </div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  </div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="classstk_1_1Granulate.html#a6227f127a77b4fc581028033cd7658d8"> 49</a></span>  <span class="keywordtype">void</span> <a class="code" href="classstk_1_1Granulate.html#a6227f127a77b4fc581028033cd7658d8">openFile</a>( std::string fileName, <span class="keywordtype">bool</span> typeRaw = <span class="keyword">false</span> );</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  </div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  </div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="classstk_1_1Granulate.html#a9b7b17ae856f3a9ece6ec462285f456c"> 56</a></span>  <span class="keywordtype">void</span> <a class="code" href="classstk_1_1Granulate.html#a9b7b17ae856f3a9ece6ec462285f456c">reset</a>( <span class="keywordtype">void</span> );</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  </div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  </div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="classstk_1_1Granulate.html#a735f3ebe8fa2cacfba2c4722a56fd417"> 64</a></span>  <span class="keywordtype">void</span> <a class="code" href="classstk_1_1Granulate.html#a735f3ebe8fa2cacfba2c4722a56fd417">setVoices</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nVoices = 1 );</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  </div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  </div>
<div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="classstk_1_1Granulate.html#aabd711f2b71bbcd28412d5cb73c085d6"> 73</a></span>  <span class="keywordtype">void</span> <a class="code" href="classstk_1_1Granulate.html#aabd711f2b71bbcd28412d5cb73c085d6">setStretch</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> stretchFactor = 1 );</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  </div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  </div>
<div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="classstk_1_1Granulate.html#a9b7c15080256f920646d36bfa0ed3734"> 91</a></span>  <span class="keywordtype">void</span> <a class="code" href="classstk_1_1Granulate.html#a9b7c15080256f920646d36bfa0ed3734">setGrainParameters</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> duration = 30, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> rampPercent = 50,</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <span class="keywordtype">int</span> offset = 0, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> delay = 0 );</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  </div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  </div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="classstk_1_1Granulate.html#a02b7b85f21999d4b350beff6a925bd25"> 103</a></span>  <span class="keywordtype">void</span> <a class="code" href="classstk_1_1Granulate.html#a02b7b85f21999d4b350beff6a925bd25">setRandomFactor</a>( StkFloat randomness = 0.1 );</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  </div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  </div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  StkFloat <a class="code" href="classstk_1_1Granulate.html#a60db060a365fc32fe789cb9bcd042dd3">lastOut</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channel = 0 );</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  </div>
<div class="line"><a name="l00117"></a><span class="lineno"><a class="line" href="classstk_1_1Granulate.html#a0f8b162c9c309b3cbec3802138a53c24"> 117</a></span>  StkFloat <a class="code" href="classstk_1_1Granulate.html#a0f8b162c9c309b3cbec3802138a53c24">tick</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channel = 0 );</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  </div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  </div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <a class="code" href="classstk_1_1StkFrames.html">StkFrames</a>& <a class="code" href="classstk_1_1Granulate.html#a0f8b162c9c309b3cbec3802138a53c24">tick</a>( <a class="code" href="classstk_1_1StkFrames.html">StkFrames</a>& frames, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channel = 0 );</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  </div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="keyword">enum</span> GrainState {</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  GRAIN_STOPPED,</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  GRAIN_FADEIN,</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  GRAIN_SUSTAIN,</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  GRAIN_FADEOUT</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  };</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  </div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <span class="keyword">protected</span>:</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  </div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  <span class="keyword">struct </span>Grain {</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  StkFloat eScaler;</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  StkFloat eRate;</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> attackCount;</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> sustainCount;</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> decayCount;</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> delayCount;</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> counter;</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <span class="comment">//unsigned long pointer;</span></div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  StkFloat pointer;</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> startPointer;</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> repeats;</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  GrainState state;</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  </div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  <span class="comment">// Default constructor.</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  Grain()</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  :eScaler(0.0), eRate(0.0), attackCount(0), sustainCount(0), decayCount(0),</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  delayCount(0), counter(0), pointer(0), startPointer(0), repeats(0), state(GRAIN_STOPPED) {}</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  };</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  </div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  <span class="keywordtype">void</span> calculateGrain( Granulate::Grain& grain );</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  </div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  StkFrames data_;</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  std::vector<Grain> grains_;</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  Noise noise;</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <span class="comment">//long gPointer_;</span></div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  StkFloat gPointer_;</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  </div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  <span class="comment">// Global grain parameters.</span></div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> gDuration_;</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> gRampPercent_;</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> gDelay_;</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> gStretch_;</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> stretchCounter_;</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  <span class="keywordtype">int</span> gOffset_;</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  StkFloat gRandomFactor_;</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  StkFloat gain_;</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  </div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span> };</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  </div>
<div class="line"><a name="l00178"></a><span class="lineno"><a class="line" href="classstk_1_1Granulate.html#a60db060a365fc32fe789cb9bcd042dd3"> 178</a></span> <span class="keyword">inline</span> StkFloat <a class="code" href="classstk_1_1Granulate.html#a60db060a365fc32fe789cb9bcd042dd3">Granulate :: lastOut</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channel )</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span> {</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span> <span class="preprocessor">#if defined(_STK_DEBUG_)</span></div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  <span class="keywordflow">if</span> ( channel >= lastFrame_.<a class="code" href="classstk_1_1StkFrames.html#a0340d9e76707282658e49509a568f60e">channels</a>() ) {</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  oStream_ << <span class="stringliteral">"Granulate::lastOut(): channel argument is invalid!"</span>;</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <a class="code" href="classstk_1_1Stk.html#a48ac73a0d8ca28445ba1a054e1f061ff">handleError</a>( StkError::FUNCTION_ARGUMENT );</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  }</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  </div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  <span class="keywordflow">return</span> lastFrame_[channel];</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span> }</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  </div>
<div class="line"><a name="l00190"></a><span class="lineno"><a class="line" href="classstk_1_1Granulate.html#aa9cc119b1515c5596a95d72f4b65b0c0"> 190</a></span> <span class="keyword">inline</span> <a class="code" href="classstk_1_1StkFrames.html">StkFrames</a>& <a class="code" href="classstk_1_1Granulate.html#a0f8b162c9c309b3cbec3802138a53c24">Granulate :: tick</a>( <a class="code" href="classstk_1_1StkFrames.html">StkFrames</a>& frames, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channel )</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span> {</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nChannels = lastFrame_.<a class="code" href="classstk_1_1StkFrames.html#a0340d9e76707282658e49509a568f60e">channels</a>();</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span> <span class="preprocessor">#if defined(_STK_DEBUG_)</span></div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  <span class="keywordflow">if</span> ( channel > frames.<a class="code" href="classstk_1_1StkFrames.html#a0340d9e76707282658e49509a568f60e">channels</a>() - nChannels ) {</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  oStream_ << <span class="stringliteral">"Granulate::tick(): channel and StkFrames arguments are incompatible!"</span>;</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <a class="code" href="classstk_1_1Stk.html#a48ac73a0d8ca28445ba1a054e1f061ff">handleError</a>( StkError::FUNCTION_ARGUMENT );</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  }</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  </div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  StkFloat *samples = &frames[channel];</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> j, hop = frames.<a class="code" href="classstk_1_1StkFrames.html#a0340d9e76707282658e49509a568f60e">channels</a>() - nChannels;</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i<frames.<a class="code" href="classstk_1_1StkFrames.html#a0fc22e21feecdee966f0203722b9c168">frames</a>(); i++, samples += hop ) {</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  *samples++ = <a class="code" href="classstk_1_1Granulate.html#a0f8b162c9c309b3cbec3802138a53c24">tick</a>();</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  <span class="keywordflow">for</span> ( j=1; j<nChannels; j++ )</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  *samples++ = lastFrame_[j];</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  }</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  </div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  <span class="keywordflow">return</span> frames;</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span> }</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  </div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span> } <span class="comment">// stk namespace</span></div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  </div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span> <span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclassstk_1_1Generator_html"><div class="ttname"><a href="classstk_1_1Generator.html">stk::Generator</a></div><div class="ttdoc">STK abstract unit generator parent class.</div><div class="ttdef"><b>Definition:</b> Generator.h:21</div></div>
<div class="ttc" id="aclassstk_1_1Granulate_html"><div class="ttname"><a href="classstk_1_1Granulate.html">stk::Granulate</a></div><div class="ttdoc">STK granular synthesis class.</div><div class="ttdef"><b>Definition:</b> Granulate.h:30</div></div>
<div class="ttc" id="aclassstk_1_1Granulate_html_a02b7b85f21999d4b350beff6a925bd25"><div class="ttname"><a href="classstk_1_1Granulate.html#a02b7b85f21999d4b350beff6a925bd25">stk::Granulate::setRandomFactor</a></div><div class="ttdeci">void setRandomFactor(StkFloat randomness=0.1)</div><div class="ttdoc">This factor is used when setting individual grain parameters (0.0 - 1.0).</div></div>
<div class="ttc" id="aclassstk_1_1Granulate_html_a0f8b162c9c309b3cbec3802138a53c24"><div class="ttname"><a href="classstk_1_1Granulate.html#a0f8b162c9c309b3cbec3802138a53c24">stk::Granulate::tick</a></div><div class="ttdeci">StkFloat tick(unsigned int channel=0)</div><div class="ttdoc">Compute one sample frame and return the specified channel value.</div></div>
<div class="ttc" id="aclassstk_1_1Granulate_html_a42eb1f39bd88eb8d4ca55972e7711313"><div class="ttname"><a href="classstk_1_1Granulate.html#a42eb1f39bd88eb8d4ca55972e7711313">stk::Granulate::~Granulate</a></div><div class="ttdeci">~Granulate(void)</div><div class="ttdoc">Class destructor.</div></div>
<div class="ttc" id="aclassstk_1_1Granulate_html_a60db060a365fc32fe789cb9bcd042dd3"><div class="ttname"><a href="classstk_1_1Granulate.html#a60db060a365fc32fe789cb9bcd042dd3">stk::Granulate::lastOut</a></div><div class="ttdeci">StkFloat lastOut(unsigned int channel=0)</div><div class="ttdoc">Return the specified channel value of the last computed frame.</div><div class="ttdef"><b>Definition:</b> Granulate.h:178</div></div>
<div class="ttc" id="aclassstk_1_1Granulate_html_a6227f127a77b4fc581028033cd7658d8"><div class="ttname"><a href="classstk_1_1Granulate.html#a6227f127a77b4fc581028033cd7658d8">stk::Granulate::openFile</a></div><div class="ttdeci">void openFile(std::string fileName, bool typeRaw=false)</div><div class="ttdoc">Load a monophonic soundfile to be "granulated".</div></div>
<div class="ttc" id="aclassstk_1_1Granulate_html_a735f3ebe8fa2cacfba2c4722a56fd417"><div class="ttname"><a href="classstk_1_1Granulate.html#a735f3ebe8fa2cacfba2c4722a56fd417">stk::Granulate::setVoices</a></div><div class="ttdeci">void setVoices(unsigned int nVoices=1)</div><div class="ttdoc">Set the number of simultaneous grain "voices" to use.</div></div>
<div class="ttc" id="aclassstk_1_1Granulate_html_a78af615a331de9b643dfabb8e106883f"><div class="ttname"><a href="classstk_1_1Granulate.html#a78af615a331de9b643dfabb8e106883f">stk::Granulate::Granulate</a></div><div class="ttdeci">Granulate(void)</div><div class="ttdoc">Default constructor.</div></div>
<div class="ttc" id="aclassstk_1_1Granulate_html_a9b7b17ae856f3a9ece6ec462285f456c"><div class="ttname"><a href="classstk_1_1Granulate.html#a9b7b17ae856f3a9ece6ec462285f456c">stk::Granulate::reset</a></div><div class="ttdeci">void reset(void)</div><div class="ttdoc">Reset the file pointer and all existing grains to the file start.</div></div>
<div class="ttc" id="aclassstk_1_1Granulate_html_a9b7c15080256f920646d36bfa0ed3734"><div class="ttname"><a href="classstk_1_1Granulate.html#a9b7c15080256f920646d36bfa0ed3734">stk::Granulate::setGrainParameters</a></div><div class="ttdeci">void setGrainParameters(unsigned int duration=30, unsigned int rampPercent=50, int offset=0, unsigned int delay=0)</div><div class="ttdoc">Set global grain parameters used to determine individual grain settings.</div></div>
<div class="ttc" id="aclassstk_1_1Granulate_html_aabd711f2b71bbcd28412d5cb73c085d6"><div class="ttname"><a href="classstk_1_1Granulate.html#aabd711f2b71bbcd28412d5cb73c085d6">stk::Granulate::setStretch</a></div><div class="ttdeci">void setStretch(unsigned int stretchFactor=1)</div><div class="ttdoc">Set the stretch factor used for grain playback (1 - 1000).</div></div>
<div class="ttc" id="aclassstk_1_1Granulate_html_aaff22b306824e885191892bbab35b9f6"><div class="ttname"><a href="classstk_1_1Granulate.html#aaff22b306824e885191892bbab35b9f6">stk::Granulate::Granulate</a></div><div class="ttdeci">Granulate(unsigned int nVoices, std::string fileName, bool typeRaw=false)</div><div class="ttdoc">Constructor taking input audio file and number of voices arguments.</div></div>
<div class="ttc" id="aclassstk_1_1MemoryFS_html"><div class="ttname"><a href="classstk_1_1MemoryFS.html">stk::MemoryFS</a></div><div class="ttdoc">STK in memory File An instance is representing an individual memory array which can be registered wit...</div><div class="ttdef"><b>Definition:</b> MemoryFS.h:46</div></div>
<div class="ttc" id="aclassstk_1_1StkFrames_html"><div class="ttname"><a href="classstk_1_1StkFrames.html">stk::StkFrames</a></div><div class="ttdoc">An STK class to handle vectorized audio data.</div><div class="ttdef"><b>Definition:</b> Stk.h:287</div></div>
<div class="ttc" id="aclassstk_1_1StkFrames_html_a0340d9e76707282658e49509a568f60e"><div class="ttname"><a href="classstk_1_1StkFrames.html#a0340d9e76707282658e49509a568f60e">stk::StkFrames::channels</a></div><div class="ttdeci">unsigned int channels(void) const</div><div class="ttdoc">Return the number of channels represented by the data.</div><div class="ttdef"><b>Definition:</b> Stk.h:415</div></div>
<div class="ttc" id="aclassstk_1_1StkFrames_html_a0fc22e21feecdee966f0203722b9c168"><div class="ttname"><a href="classstk_1_1StkFrames.html#a0fc22e21feecdee966f0203722b9c168">stk::StkFrames::frames</a></div><div class="ttdeci">unsigned int frames(void) const</div><div class="ttdoc">Return the number of sample frames represented by the data.</div><div class="ttdef"><b>Definition:</b> Stk.h:418</div></div>
<div class="ttc" id="aclassstk_1_1Stk_html_a48ac73a0d8ca28445ba1a054e1f061ff"><div class="ttname"><a href="classstk_1_1Stk.html#a48ac73a0d8ca28445ba1a054e1f061ff">stk::Stk::handleError</a></div><div class="ttdeci">static void handleError(const char *message, StkError::Type type)</div><div class="ttdoc">Static function for error reporting and handling using c-strings.</div></div>
<div class="ttc" id="anamespacestk_html"><div class="ttname"><a href="namespacestk.html">stk</a></div><div class="ttdoc">The STK namespace.</div><div class="ttdef"><b>Definition:</b> ADSR.h:8</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>