3 #ifndef SPECTMORPH_MIDI_SYNTH_HH 4 #define SPECTMORPH_MIDI_SYNTH_HH 6 #include "smmorphplansynth.hh" 35 double pitch_bend_freq;
36 double pitch_bend_factor;
54 std::vector<Voice> voices;
55 std::vector<Voice *> idle_voices;
56 std::vector<Voice *> active_voices;
59 size_t audio_time_stamp;
61 float portamento_glide;
62 int portamento_note_id;
68 void free_unused_voices();
69 bool update_mono_voice();
70 float freq_from_note (
float note);
72 void set_mono_enabled (
bool new_value);
73 void process_audio (
float *output,
size_t n_values);
74 void process_note_on (
int channel,
int midi_note,
int midi_velocity);
75 void process_note_off (
int midi_note);
76 void process_midi_controller (
int controller,
int value);
77 void process_pitch_bend (
int channel,
double semi_tones);
78 void start_pitch_bend (Voice *voice,
double dest_freq,
double time_ms);
85 bool is_note_on()
const;
86 bool is_note_off()
const;
87 bool is_controller()
const;
88 bool is_pitch_bend()
const;
91 std::vector<MidiEvent> midi_events;
94 MidiSynth (
double mix_freq,
size_t n_voices);
96 void add_midi_event (
size_t offset,
const unsigned char *midi_data);
97 void process (
float *output,
size_t n_values);
99 void set_control_input (
int i,
float value);
102 size_t active_voice_count()
const;
Definition: smmorphplansynth.hh:15
Definition: smmorphplanvoice.hh:14
Definition: smalignedarray.cc:7
Definition: smmidisynth.hh:10