comparison audioio/AudioGenerator.h @ 313:58582119c92a tonioni

Add a basic continuous synth implementation (simple sinusoids only, no gaps)
author Chris Cannam
date Wed, 08 Jan 2014 13:07:22 +0000
parents 71050ffd0141
children 5c69d40a0e30
comparison
equal deleted inserted replaced
312:faee60602049 313:58582119c92a
21 class FlexiNoteModel; 21 class FlexiNoteModel;
22 class DenseTimeValueModel; 22 class DenseTimeValueModel;
23 class SparseOneDimensionalModel; 23 class SparseOneDimensionalModel;
24 class Playable; 24 class Playable;
25 class ClipMixer; 25 class ClipMixer;
26 class ContinuousSynth;
26 27
27 #include <QObject> 28 #include <QObject>
28 #include <QMutex> 29 #include <QMutex>
29 30
30 #include <set> 31 #include <set>
120 typedef std::map<const Model *, ClipMixer *> ClipMixerMap; 121 typedef std::map<const Model *, ClipMixer *> ClipMixerMap;
121 122
122 typedef std::multiset<NoteOff, NoteOff::Comparator> NoteOffSet; 123 typedef std::multiset<NoteOff, NoteOff::Comparator> NoteOffSet;
123 typedef std::map<const Model *, NoteOffSet> NoteOffMap; 124 typedef std::map<const Model *, NoteOffSet> NoteOffMap;
124 125
126 typedef std::map<const Model *, ContinuousSynth *> ContinuousSynthMap;
127
125 QMutex m_mutex; 128 QMutex m_mutex;
129
126 ClipMixerMap m_clipMixerMap; 130 ClipMixerMap m_clipMixerMap;
127 NoteOffMap m_noteOffs; 131 NoteOffMap m_noteOffs;
128 static QString m_sampleDir; 132 static QString m_sampleDir;
129 133
134 ContinuousSynthMap m_continuousSynthMap;
135
136 bool usesClipMixer(const Model *);
137 bool usesContinuousSynth(const Model *);
138
130 ClipMixer *makeClipMixerFor(const Model *model); 139 ClipMixer *makeClipMixerFor(const Model *model);
140 ContinuousSynth *makeSynthFor(const Model *model);
131 141
132 static void initialiseSampleDir(); 142 static void initialiseSampleDir();
133 143
134 virtual size_t mixDenseTimeValueModel 144 virtual size_t mixDenseTimeValueModel
135 (DenseTimeValueModel *model, size_t startFrame, size_t frameCount, 145 (DenseTimeValueModel *model, size_t startFrame, size_t frameCount,
136 float **buffer, float gain, float pan, size_t fadeIn, size_t fadeOut); 146 float **buffer, float gain, float pan, size_t fadeIn, size_t fadeOut);
137 147
138 virtual size_t mixSyntheticNoteModel 148 virtual size_t mixClipModel
139 (Model *model, size_t startFrame, size_t frameCount, 149 (Model *model, size_t startFrame, size_t frameCount,
140 float **buffer, float gain, float pan, size_t fadeIn, size_t fadeOut); 150 float **buffer, float gain, float pan);
151
152 virtual size_t mixContinuousSynthModel
153 (Model *model, size_t startFrame, size_t frameCount,
154 float **buffer, float gain, float pan);
141 155
142 static const size_t m_processingBlockSize; 156 static const size_t m_processingBlockSize;
143 }; 157 };
144 158
145 #endif 159 #endif