Mercurial > hg > svapp
comparison audioio/AudioGenerator.cpp @ 37:58cf1620d6e3
* Add units repository, and unit property on time-value and note layers.
author | Chris Cannam |
---|---|
date | Thu, 11 May 2006 15:02:14 +0000 |
parents | b9e76c9e631c |
children | 54287e5e7451 |
comparison
equal
deleted
inserted
replaced
36:b9e76c9e631c | 37:58cf1620d6e3 |
---|---|
16 #include "AudioGenerator.h" | 16 #include "AudioGenerator.h" |
17 | 17 |
18 #include "base/TempDirectory.h" | 18 #include "base/TempDirectory.h" |
19 #include "base/PlayParameters.h" | 19 #include "base/PlayParameters.h" |
20 #include "base/PlayParameterRepository.h" | 20 #include "base/PlayParameterRepository.h" |
21 #include "base/Pitch.h" | |
21 | 22 |
22 #include "model/NoteModel.h" | 23 #include "model/NoteModel.h" |
23 #include "model/DenseTimeValueModel.h" | 24 #include "model/DenseTimeValueModel.h" |
24 #include "model/SparseOneDimensionalModel.h" | 25 #include "model/SparseOneDimensionalModel.h" |
25 | 26 |
689 } | 690 } |
690 | 691 |
691 Vamp::RealTime eventTime = Vamp::RealTime::frame2RealTime | 692 Vamp::RealTime eventTime = Vamp::RealTime::frame2RealTime |
692 (pliFrame, m_sourceSampleRate); | 693 (pliFrame, m_sourceSampleRate); |
693 | 694 |
694 onEv.data.note.note = lrintf(pli->value); | 695 if (nm->getScaleUnits() == "Hz") { |
696 onEv.data.note.note = Pitch::getPitchForFrequency(pli->value); | |
697 } else { | |
698 onEv.data.note.note = lrintf(pli->value); | |
699 } | |
695 | 700 |
696 plugin->sendEvent(eventTime, &onEv); | 701 plugin->sendEvent(eventTime, &onEv); |
697 | 702 |
698 #ifdef DEBUG_AUDIO_GENERATOR | 703 #ifdef DEBUG_AUDIO_GENERATOR |
699 std::cout << "mixModel [note]: point at frame " << pliFrame << ", block start " << (startFrame + i * m_pluginBlockSize) << ", resulting time " << eventTime << std::endl; | 704 std::cout << "mixModel [note]: point at frame " << pliFrame << ", block start " << (startFrame + i * m_pluginBlockSize) << ", resulting time " << eventTime << std::endl; |