|
EM MIDI Arduino Lib 1.0.1
|
Midi is a driver class for the MIDI module, used for synthesizing music. More...
#include <midi.h>
Public Member Functions | |
| Midi (Stream &stream) | |
| Constructor. | |
| void | NoteOn (const uint8_t channel, const uint8_t midi_note, const uint8_t z) |
| Generate the given MIDI note on the designated channel (0-15). | |
| void | NoteOff (const uint8_t channel, const uint8_t midi_note) |
| Close the note in the specified channel, which was previously opened at a given pitch using the noteOn() command. | |
| void | SetChannelTimbre (const uint8_t channel, const uint8_t bank, const uint8_t timbre) |
| Change the tone of the specified channel. Among them, channel 9 is a dedicated drum channel, and the timbre and notes of channel 9 can be found in reference midi_percussion_note.h . | |
| void | PitchBend (const uint8_t channel, uint16_t pitch_bend_value) |
| Bend the pitch upwards or downwards, with a default swing of+/-1 semitone. | |
| void | PitchBendRange (const uint8_t channel, const uint8_t pitch_bend_range_value) |
| Set the pitch bend range (sensitivity). | |
| void | MidiReset () |
| MIDI system reset sends MIDI system reset command (0xFF) to reset all connected MIDI devices to their initial state. | |
| void | ChannelAllNotesOff (const uint8_t channel) |
| Send a noteOff() for each note on the specified channel. | |
| void | SetChannelVolume (const uint8_t channel, const uint8_t volume) |
| Set specific channel volume. | |
| void | SetAllChannelVolume (const uint8_t volume) |
| Set the volume for all channels. | |
| void | SetReverberation (const uint8_t channel, const uint8_t reverberation_type, const uint8_t reverberation_volume, const uint8_t delay_feedback) |
| Apply reverberation effect to the specified channel. | |
| void | SetChorus (const uint8_t channel, const uint8_t chorus_effect_type, const uint8_t chorus_effect_volume, const uint8_t chorus_effect_feedback, const uint8_t chorus_delay_time) |
| Apply a chorus effect to a specified channel. | |
| void | SetPanPosition (const uint8_t channel, const uint8_t pan_position_value) |
| Set the pan position. | |
| void | SetEqualizer (const uint8_t channel, const EqualizerParameter &equalizer_parameter) |
| Set up a four segment equalizer. | |
| void | SetTuning (const uint8_t channel, const uint8_t fine_tuning, const uint8_t coarse_tuning) |
| Set tone (coarse/fine). | |
| void | SetVibrato (const uint8_t channel, const uint8_t vibrato_rate, const uint8_t vibrato_depth, const uint8_t vibrato_delay_modify) |
| Set vibrato parameters. | |
| void | SetTimeVaryingFilter (const uint8_t channel, const uint8_t cutoff, const uint8_t resonance) |
| Set Time Varying Filter (TVF). | |
| void | SetEnvelope (const uint8_t channel, const uint8_t attack_time, const uint8_t attenuation_time, const uint8_t release_time) |
| Set envelope parameters. | |
| void | SetScaleTuning (const uint8_t channel, const ScaleTuningParameter &scale_tuning_parameter) |
| Set the 12 scale tuning parameters for the specified MIDI channel (independent pitch offset for each semitone). | |
| void | SetModulationWheel (const uint8_t channel, const ModulationWheelParameter &modulation_wheel_parameter) |
| Set modulation wheel parameters and configure multiple control effects for modulation wheel sound. | |
| void | AllDrums () |
| Activate all drum channels and set all 16 MIDI channels (0-15) as drum channels. | |
Midi is a driver class for the MIDI module, used for synthesizing music.
| em::Midi::Midi | ( | Stream & | stream | ) |
| void em::Midi::AllDrums | ( | ) |
| void em::Midi::ChannelAllNotesOff | ( | const uint8_t | channel | ) |
| void em::Midi::MidiReset | ( | ) |
| void em::Midi::NoteOff | ( | const uint8_t | channel, |
| const uint8_t | midi_note ) |
Close the note in the specified channel, which was previously opened at a given pitch using the noteOn() command.
| channel | Designated channel (0-15). |
| midi_note | MIDI notes (0-127), please refer to midi_note.h for reference; Among them, for the notes of channel 9, please refer to midi_percussion_note.h. |
| void em::Midi::NoteOn | ( | const uint8_t | channel, |
| const uint8_t | midi_note, | ||
| const uint8_t | z ) |
Generate the given MIDI note on the designated channel (0-15).
| channel | Designated channel (0-15). |
| midi_note | MIDI notes (0-127), please refer to midi_note.h for reference; Among them, for the notes of channel 9, please refer to midi_percussion_note.h. |
| note_velocity | Note velocity (0-127), controls the volume and tone brightness of notes, on a keyboard this corresponds to how hard the key,0: silent (equivalent to noteOff), 1-126: from weak to strong, 127: maximum strength. |
| void em::Midi::PitchBend | ( | const uint8_t | channel, |
| uint16_t | pitch_bend_value ) |
| void em::Midi::PitchBendRange | ( | const uint8_t | channel, |
| const uint8_t | pitch_bend_range_value ) |
| void em::Midi::SetAllChannelVolume | ( | const uint8_t | volume | ) |
| void em::Midi::SetChannelTimbre | ( | const uint8_t | channel, |
| const uint8_t | bank, | ||
| const uint8_t | timbre ) |
Change the tone of the specified channel. Among them, channel 9 is a dedicated drum channel, and the timbre and notes of channel 9 can be found in reference midi_percussion_note.h .
| channel | Designated channels (0-15), where channel 9 is a dedicated drum group channel. |
| bank | Selection of timbre library, with parameter values of MIDI_BANK_0 or MIDI_BANK_127. |
| timbre | Timbre number (0-127), please refer to the macro in reference midi_timbre.h (e.g. EM_MIDI_TIMBRE_BANK_0_GRAND_PIANO); Among them, for the timbre of channel 9, please refer to midi_percussion_note.h . |
| void em::Midi::SetChannelVolume | ( | const uint8_t | channel, |
| const uint8_t | volume ) |
| void em::Midi::SetChorus | ( | const uint8_t | channel, |
| const uint8_t | chorus_effect_type, | ||
| const uint8_t | chorus_effect_volume, | ||
| const uint8_t | chorus_effect_feedback, | ||
| const uint8_t | chorus_delay_time ) |
Apply a chorus effect to a specified channel.
| channel | Designated channel (0-15). |
| chorus_effect_type | chorus effect type, refer to macros in midi_chorus_reverberation.h (e.g., EM_MIDI_CHORUS_1). |
| chorus_effect_volume | chorus effect sending volume (0-127), 0: none, 127: maximum sending volume. |
| chorus_effect_feedback | Effect feedback amount (0-127, 0 means not set). |
| chorus_delay_time | chorus delay time (0-127, 0 indicates not set), unit: ms. |
| void em::Midi::SetEnvelope | ( | const uint8_t | channel, |
| const uint8_t | attack_time, | ||
| const uint8_t | attenuation_time, | ||
| const uint8_t | release_time ) |
Set envelope parameters.
| channel | Designated channel (0-15). |
| attack_time | Attack time (0-127) - controls the time for the sound to reach its maximum amplitude from zero, unit: ms. |
| attenuation_time | Attenuation time (0-127) - controls the time for sound to decay from maximum amplitude to maintain a level, unit: ms. |
| release_time | Release time (0-127) - controls the time it takes for the volume to decay to zero after the note is released, unit: ms. |
| void em::Midi::SetEqualizer | ( | const uint8_t | channel, |
| const EqualizerParameter & | equalizer_parameter ) |
| void em::Midi::SetModulationWheel | ( | const uint8_t | channel, |
| const ModulationWheelParameter & | modulation_wheel_parameter ) |
| void em::Midi::SetPanPosition | ( | const uint8_t | channel, |
| const uint8_t | pan_position_value ) |
| void em::Midi::SetReverberation | ( | const uint8_t | channel, |
| const uint8_t | reverberation_type, | ||
| const uint8_t | reverberation_volume, | ||
| const uint8_t | delay_feedback ) |
Apply reverberation effect to the specified channel.
| channel | Designated channel (0-15). |
| reverberation_type | Reverberation type, refer to macros in midi_chorus_reverberation.h (e.g., EM_MIDI_REVERBERATION_ROOM_1). |
| reverberation_volume | Reverberation transmission amount (0-127), 0: no reverberation, 127: maximum reverberation amount. |
| delay_feedback | Delayed feedback quantity (0-127), 0: no feedback, 127: maximum feedback. |
| void em::Midi::SetScaleTuning | ( | const uint8_t | channel, |
| const ScaleTuningParameter & | scale_tuning_parameter ) |
Set the 12 scale tuning parameters for the specified MIDI channel (independent pitch offset for each semitone).
| channel | Designated channel (0-15). |
| scale_tuning_parameter | Set the 12 scale tuning parameters(C, C#, D, D#, E, F, F#, G, G#, A, A#, B) for the specified channel (independent pitch offset for each semitone). |
| void em::Midi::SetTimeVaryingFilter | ( | const uint8_t | channel, |
| const uint8_t | cutoff, | ||
| const uint8_t | resonance ) |
Set Time Varying Filter (TVF).
| channel | Designated channel (0-15). |
| cutoff | Cut off frequency value (0-127) - controls the frequency range that the filter passes through. |
| resonance | Resonance peak/resonance value (0-127) - Control the gain of the filter near the cutoff frequency. |
| void em::Midi::SetTuning | ( | const uint8_t | channel, |
| const uint8_t | fine_tuning, | ||
| const uint8_t | coarse_tuning ) |
| void em::Midi::SetVibrato | ( | const uint8_t | channel, |
| const uint8_t | vibrato_rate, | ||
| const uint8_t | vibrato_depth, | ||
| const uint8_t | vibrato_delay_modify ) |
Set vibrato parameters.
| channel | Designated channel (0-15). |
| vibrato_rate | Vibrato rate (0-127) - controls the speed of vibrato oscillation. |
| vibrato_depth | Vibrato depth (0-127) - controls the amplitude of vibrato oscillation. |
| vibrato_delay_modify | Vibrato Delay Modification (0-127) - Control the delay time before the start of vibrato. |