Mercurial > hg > svapp
comparison audio/AudioGenerator.cpp @ 646:3168deb50199 single-point
Updates for single-point changes, including removal of FlexiNoteModel
author | Chris Cannam |
---|---|
date | Thu, 14 Mar 2019 15:33:40 +0000 |
parents | 6240788893e7 |
children | 284cb118368e |
comparison
equal
deleted
inserted
replaced
645:6240788893e7 | 646:3168deb50199 |
---|---|
20 #include "base/PlayParameterRepository.h" | 20 #include "base/PlayParameterRepository.h" |
21 #include "base/Pitch.h" | 21 #include "base/Pitch.h" |
22 #include "base/Exceptions.h" | 22 #include "base/Exceptions.h" |
23 | 23 |
24 #include "data/model/NoteModel.h" | 24 #include "data/model/NoteModel.h" |
25 #include "data/model/FlexiNoteModel.h" | |
26 #include "data/model/DenseTimeValueModel.h" | 25 #include "data/model/DenseTimeValueModel.h" |
27 #include "data/model/SparseTimeValueModel.h" | 26 #include "data/model/SparseTimeValueModel.h" |
28 #include "data/model/SparseOneDimensionalModel.h" | 27 #include "data/model/SparseOneDimensionalModel.h" |
29 #include "base/NoteData.h" | 28 #include "base/NoteData.h" |
30 | 29 |
183 bool | 182 bool |
184 AudioGenerator::usesClipMixer(const Model *model) | 183 AudioGenerator::usesClipMixer(const Model *model) |
185 { | 184 { |
186 bool clip = | 185 bool clip = |
187 (qobject_cast<const SparseOneDimensionalModel *>(model) || | 186 (qobject_cast<const SparseOneDimensionalModel *>(model) || |
188 qobject_cast<const NoteModel *>(model) || | 187 qobject_cast<const NoteModel *>(model)); |
189 qobject_cast<const FlexiNoteModel *>(model)); | |
190 return clip; | 188 return clip; |
191 } | 189 } |
192 | 190 |
193 bool | 191 bool |
194 AudioGenerator::wantsQuieterClips(const Model *model) | 192 AudioGenerator::wantsQuieterClips(const Model *model) |
195 { | 193 { |
196 // basically, anything that usually has sustain (like notes) or | 194 // basically, anything that usually has sustain (like notes) or |
197 // often has multiple sounds at once (like notes) wants to use a | 195 // often has multiple sounds at once (like notes) wants to use a |
198 // quieter level than simple click tracks | 196 // quieter level than simple click tracks |
199 bool does = | 197 bool does = (qobject_cast<const NoteModel *>(model)); |
200 (qobject_cast<const NoteModel *>(model) || | |
201 qobject_cast<const FlexiNoteModel *>(model)); | |
202 return does; | 198 return does; |
203 } | 199 } |
204 | 200 |
205 bool | 201 bool |
206 AudioGenerator::usesContinuousSynth(const Model *model) | 202 AudioGenerator::usesContinuousSynth(const Model *model) |
557 | 553 |
558 NoteOffSet ¬eOffs = m_noteOffs[model->getId()]; | 554 NoteOffSet ¬eOffs = m_noteOffs[model->getId()]; |
559 | 555 |
560 float **bufferIndexes = new float *[m_targetChannelCount]; | 556 float **bufferIndexes = new float *[m_targetChannelCount]; |
561 | 557 |
558 //!!! + for first block, prime with notes already active | |
559 | |
562 for (int i = 0; i < blocks; ++i) { | 560 for (int i = 0; i < blocks; ++i) { |
563 | 561 |
564 sv_frame_t reqStart = startFrame + i * m_processingBlockSize; | 562 sv_frame_t reqStart = startFrame + i * m_processingBlockSize; |
565 | 563 |
566 NoteList notes; | 564 NoteList notes; |
567 NoteExportable *exportable = dynamic_cast<NoteExportable *>(model); | 565 NoteExportable *exportable = dynamic_cast<NoteExportable *>(model); |
568 if (exportable) { | 566 if (exportable) { |
569 notes = exportable->getNotesWithin(reqStart, | 567 notes = exportable->getNotesStartingWithin(reqStart, |
570 reqStart + m_processingBlockSize); | 568 m_processingBlockSize); |
571 } | 569 } |
572 | 570 |
573 std::vector<ClipMixer::NoteStart> starts; | 571 std::vector<ClipMixer::NoteStart> starts; |
574 std::vector<ClipMixer::NoteEnd> ends; | 572 std::vector<ClipMixer::NoteEnd> ends; |
575 | 573 |