Esempio n. 1
0
void ProcessorGraph::createDefaultNodes()
{

    // add output node -- sends output to the audio card
    AudioProcessorGraph::AudioGraphIOProcessor* on =
        new AudioProcessorGraph::AudioGraphIOProcessor(AudioProcessorGraph::AudioGraphIOProcessor::audioOutputNode);

    // add record node -- sends output to disk
    RecordNode* recn = new RecordNode();
    recn->setNodeId(RECORD_NODE_ID);


    // add audio node -- takes all inputs and selects those to be used for audio monitoring
    AudioNode* an = new AudioNode();
    an->setNodeId(AUDIO_NODE_ID);

    // add audio resampling node -- resamples continuous signals to 44.1kHz
    AudioResamplingNode* arn = new AudioResamplingNode();
    arn->setNodeId(RESAMPLING_NODE_ID);

    // add message center
    MessageCenter* msgCenter = new MessageCenter();
    msgCenter->setNodeId(MESSAGE_CENTER_ID);

    addNode(on, OUTPUT_NODE_ID);
    addNode(recn, RECORD_NODE_ID);
    addNode(an, AUDIO_NODE_ID);
    addNode(arn, RESAMPLING_NODE_ID);
    addNode(msgCenter, MESSAGE_CENTER_ID);

}
Esempio n. 2
0
void ProcessorGraph::createDefaultNodes()
{

    // add output node -- sends output to the audio card
    AudioProcessorGraph::AudioGraphIOProcessor* on =
        new AudioProcessorGraph::AudioGraphIOProcessor(AudioProcessorGraph::AudioGraphIOProcessor::audioOutputNode);

    // add record node -- sends output to disk
    RecordNode* recn = new RecordNode();
    recn->setNodeId(RECORD_NODE_ID);


    // add audio node -- takes all inputs and selects those to be used for audio monitoring
    AudioNode* an = new AudioNode();
    an->setNodeId(AUDIO_NODE_ID);


    // add audio resampling node -- resamples continuous signals to 44.1kHz
    AudioResamplingNode* arn = new AudioResamplingNode();
    arn->setNodeId(RESAMPLING_NODE_ID);

    addNode(on, OUTPUT_NODE_ID);
    addNode(recn, RECORD_NODE_ID);
    addNode(an, AUDIO_NODE_ID);
    addNode(arn, RESAMPLING_NODE_ID);

    // connect audio subnetwork
    for (int n = 0; n < 2; n++)
    {

        addConnection(AUDIO_NODE_ID, n,
                      RESAMPLING_NODE_ID, n);

        addConnection(RESAMPLING_NODE_ID, n,
                      OUTPUT_NODE_ID, n);

    }

    addConnection(AUDIO_NODE_ID, midiChannelIndex,
                  RESAMPLING_NODE_ID, midiChannelIndex);

    std::cout << "Default nodes created." << std::endl;

}