Mercurial > hg > svgui
comparison widgets/UnitConverter.cpp @ 1159:8a5f0c8d5608 3.0-integration
Merge from branch piper
author | Chris Cannam |
---|---|
date | Fri, 28 Oct 2016 15:20:58 +0100 |
parents | 8e4b90aeefaa |
children | a34a2a25907c |
comparison
equal
deleted
inserted
replaced
1152:fc00a06feecd | 1159:8a5f0c8d5608 |
---|---|
323 double cents = 0; | 323 double cents = 0; |
324 int pitch = Pitch::getPitchForFrequency(m_freq->value(), ¢s); | 324 int pitch = Pitch::getPitchForFrequency(m_freq->value(), ¢s); |
325 int note, octave; | 325 int note, octave; |
326 Pitch::getNoteAndOctaveForPitch(pitch, note, octave); | 326 Pitch::getNoteAndOctaveForPitch(pitch, note, octave); |
327 | 327 |
328 cerr << "pitch " << pitch << " note " << note << " octave " << octave << " cents " << cents << endl; | 328 // cerr << "pitch " << pitch << " note " << note << " octave " << octave << " cents " << cents << endl; |
329 | 329 |
330 setTo(m_midi, pitch); | 330 setTo(m_midi, pitch); |
331 setTo(m_cents, cents); | 331 setTo(m_cents, cents); |
332 setTo(m_octave, octave); | 332 setTo(m_octave, octave); |
333 | 333 |
385 UnitConverter::updateTempiFromSamples() | 385 UnitConverter::updateTempiFromSamples() |
386 { | 386 { |
387 double samples = m_samples->value(); | 387 double samples = m_samples->value(); |
388 double rate = getSampleRate(); | 388 double rate = getSampleRate(); |
389 | 389 |
390 cerr << samples << " samples at rate " << rate << endl; | 390 // cerr << samples << " samples at rate " << rate << endl; |
391 | 391 |
392 double sec = samples / rate; | 392 double sec = samples / rate; |
393 double hz = rate / samples; | 393 double hz = rate / samples; |
394 double bpm = 60.0 / sec; | 394 double bpm = 60.0 / sec; |
395 | 395 |