| 96 | } |
| 97 | |
| 98 | void NodeAdvancedApp::draw() |
| 99 | { |
| 100 | gl::clear(); |
| 101 | |
| 102 | // Draw the Scope's recorded Buffer in the upper right. |
| 103 | if( mMonitor && mMonitor->getNumConnectedInputs() ) { |
| 104 | Rectf scopeRect( getWindowWidth() - 210, 10, getWindowWidth() - 10, 110 ); |
| 105 | drawAudioBuffer( mMonitor->getBuffer(), scopeRect, true ); |
| 106 | } |
| 107 | |
| 108 | // Visualize the Gen's current pitch with a circle. |
| 109 | |
| 110 | float pitchMin = mCPentatonicScale.front(); |
| 111 | float pitchMax = mCPentatonicScale.back(); |
| 112 | float currentPitch = audio::freqToMidi( mGen->getFreq() ); // MIDI values do not have to be integers for us. |
| 113 | |
| 114 | float percent = ( currentPitch - pitchMin ) / ( pitchMax - pitchMin ); |
| 115 | |
| 116 | float circleX = percent * getWindowWidth(); |
| 117 | |
| 118 | gl::color( 0, 0.8f, 0.8f ); |
| 119 | gl::drawSolidCircle( vec2( circleX, getWindowCenter().y ), 50 ); |
| 120 | } |
| 121 | |
| 122 | CINDER_APP( NodeAdvancedApp, RendererGl( RendererGl::Options().msaa( 4 ) ), []( App::Settings *settings ) { |
| 123 | settings->setMultiTouchEnabled( false ); |
nothing calls this directly
no test coverage detected