comparison core/default_libpd_render.cpp @ 480:4ff80956c27a prerelease

heavy supports digitals at message rate
author Giulio Moro <giuliomoro@yahoo.it>
date Tue, 21 Jun 2016 05:44:21 +0100
parents 838a4a4a8580
children dbc76783db2a
comparison
equal deleted inserted replaced
479:bfc60429cca6 480:4ff80956c27a
148 snprintf(str, strSize, "%s%s", folder, file); 148 snprintf(str, strSize, "%s%s", folder, file);
149 if(access(str, F_OK) == -1 ) { 149 if(access(str, F_OK) == -1 ) {
150 printf("Error file %s/%s not found. The %s file should be your main patch.\n", folder, file, file); 150 printf("Error file %s/%s not found. The %s file should be your main patch.\n", folder, file, file);
151 return false; 151 return false;
152 } 152 }
153
154 // analog setup
155 gAnalogChannelsInUse = context->analogChannels;
156
157 // digital setup
153 dcm.setCallback(sendDigitalMessage); 158 dcm.setCallback(sendDigitalMessage);
154 gAnalogChannelsInUse = context->analogChannels;
155 if(context->digitalChannels > 0){ 159 if(context->digitalChannels > 0){
156 for(unsigned int ch = 0; ch < context->digitalChannels; ++ch){ 160 for(unsigned int ch = 0; ch < context->digitalChannels; ++ch){
157 dcm.setCallbackArgument(ch, receiverNames[ch]); 161 dcm.setCallbackArgument(ch, receiverNames[ch]);
158 } 162 }
159 } 163 }
164
160 midi.readFrom(0); 165 midi.readFrom(0);
161 midi.writeTo(0); 166 midi.writeTo(0);
162 #ifdef PARSE_MIDI 167 #ifdef PARSE_MIDI
163 midi.enableParser(true); 168 midi.enableParser(true);
164 #else 169 #else
345 *p1 = analogRead(context, analogFrame, k); 350 *p1 = analogRead(context, analogFrame, k);
346 } 351 }
347 } 352 }
348 } 353 }
349 354
350 //then digital 355 // Bela digital input
351 // note: in multiple places below we assume that the number of digitals is same as number of audio 356 // note: in multiple places below we assume that the number of digitals is same as number of audio
352 // digital in at message-rate 357 // digital in at message-rate
353 dcm.processInput(&context->digital[audioFrameBase], gLibpdBlockSize); 358 dcm.processInput(&context->digital[audioFrameBase], gLibpdBlockSize);
354 359
355 // digital in at signal-rate 360 // digital in at signal-rate