Mercurial > hg > opencollidoscope
diff CollidoscopeApp/src/AudioEngine.cpp @ 2:dd889fff8423
added some comments
author | Fiore Martin <f.martin@qmul.ac.uk> |
---|---|
date | Mon, 11 Jul 2016 17:03:40 +0200 |
parents | 02467299402e |
children | 75b744078d66 |
line wrap: on
line diff
--- a/CollidoscopeApp/src/AudioEngine.cpp Fri Jul 08 11:39:18 2016 +0200 +++ b/CollidoscopeApp/src/AudioEngine.cpp Mon Jul 11 17:03:40 2016 +0200 @@ -5,6 +5,7 @@ using namespace ci::audio; +/* Frequency ratios in the chromatic scale */ double chromaticRatios[] = { 1, 1.0594630943591, @@ -20,6 +21,14 @@ 1.8877486253586 }; + +/* + * Calculates the ratio between the frequency of the midi note passed as argument and middle C note ( MIDI value = 60 ). + * This is used for pitch shifting the granular synth output, according to the key pressed by the user. + * The middle C is taken as reference in pitch in the pitch shifting of Collidoscope output. + * That is, with the middle C the output is not pitch shifted at all and is equal in frequency to the recorder sample. + * + */ inline double calculateMidiNoteRatio( int midiNote ) { int distanceFromCenter = midiNote - 60; // 60 is the central midi note @@ -174,6 +183,7 @@ return mBufferRecorderNodes[waveIdx]->getRingBuffer().getAvailableRead(); } + bool AudioEngine::readRecordWave( size_t waveIdx, RecordWaveMsg* buffer, size_t count ) { return mBufferRecorderNodes[waveIdx]->getRingBuffer().read( buffer, count );