ofxPdsp mutlichannel


#1

Heyho people, @npisanti ,
what is the correct order to set up multichannel audio in ofxPDSP. I am having troubles to get it working.

    
    engine.listDevices();
    engine.setDeviceID(2);
    engine.setChannels(0, 16);
    engine.setup( 44100, 512, 3);

    player.out("0") >> engine.audio_out(0);
    player.out("1") >> engine.audio_out(1);
//    player.out("0") >> engine.audio_out(2);
//    player.out("1") >> engine.audio_out(3);

gives me a SIGABRT error

void pdsp::Processor::resize( int channelsNum ){
    this->channels.resize(channelsNum); // <-- Thread 1: signal SIGABRT
        for(int i=0; i<channelsNum; ++i){
                this->channels[i].disableAutomaticProcessing();
    }    
}

If i try to setup the engine after patching it complains that the number of outputs does not fit my setup.

    player.out("0") >> engine.audio_out(0);
    player.out("1") >> engine.audio_out(1);
    player.out("0") >> engine.audio_out(2);
    player.out("1") >> engine.audio_out(3);

    engine.listDevices();
    engine.setDeviceID(2);
    engine.setChannels(0, 16);
    engine.setup( 44100, 512, 3);
pdsp::Patchable& pdsp::Engine::audio_out( int channel ){
    
    if(channel < 0 ) channel = 0;
    int maxChannels = processor.channels.size();
  
    if(channel >= maxChannels){
        std::cout<<"[pdsp] warning! requested audio output channel out of range, clamping to max\n";
        #ifdef NDEBUG
        std::cout<<"[pdsp] build in debug mode for triggering an assert\n";
        #endif 
        assert(false); // <-- Thread 1: signal SIGABRT
        channel = maxChannels-1;
    }
    
    return processor.channels[channel];
		   
}

Any ideas?
Thanks Thomas


#2

there is clearly a bug in multichannelling, i just tested on the fly with 4 outputs and pdsp gives me also some warning on the console, can you please file an issue on github?


i’ll try to fix this problem as soon as possible.
After the fix, the steps for multichannelling should be

  1. calling engine.setChannels() then
  2. patching and then
  3. starting the engine()

#3

thanks a lot. i opened an issue on github, let me know if i can help somehow.