forked from pschatzmann/arduino-stk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTapDelay_8h_source.html
215 lines (215 loc) · 32 KB
/
TapDelay_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
205
206
207
208
209
210
211
212
213
214
215
<!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: TapDelay.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">TapDelay.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_TAPDELAY_H</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="preprocessor">#define STK_TAPDELAY_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 "Filter.h"</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>  </div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="keyword">namespace </span><a class="code" href="namespacestk.html">stk</a> {</div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>  </div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment">/***************************************************/</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment">/***************************************************/</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>  </div>
<div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="classstk_1_1TapDelay.html"> 24</a></span> <span class="keyword">class </span><a class="code" href="classstk_1_1TapDelay.html">TapDelay</a> : <span class="keyword">public</span> <a class="code" href="classstk_1_1Filter.html">Filter</a></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> {</div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  </div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  </div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="classstk_1_1TapDelay.html#a24913411dff23e05995979e42cc51ecc"> 34</a></span>  <a class="code" href="classstk_1_1TapDelay.html#a24913411dff23e05995979e42cc51ecc">TapDelay</a>( std::vector<unsigned long> taps = std::vector<unsigned long>( 1, 0 ), <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> maxDelay = 4095 );</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  </div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="classstk_1_1TapDelay.html#a6980be10c3d3cb9633af1733b40e49cc"> 37</a></span>  <a class="code" href="classstk_1_1TapDelay.html#a6980be10c3d3cb9633af1733b40e49cc">~TapDelay</a>();</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  </div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  </div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="classstk_1_1TapDelay.html#a104b7bd81435a38191e1e43a24cb471d"> 47</a></span>  <span class="keywordtype">void</span> <a class="code" href="classstk_1_1TapDelay.html#a104b7bd81435a38191e1e43a24cb471d">setMaximumDelay</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> delay );</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  </div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  </div>
<div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="classstk_1_1TapDelay.html#aa2bbab19ae277dc3689471d4250f00ad"> 53</a></span>  <span class="keywordtype">void</span> <a class="code" href="classstk_1_1TapDelay.html#aa2bbab19ae277dc3689471d4250f00ad">setTapDelays</a>( std::vector<unsigned long> taps );</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  </div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="classstk_1_1TapDelay.html#a57875d679b61674721c28deaf60677ed"> 56</a></span>  std::vector<unsigned long> <a class="code" href="classstk_1_1TapDelay.html#a57875d679b61674721c28deaf60677ed">getTapDelays</a>( <span class="keywordtype">void</span> )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> delays_; };</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="l00067"></a><span class="lineno"> 67</span>  StkFloat <a class="code" href="classstk_1_1TapDelay.html#a2f79f51f18b2b2fcdc9e535148dcd853">lastOut</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> tap = 0 ) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  </div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  </div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <a class="code" href="classstk_1_1StkFrames.html">StkFrames</a>& <a class="code" href="classstk_1_1TapDelay.html#aadd431e206dd1e4133e2ff0d49aa639b">tick</a>( StkFloat input, <a class="code" href="classstk_1_1StkFrames.html">StkFrames</a>& outputs );</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  </div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  </div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <a class="code" href="classstk_1_1StkFrames.html">StkFrames</a>& <a class="code" href="classstk_1_1TapDelay.html#aadd431e206dd1e4133e2ff0d49aa639b">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="l00092"></a><span class="lineno"> 92</span>  </div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  </div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <a class="code" href="classstk_1_1StkFrames.html">StkFrames</a>& <a class="code" href="classstk_1_1TapDelay.html#aadd431e206dd1e4133e2ff0d49aa639b">tick</a>( <a class="code" href="classstk_1_1StkFrames.html">StkFrames</a>& iFrames, <a class="code" href="classstk_1_1StkFrames.html">StkFrames</a> &oFrames, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> iChannel = 0 );</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  </div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <span class="keyword">protected</span>:</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  </div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> inPoint_;</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  std::vector<unsigned long> outPoint_;</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  std::vector<unsigned long> delays_;</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  </div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span> };</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  </div>
<div class="line"><a name="l00115"></a><span class="lineno"><a class="line" href="classstk_1_1TapDelay.html#a2f79f51f18b2b2fcdc9e535148dcd853"> 115</a></span> <span class="keyword">inline</span> StkFloat <a class="code" href="classstk_1_1TapDelay.html#a2f79f51f18b2b2fcdc9e535148dcd853">TapDelay :: lastOut</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> tap )<span class="keyword"> const</span></div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span> <span class="keyword"></span>{</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span> <span class="preprocessor">#if defined(_STK_DEBUG_)</span></div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="keywordflow">if</span> ( tap >= lastFrame_.<a class="code" href="classstk_1_1StkFrames.html#a28ab815d3fdadb8e5c858afdab811c7a">size</a>() ) {</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  oStream_ << <span class="stringliteral">"TapDelay::lastOut(): tap argument and number of taps are incompatible!"</span>;</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  <a class="code" href="classstk_1_1Stk.html#a48ac73a0d8ca28445ba1a054e1f061ff">handleError</a>( StkError::FUNCTION_ARGUMENT );</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  }</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  </div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  <span class="keywordflow">return</span> lastFrame_[tap];</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span> }</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  </div>
<div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="classstk_1_1TapDelay.html#aadd431e206dd1e4133e2ff0d49aa639b"> 127</a></span> <span class="keyword">inline</span> <a class="code" href="classstk_1_1StkFrames.html">StkFrames</a>& <a class="code" href="classstk_1_1TapDelay.html#aadd431e206dd1e4133e2ff0d49aa639b">TapDelay :: tick</a>( StkFloat input, <a class="code" href="classstk_1_1StkFrames.html">StkFrames</a>& outputs )</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="preprocessor">#if defined(_STK_DEBUG_)</span></div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="keywordflow">if</span> ( outputs.<a class="code" href="classstk_1_1StkFrames.html#a0340d9e76707282658e49509a568f60e">channels</a>() < outPoint_.size() ) {</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  oStream_ << <span class="stringliteral">"TapDelay::tick(): number of taps > channels in StkFrames argument!"</span>;</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  <a class="code" href="classstk_1_1Stk.html#a48ac73a0d8ca28445ba1a054e1f061ff">handleError</a>( StkError::FUNCTION_ARGUMENT );</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  }</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span> <span class="preprocessor">#endif</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>  inputs_[inPoint_++] = input * gain_;</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="comment">// Check for end condition</span></div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  <span class="keywordflow">if</span> ( inPoint_ == inputs_.<a class="code" href="classstk_1_1StkFrames.html#a28ab815d3fdadb8e5c858afdab811c7a">size</a>() )</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  inPoint_ = 0;</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  </div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <span class="comment">// Read out next values</span></div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  StkFloat *outs = &outputs[0];</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i<outPoint_.size(); i++ ) {</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  *outs++ = inputs_[outPoint_[i]];</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  lastFrame_[i] = *outs;</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <span class="keywordflow">if</span> ( ++outPoint_[i] == inputs_.<a class="code" href="classstk_1_1StkFrames.html#a28ab815d3fdadb8e5c858afdab811c7a">size</a>() )</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  outPoint_[i] = 0;</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  }</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  </div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  <span class="keywordflow">return</span> outputs;</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span> }</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  </div>
<div class="line"><a name="l00154"></a><span class="lineno"><a class="line" href="classstk_1_1TapDelay.html#a9255a00f0d7588ba5b51a12ba5db08c0"> 154</a></span> <span class="keyword">inline</span> <a class="code" href="classstk_1_1StkFrames.html">StkFrames</a>& <a class="code" href="classstk_1_1TapDelay.html#aadd431e206dd1e4133e2ff0d49aa639b">TapDelay :: 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="l00155"></a><span class="lineno"> 155</span> {</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span> <span class="preprocessor">#if defined(_STK_DEBUG_)</span></div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  <span class="keywordflow">if</span> ( channel >= frames.<a class="code" href="classstk_1_1StkFrames.html#a0340d9e76707282658e49509a568f60e">channels</a>() ) {</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  oStream_ << <span class="stringliteral">"TapDelay::tick(): channel and StkFrames arguments are incompatible!"</span>;</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  <a class="code" href="classstk_1_1Stk.html#a48ac73a0d8ca28445ba1a054e1f061ff">handleError</a>( StkError::FUNCTION_ARGUMENT );</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  }</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <span class="keywordflow">if</span> ( frames.<a class="code" href="classstk_1_1StkFrames.html#a0340d9e76707282658e49509a568f60e">channels</a>() < outPoint_.size() ) {</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  oStream_ << <span class="stringliteral">"TapDelay::tick(): number of taps > channels in StkFrames argument!"</span>;</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <a class="code" href="classstk_1_1Stk.html#a48ac73a0d8ca28445ba1a054e1f061ff">handleError</a>( StkError::FUNCTION_ARGUMENT );</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  }</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  </div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  StkFloat *iSamples = &frames[channel];</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  StkFloat *oSamples = &frames[0];</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <span class="keywordtype">size_t</span> j;</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> iHop = frames.<a class="code" href="classstk_1_1StkFrames.html#a0340d9e76707282658e49509a568f60e">channels</a>();</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  <span class="keywordtype">size_t</span> oHop = frames.<a class="code" href="classstk_1_1StkFrames.html#a0340d9e76707282658e49509a568f60e">channels</a>() - outPoint_.size();</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> i=0; i<frames.<a class="code" href="classstk_1_1StkFrames.html#a0fc22e21feecdee966f0203722b9c168">frames</a>(); i++, iSamples += iHop, oSamples += oHop ) {</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  inputs_[inPoint_++] = *iSamples * gain_;</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <span class="keywordflow">if</span> ( inPoint_ == inputs_.<a class="code" href="classstk_1_1StkFrames.html#a28ab815d3fdadb8e5c858afdab811c7a">size</a>() ) inPoint_ = 0;</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  <span class="keywordflow">for</span> ( j=0; j<outPoint_.size(); j++ ) {</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  *oSamples++ = inputs_[outPoint_[j]];</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  <span class="keywordflow">if</span> ( ++outPoint_[j] == inputs_.<a class="code" href="classstk_1_1StkFrames.html#a28ab815d3fdadb8e5c858afdab811c7a">size</a>() ) outPoint_[j] = 0;</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  }</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>  </div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  oSamples -= frames.<a class="code" href="classstk_1_1StkFrames.html#a0340d9e76707282658e49509a568f60e">channels</a>();</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  <span class="keywordflow">for</span> ( j=0; j<outPoint_.size(); j++ ) lastFrame_[j] = *oSamples++;</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <span class="keywordflow">return</span> frames;</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>  </div>
<div class="line"><a name="l00186"></a><span class="lineno"><a class="line" href="classstk_1_1TapDelay.html#ad8250d2802326bd3778c00642266d201"> 186</a></span> <span class="keyword">inline</span> <a class="code" href="classstk_1_1StkFrames.html">StkFrames</a>& <a class="code" href="classstk_1_1TapDelay.html#aadd431e206dd1e4133e2ff0d49aa639b">TapDelay :: tick</a>( <a class="code" href="classstk_1_1StkFrames.html">StkFrames</a>& iFrames, <a class="code" href="classstk_1_1StkFrames.html">StkFrames</a>& oFrames, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> iChannel )</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span> {</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span> <span class="preprocessor">#if defined(_STK_DEBUG_)</span></div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  <span class="keywordflow">if</span> ( iChannel >= iFrames.<a class="code" href="classstk_1_1StkFrames.html#a0340d9e76707282658e49509a568f60e">channels</a>() ) {</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  oStream_ << <span class="stringliteral">"TapDelay::tick(): channel and StkFrames arguments are incompatible!"</span>;</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  <a class="code" href="classstk_1_1Stk.html#a48ac73a0d8ca28445ba1a054e1f061ff">handleError</a>( StkError::FUNCTION_ARGUMENT );</div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  }</div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  <span class="keywordflow">if</span> ( oFrames.<a class="code" href="classstk_1_1StkFrames.html#a0340d9e76707282658e49509a568f60e">channels</a>() < outPoint_.size() ) {</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  oStream_ << <span class="stringliteral">"TapDelay::tick(): number of taps > channels in output StkFrames argument!"</span>;</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  <a class="code" href="classstk_1_1Stk.html#a48ac73a0d8ca28445ba1a054e1f061ff">handleError</a>( StkError::FUNCTION_ARGUMENT );</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  }</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  </div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  StkFloat *iSamples = &iFrames[iChannel];</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  StkFloat *oSamples = &oFrames[0];</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  <span class="keywordtype">size_t</span> j;</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> iHop = iFrames.<a class="code" href="classstk_1_1StkFrames.html#a0340d9e76707282658e49509a568f60e">channels</a>();</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <span class="keywordtype">size_t</span> oHop = oFrames.<a class="code" href="classstk_1_1StkFrames.html#a0340d9e76707282658e49509a568f60e">channels</a>() - outPoint_.size();</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> i=0; i<iFrames.<a class="code" href="classstk_1_1StkFrames.html#a0fc22e21feecdee966f0203722b9c168">frames</a>(); i++, iSamples += iHop, oSamples += oHop ) {</div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  inputs_[inPoint_++] = *iSamples * gain_;</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  <span class="keywordflow">if</span> ( inPoint_ == inputs_.<a class="code" href="classstk_1_1StkFrames.html#a28ab815d3fdadb8e5c858afdab811c7a">size</a>() ) inPoint_ = 0;</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  <span class="keywordflow">for</span> ( j=0; j<outPoint_.size(); j++ ) {</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  *oSamples++ = inputs_[outPoint_[j]];</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  <span class="keywordflow">if</span> ( ++outPoint_[j] == inputs_.<a class="code" href="classstk_1_1StkFrames.html#a28ab815d3fdadb8e5c858afdab811c7a">size</a>() ) outPoint_[j] = 0;</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>  }</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>  oSamples -= oFrames.<a class="code" href="classstk_1_1StkFrames.html#a0340d9e76707282658e49509a568f60e">channels</a>();</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  <span class="keywordflow">for</span> ( j=0; j<outPoint_.size(); j++ ) lastFrame_[j] = *oSamples++;</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  <span class="keywordflow">return</span> iFrames;</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span> }</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  </div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span> } <span class="comment">// stk namespace</span></div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  </div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span> <span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclassstk_1_1Filter_html"><div class="ttname"><a href="classstk_1_1Filter.html">stk::Filter</a></div><div class="ttdoc">STK abstract filter class.</div><div class="ttdef"><b>Definition:</b> Filter.h:23</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_1StkFrames_html_a28ab815d3fdadb8e5c858afdab811c7a"><div class="ttname"><a href="classstk_1_1StkFrames.html#a28ab815d3fdadb8e5c858afdab811c7a">stk::StkFrames::size</a></div><div class="ttdeci">size_t size() const</div><div class="ttdoc">Returns the total number of audio samples represented by the object.</div><div class="ttdef"><b>Definition:</b> Stk.h:373</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="aclassstk_1_1TapDelay_html"><div class="ttname"><a href="classstk_1_1TapDelay.html">stk::TapDelay</a></div><div class="ttdoc">STK non-interpolating tapped delay line class.</div><div class="ttdef"><b>Definition:</b> TapDelay.h:25</div></div>
<div class="ttc" id="aclassstk_1_1TapDelay_html_a104b7bd81435a38191e1e43a24cb471d"><div class="ttname"><a href="classstk_1_1TapDelay.html#a104b7bd81435a38191e1e43a24cb471d">stk::TapDelay::setMaximumDelay</a></div><div class="ttdeci">void setMaximumDelay(unsigned long delay)</div><div class="ttdoc">Set the maximum delay-line length.</div></div>
<div class="ttc" id="aclassstk_1_1TapDelay_html_a24913411dff23e05995979e42cc51ecc"><div class="ttname"><a href="classstk_1_1TapDelay.html#a24913411dff23e05995979e42cc51ecc">stk::TapDelay::TapDelay</a></div><div class="ttdeci">TapDelay(std::vector< unsigned long > taps=std::vector< unsigned long >(1, 0), unsigned long maxDelay=4095)</div><div class="ttdoc">The default constructor creates a delay-line with maximum length of 4095 samples and a single tap at ...</div></div>
<div class="ttc" id="aclassstk_1_1TapDelay_html_a2f79f51f18b2b2fcdc9e535148dcd853"><div class="ttname"><a href="classstk_1_1TapDelay.html#a2f79f51f18b2b2fcdc9e535148dcd853">stk::TapDelay::lastOut</a></div><div class="ttdeci">StkFloat lastOut(unsigned int tap=0) const</div><div class="ttdoc">Return the specified tap value of the last computed frame.</div><div class="ttdef"><b>Definition:</b> TapDelay.h:115</div></div>
<div class="ttc" id="aclassstk_1_1TapDelay_html_a57875d679b61674721c28deaf60677ed"><div class="ttname"><a href="classstk_1_1TapDelay.html#a57875d679b61674721c28deaf60677ed">stk::TapDelay::getTapDelays</a></div><div class="ttdeci">std::vector< unsigned long > getTapDelays(void) const</div><div class="ttdoc">Return the current delay-line length.</div><div class="ttdef"><b>Definition:</b> TapDelay.h:56</div></div>
<div class="ttc" id="aclassstk_1_1TapDelay_html_a6980be10c3d3cb9633af1733b40e49cc"><div class="ttname"><a href="classstk_1_1TapDelay.html#a6980be10c3d3cb9633af1733b40e49cc">stk::TapDelay::~TapDelay</a></div><div class="ttdeci">~TapDelay()</div><div class="ttdoc">Class destructor.</div></div>
<div class="ttc" id="aclassstk_1_1TapDelay_html_aa2bbab19ae277dc3689471d4250f00ad"><div class="ttname"><a href="classstk_1_1TapDelay.html#aa2bbab19ae277dc3689471d4250f00ad">stk::TapDelay::setTapDelays</a></div><div class="ttdeci">void setTapDelays(std::vector< unsigned long > taps)</div><div class="ttdoc">Set the delay-line tap lengths.</div></div>
<div class="ttc" id="aclassstk_1_1TapDelay_html_aadd431e206dd1e4133e2ff0d49aa639b"><div class="ttname"><a href="classstk_1_1TapDelay.html#aadd431e206dd1e4133e2ff0d49aa639b">stk::TapDelay::tick</a></div><div class="ttdeci">StkFrames & tick(StkFloat input, StkFrames &outputs)</div><div class="ttdoc">Input one sample to the delayline and return outputs at all tap positions.</div><div class="ttdef"><b>Definition:</b> TapDelay.h:127</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>