| 35 | } // anonymous namespace |
| 36 | |
| 37 | void AudioController::setup() |
| 38 | { |
| 39 | auto ctx = audio::master(); |
| 40 | mMasterGain = ctx->makeNode( new audio::GainNode( 0.1 ) ); |
| 41 | mAltoLowpass = ctx->makeNode( new audio::FilterLowPassNode ); |
| 42 | |
| 43 | mSawtoothTable.reset( new audio::WaveTable2d( ctx->getSampleRate(), DEFAULT_TABLE_SIZE, DEFAULT_BANDLIMITED_TABLES ) ); |
| 44 | mSawtoothTable->fillBandlimited( audio::WaveformType::SAWTOOTH ); |
| 45 | |
| 46 | for( size_t i = 0; i < ALTO_BANK_SIZE; i++ ) { |
| 47 | auto synth = make_shared<AltoSynth>( this ); |
| 48 | synth->getOutput() >> mAltoLowpass; |
| 49 | |
| 50 | mAltoSynthBank.push_back( synth ); |
| 51 | mAllSynths.push_back( synth ); |
| 52 | } |
| 53 | |
| 54 | for( size_t i = 0; i < BASS_BANK_SIZE; i++ ) { |
| 55 | auto synth = make_shared<BassSynth>( this ); |
| 56 | synth->getOutput() >> mMasterGain; |
| 57 | |
| 58 | mBassSynthBank.push_back( synth ); |
| 59 | mAllSynths.push_back( synth ); |
| 60 | } |
| 61 | |
| 62 | mAltoLowpass >> mMasterGain; |
| 63 | mMasterGain >> ctx->getOutput(); |
| 64 | ctx->enable(); |
| 65 | |
| 66 | // CI_LOG_V( "audio graph:\n" << ctx->printGraphToString() ); |
| 67 | } |
| 68 | |
| 69 | void AudioController::setMasterGain( float gainDb ) |
| 70 | { |
nothing calls this directly
no test coverage detected