9 #ifndef INCLUDE_Instrument_H
10 #define INCLUDE_Instrument_H
19 #define set_duration_f 100 // basic accessors: dur, amp, freq, pos
20 #define set_amplitude_f 101
21 #define set_frequency_f 102
22 #define set_position_f 103 // position as a float or a point
23 #define set_position_p 104
25 #define set_attack_f 105 // ADSR envelope
26 #define set_decay_f 106
27 #define set_sustain_f 107
28 #define set_release_f 108
30 #define set_iattack_f 110 // 2nd ADSR envelope (index, mod)
31 #define set_idecay_f 111
32 #define set_isustain_f 112
33 #define set_irelease_f 113
35 #define set_index_f 114 // Various frequencies
36 #define set_c_freq_f 115
37 #define set_m_freq_f 116
39 #define set_vib_depth_f 120 // Vibrato, attack-chiff
40 #define set_chiff_amt_f 121
41 #define set_chiff_time_f 122
43 #define set_rate_f 125 // Sampler file, start, stop, rate
44 #define set_file_f 126
45 #define set_start_f 127
46 #define set_stop_f 128
48 #define set_partial_f 130 // SumOfSines partial and partial list
49 #define set_partials_f 131
74 virtual void setParameter(
unsigned selector,
int argc,
void **argv,
const char *types) { };
81 virtual void playOSC(
int argc,
void **argv,
const char *types) { };
82 virtual void playNote(
int argc,
void **argv,
const char *types) { };
83 virtual void playMIDI(
float dur,
int chan,
int key,
int vel) { };
virtual void nextBuffer(Buffer &outputBuffer)
set a named parameter
AdditiveInstrument.h – Sum-of-sines synthesis instrument class.
virtual void playNote(int argc, void **argv, const char *types)
Play a note (subclasses refine)
virtual void playMIDI(float dur, int chan, int key, int vel)
UnitGenerator * mGraph
Caches.
UnitGenerator * graph()
Accessors.
AccessorVector mAccessors
the accessor vector
AccessorVector getAccessors()
Accessor management.
UGenMap * genMap()
my UGen graph
UGenVector * envelopes()
the map of ugens in the graph by name
std::map< std::string, UnitGenerator * > UGenMap
UGenMap: a named map of unit generators (used for GUIs)
Instrument class (abstract)
std::vector< UnitGenerator * > UGenVector
vector< Accessor * > AccessorVector
Typedef for AccessorVector object.
virtual bool isActive()
Envelope query and re-trigger.
const string name()
the vector of envelopes to query or trigger
virtual void setParameter(unsigned selector, int argc, void **argv, const char *types)
answer the number of accessors
UnitGenerator * genNamed(string name)
answer my name answer the number of channels
unsigned numAccessors()
answer the accessor vector
Buffer – the multi-channel sample buffer class (passed around between generators and IO guys)...
Instrument()
Constructors.
virtual void playOSC(int argc, void **argv, const char *types)
UGenVector mEnvelopes
the vector of envelopes to query or trigger
Base class of CSL exceptions (written upper-case). Has a string message.
UGenMap mUGens
the map of ugens in the graph by name