comparison scripts/hvresources/heavy_render.cpp @ 492:e9821d65b9ba prerelease

Heavy: your patch on the enzienaudio website should be called bela. You need to update that from your enzienaudio.com account.
author Giulio Moro <giuliomoro@yahoo.it>
date Tue, 21 Jun 2016 17:36:58 +0100
parents 45dee9066d43
children eb237b131ec7
comparison
equal deleted inserted replaced
491:89212ad6a0bf 492:e9821d65b9ba
13 13
14 #include <Bela.h> 14 #include <Bela.h>
15 #include <Midi.h> 15 #include <Midi.h>
16 #include <Scope.h> 16 #include <Scope.h>
17 #include <cmath> 17 #include <cmath>
18 #include <Heavy_bbb.h> 18 #include <Heavy_bela.h>
19 #include <string.h> 19 #include <string.h>
20 #include <stdlib.h> 20 #include <stdlib.h>
21 #include <string.h> 21 #include <string.h>
22 #include <DigitalChannelManager.h> 22 #include <DigitalChannelManager.h>
23 23
24 /* 24 /*
25 * HEAVY CONTEXT & BUFFERS 25 * HEAVY CONTEXT & BUFFERS
26 */ 26 */
27 27
28 Hv_bbb *gHeavyContext; 28 Hv_bela *gHeavyContext;
29 float *gHvInputBuffers = NULL, *gHvOutputBuffers = NULL; 29 float *gHvInputBuffers = NULL, *gHvOutputBuffers = NULL;
30 unsigned int gHvInputChannels = 0, gHvOutputChannels = 0; 30 unsigned int gHvInputChannels = 0, gHvOutputChannels = 0;
31 31
32 float gInverseSampleRate; 32 float gInverseSampleRate;
33 33
171 hvMidiHashes[kmmProgramChange] = hv_stringToHash("__hv_pgmin"); 171 hvMidiHashes[kmmProgramChange] = hv_stringToHash("__hv_pgmin");
172 hvMidiHashes[kmmPolyphonicKeyPressure] = hv_stringToHash("__hv_polytouchin"); 172 hvMidiHashes[kmmPolyphonicKeyPressure] = hv_stringToHash("__hv_polytouchin");
173 hvMidiHashes[kmmChannelPressure] = hv_stringToHash("__hv_touch"); 173 hvMidiHashes[kmmChannelPressure] = hv_stringToHash("__hv_touch");
174 hvMidiHashes[kmmPitchBend] = hv_stringToHash("__hv_bendin"); 174 hvMidiHashes[kmmPitchBend] = hv_stringToHash("__hv_bendin");
175 175
176 gHeavyContext = hv_bbb_new(context->audioSampleRate); 176 gHeavyContext = hv_bela_new(context->audioSampleRate);
177 177
178 gHvInputChannels = hv_getNumInputChannels(gHeavyContext); 178 gHvInputChannels = hv_getNumInputChannels(gHeavyContext);
179 gHvOutputChannels = hv_getNumOutputChannels(gHeavyContext); 179 gHvOutputChannels = hv_getNumOutputChannels(gHeavyContext);
180 180
181 gScopeChannelsInUse = gHvOutputChannels > gFirstScopeChannel ? 181 gScopeChannelsInUse = gHvOutputChannels > gFirstScopeChannel ?
357 } 357 }
358 } 358 }
359 359
360 360
361 // replacement for bang~ object 361 // replacement for bang~ object
362 //hv_vscheduleMessageForReceiver(gHeavyContext, "bbb_bang", 0.0f, "b"); 362 //hv_vscheduleMessageForReceiver(gHeavyContext, "bela_bang", 0.0f, "b");
363 363
364 hv_bbb_process_inline(gHeavyContext, gHvInputBuffers, gHvOutputBuffers, context->audioFrames); 364 hv_bela_process_inline(gHeavyContext, gHvInputBuffers, gHvOutputBuffers, context->audioFrames);
365 365
366 // Bela digital out 366 // Bela digital out
367 // Bela digital out at signal-rate 367 // Bela digital out at signal-rate
368 if(gDigitalSigOutChannelsInUse > 0) 368 if(gDigitalSigOutChannelsInUse > 0)
369 { 369 {
428 428
429 429
430 void cleanup(BelaContext *context, void *userData) 430 void cleanup(BelaContext *context, void *userData)
431 { 431 {
432 432
433 hv_bbb_free(gHeavyContext); 433 hv_bela_free(gHeavyContext);
434 if(gHvInputBuffers != NULL) 434 if(gHvInputBuffers != NULL)
435 free(gHvInputBuffers); 435 free(gHvInputBuffers);
436 if(gHvOutputBuffers != NULL) 436 if(gHvOutputBuffers != NULL)
437 free(gHvOutputBuffers); 437 free(gHvOutputBuffers);
438 delete[] gScopeOut; 438 delete[] gScopeOut;