Revision 2:dd889fff8423 CollidoscopeApp/src
| CollidoscopeApp/src/AudioEngine.cpp | ||
|---|---|---|
| 5 | 5 |
|
| 6 | 6 |
using namespace ci::audio; |
| 7 | 7 |
|
| 8 |
/* Frequency ratios in the chromatic scale */ |
|
| 8 | 9 |
double chromaticRatios[] = {
|
| 9 | 10 |
1, |
| 10 | 11 |
1.0594630943591, |
| ... | ... | |
| 20 | 21 |
1.8877486253586 |
| 21 | 22 |
}; |
| 22 | 23 |
|
| 24 |
|
|
| 25 |
/* |
|
| 26 |
* Calculates the ratio between the frequency of the midi note passed as argument and middle C note ( MIDI value = 60 ). |
|
| 27 |
* This is used for pitch shifting the granular synth output, according to the key pressed by the user. |
|
| 28 |
* The middle C is taken as reference in pitch in the pitch shifting of Collidoscope output. |
|
| 29 |
* That is, with the middle C the output is not pitch shifted at all and is equal in frequency to the recorder sample. |
|
| 30 |
* |
|
| 31 |
*/ |
|
| 23 | 32 |
inline double calculateMidiNoteRatio( int midiNote ) |
| 24 | 33 |
{
|
| 25 | 34 |
int distanceFromCenter = midiNote - 60; // 60 is the central midi note |
| ... | ... | |
| 174 | 183 |
return mBufferRecorderNodes[waveIdx]->getRingBuffer().getAvailableRead(); |
| 175 | 184 |
} |
| 176 | 185 |
|
| 186 |
|
|
| 177 | 187 |
bool AudioEngine::readRecordWave( size_t waveIdx, RecordWaveMsg* buffer, size_t count ) |
| 178 | 188 |
{
|
| 179 | 189 |
return mBufferRecorderNodes[waveIdx]->getRingBuffer().read( buffer, count ); |
| CollidoscopeApp/src/Config.cpp | ||
|---|---|---|
| 17 | 17 |
|
| 18 | 18 |
} |
| 19 | 19 |
|
| 20 |
|
|
| 20 |
// uses Cinder api to parse configuration in XML file |
|
| 21 | 21 |
void Config::loadFromFile( std::string&& path ) |
| 22 | 22 |
{
|
| 23 | 23 |
try {
|
| CollidoscopeApp/src/MIDI.cpp | ||
|---|---|---|
| 131 | 131 |
msg.mData2 = (numBytes == 3 ? (*rtMidiMessage)[2] : 0); |
| 132 | 132 |
|
| 133 | 133 |
return msg; |
| 134 |
} |
|
| 134 |
} |
|
Also available in: Unified diff