SndFileInstrument.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef CSL_SndFile_Instrument_H
00028 #define CSL_SndFile_Instrument_H
00029
00030 #include "Instrument.h"
00031
00032 namespace csl {
00033
00037
00038 class SndFileInstrument : public Instrument {
00039 public:
00040 SndFileInstrument(string path, int start = -1, int stop = -1);
00041 SndFileInstrument(string folder, string path, int start = -1, int stop = -1);
00042 ~SndFileInstrument();
00043
00045 void setParameter(unsigned selector, int argc, void **argv, const char *types);
00047 void play();
00048 void playOSC(int argc, void **argv, const char *types);
00049 void playNote(float ampl = 1, float rate = 1, float pos = 0, int start = -1, int stop = -1,
00050 float attack = 0.0, float decay = 0.0);
00051
00053 SoundFile mPlayer;
00054 AR mEnvelope;
00055 Panner mPanner;
00056 StaticVariable mRate;
00057 int mStart, mStop;
00058 protected:
00059 void initialize(string path);
00060
00061 };
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00079
00080 class SampleBankInstrument : public SndFileInstrument {
00081 public:
00082 SampleBankInstrument();
00083 ~SampleBankInstrument();
00084
00085 void addSample(SoundFile & sndFile, unsigned midi = 0, double freq = 0.0, double minRatio = 0.75);
00086
00087 void play();
00088 void playOSC(int argc, void **argv, const char *types);
00089 void playNote(float ampl = 1, float rate = 1, float pos = 0, int start = -1, int stop = -1,
00090 float attack = 0.0, float decay = 0.0);
00091
00092 protected:
00093
00094
00095 };
00096
00097 }
00098
00099 #endif