Mercurial > hg > beaglert
comparison projects/heavy/hello-world/HvContext_bbb.c @ 162:c3e8226a5651 heavy-updated
- added additional flags to C rules (-DNDEBUG, -mfpu=neon)
- sample-accurate envelope triggering pd/heavy example
author | chnrx <chris.heinrichs@gmail.com> |
---|---|
date | Thu, 12 Nov 2015 14:59:46 +0000 |
parents | 5bcf04234f80 |
children |
comparison
equal
deleted
inserted
replaced
161:07735c9d95c8 | 162:c3e8226a5651 |
---|---|
82 Base(_c)->sendHook = NULL; | 82 Base(_c)->sendHook = NULL; |
83 Base(_c)->userData = NULL; | 83 Base(_c)->userData = NULL; |
84 Base(_c)->name = "bbb"; | 84 Base(_c)->name = "bbb"; |
85 | 85 |
86 Base(_c)->numBytes = sizeof(Hv_bbb); | 86 Base(_c)->numBytes = sizeof(Hv_bbb); |
87 Base(_c)->numBytes += sPhasor_k_init(&_c->sPhasor_O587H, 440.0f, sampleRate); | 87 Base(_c)->numBytes += sPhasor_k_init(&_c->sPhasor_XIjUg, 440.0f, sampleRate); |
88 | 88 |
89 // loadbang | 89 // loadbang |
90 | 90 |
91 return _c; | 91 return _c; |
92 } | 92 } |
143 // zero output buffers | 143 // zero output buffers |
144 __hv_zero_f(VOf(O0)); | 144 __hv_zero_f(VOf(O0)); |
145 __hv_zero_f(VOf(O1)); | 145 __hv_zero_f(VOf(O1)); |
146 | 146 |
147 // process all signal functions | 147 // process all signal functions |
148 __hv_phasor_k_f(&_c->sPhasor_O587H, VOf(Bf0)); | 148 __hv_phasor_k_f(&_c->sPhasor_XIjUg, VOf(Bf0)); |
149 __hv_var_k_f(VOf(Bf1), 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0); | 149 __hv_var_k_f(VOf(Bf1), 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0); |
150 __hv_sub_f(VIf(Bf0), VIf(Bf1), VOf(Bf1)); | 150 __hv_sub_f(VIf(Bf0), VIf(Bf1), VOf(Bf1)); |
151 __hv_abs_f(VIf(Bf1), VOf(Bf1)); | 151 __hv_abs_f(VIf(Bf1), VOf(Bf1)); |
152 __hv_var_k_f(VOf(Bf0), 0.25f, 0.25f, 0.25f, 0.25f, 0.25f, 0.25f, 0.25f, 0.25f, 0); | 152 __hv_var_k_f(VOf(Bf0), 0.25f, 0.25f, 0.25f, 0.25f, 0.25f, 0.25f, 0.25f, 0.25f, 0); |
153 __hv_sub_f(VIf(Bf1), VIf(Bf0), VOf(Bf0)); | 153 __hv_sub_f(VIf(Bf1), VIf(Bf0), VOf(Bf0)); |
161 __hv_mul_f(VIf(Bf2), VIf(Bf4), VOf(Bf4)); | 161 __hv_mul_f(VIf(Bf2), VIf(Bf4), VOf(Bf4)); |
162 __hv_sub_f(VIf(Bf1), VIf(Bf4), VOf(Bf4)); | 162 __hv_sub_f(VIf(Bf1), VIf(Bf4), VOf(Bf4)); |
163 __hv_fma_f(VIf(Bf0), VIf(Bf3), VIf(Bf4), VOf(Bf4)); | 163 __hv_fma_f(VIf(Bf0), VIf(Bf3), VIf(Bf4), VOf(Bf4)); |
164 __hv_var_k_f(VOf(Bf3), 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0); | 164 __hv_var_k_f(VOf(Bf3), 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0); |
165 __hv_mul_f(VIf(Bf4), VIf(Bf3), VOf(Bf3)); | 165 __hv_mul_f(VIf(Bf4), VIf(Bf3), VOf(Bf3)); |
166 __hv_add_f(VIf(Bf3), VIf(O0), VOf(O0)); | |
166 __hv_add_f(VIf(Bf3), VIf(O1), VOf(O1)); | 167 __hv_add_f(VIf(Bf3), VIf(O1), VOf(O1)); |
167 __hv_add_f(VIf(Bf3), VIf(O0), VOf(O0)); | |
168 | 168 |
169 // save output vars to output buffer | 169 // save output vars to output buffer |
170 __hv_store_f(outputBuffers[0]+n, VIf(O0)); | 170 __hv_store_f(outputBuffers[0]+n, VIf(O0)); |
171 __hv_store_f(outputBuffers[1]+n, VIf(O1)); | 171 __hv_store_f(outputBuffers[1]+n, VIf(O1)); |
172 } | 172 } |