summaryrefslogtreecommitdiff
path: root/synth/channel.h
diff options
context:
space:
mode:
Diffstat (limited to 'synth/channel.h')
-rw-r--r--synth/channel.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/synth/channel.h b/synth/channel.h
new file mode 100644
index 0000000..ead3a67
--- /dev/null
+++ b/synth/channel.h
@@ -0,0 +1,63 @@
+#ifndef __CHANNEL_H__
+#define __CHANNEL_H__
+
+
+#include <stdint.h>
+#include <list>
+
+#include "fixed.h"
+#include "programs.h"
+#include "note.h"
+#include "defines.h"
+#include "util.h"
+
+
+class Channel
+{
+ public:
+ Channel();
+ ~Channel();
+ fixed_t get_sample();
+ void event(uint8_t a, uint8_t b, uint8_t c);
+ void set_controller(int con,int val);
+ void set_program(int prog);
+ void set_pitch_bend(float val);
+ void note_on(int note, int vel);
+ void note_off(int note);
+ void cleanup();
+ void release_all();
+ void panic();
+ void set_real_portamento_frames();
+ void set_portamento_time(int val);
+ void set_portamento(int val);
+ void set_volume(int val);
+ void set_balance(int val);
+ void set_n_voices(int val);
+ void set_quick_release(int val);
+ void reset_controllers();
+
+ float balL, balR;
+ private:
+ void recalc_param(const parameter_t &par, program_t &prg);
+ void set_user_controller(int con, int val);
+ void apply_voice_limit();
+
+ fixed_t volume;
+ fixed_t portamento_frames, portamento_frames2;
+ int program;
+ program_t curr_prg;
+
+ fixed_t pitchbend;
+ float max_pitchbend;
+
+ std::list<Note*> notes;
+
+ bool always_reattack;
+ bool do_portamento;
+
+ int n_voices;
+ jack_nframes_t quick_release;
+
+};
+
+#endif