-
Notifications
You must be signed in to change notification settings - Fork 0
/
MPI_AudioParticleSpace.h
49 lines (33 loc) · 1.22 KB
/
MPI_AudioParticleSpace.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//
// MPI_AudioParticleSpace.h
//
// Description:
// A particle space which plays a wavetable based on the movement of its
// elements.
//
#ifndef __MPI_AUDIOPARTICLESPACE_H__
#define __MPI_AUDIOPARTICLESPACE_H__
#include "MPI_ParticleSpace.h"
#include "MPI_AudioWavetableSynth.h"
class MPI_Audio;
class MPI_AudioWavetable;
class MPI_CanonicalTimeArclengthMap;
class MPI_AudioParticleSpace : public MPI_ParticleSpace
{
public:
MPI_AudioParticleSpace( MPI_Audio &audioinstance, MPI_AudioWavetable &wavetable, MPI_CanonicalTimeArclengthMap const& canonicaltimearclengthmap );
virtual void addElement( MPI_OneSpaceElement *element, float position );
virtual void removeElement( MPI_OneSpaceElement const *element );
void refreshPlayRate( void );
MPI_AudioWavetable const& getWavetable( void ) const;
private:
float arclengthToWavetableSeconds( float arclengthpos ) const;
float getPlayRate( float canonicalpos ) const;
float canonicalToWavetableSamples( float canonicalpos ) const;
MPI_AudioWavetableSynth wavetablesynth_;
MPI_OneSpaceElement *playhead_;
MPI_CanonicalTimeArclengthMap const& canonicaltimearclengthmap_;
const float resamplingperiod_;
};
#endif
// vim:sw=4:et:cindent: