MCPcopy Create free account
hub / github.com/cinder/Cinder / printBinInfo

Method printBinInfo

samples/_audio/InputAnalyzer/src/InputAnalyzerApp.cpp:129–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129void InputAnalyzer::printBinInfo( int mouseX )
130{
131 size_t numBins = mMonitorSpectralNode->getFftSize() / 2;
132 size_t bin = std::min( numBins - 1, size_t( ( numBins * ( mouseX - mSpectrumPlot.getBounds().x1 ) ) / mSpectrumPlot.getBounds().getWidth() ) );
133
134 float binFreqWidth = mMonitorSpectralNode->getFreqForBin( 1 ) - mMonitorSpectralNode->getFreqForBin( 0 );
135 float freq = mMonitorSpectralNode->getFreqForBin( bin );
136 float mag = audio::linearToDecibel( mMagSpectrum[bin] );
137
138 console() << "bin: " << bin << ", freqency (hertz): " << freq << " - " << freq + binFreqWidth << ", magnitude (decibels): " << mag << endl;
139}
140
141CINDER_APP( InputAnalyzer, RendererGl( RendererGl::Options().msaa( 8 ) ) )

Callers

nothing calls this directly

Calls 6

linearToDecibelFunction · 0.85
getFftSizeMethod · 0.80
getFreqForBinMethod · 0.80
minFunction · 0.50
getBoundsMethod · 0.45
getWidthMethod · 0.45

Tested by

no test coverage detected