Sending proper Program Change MIDI message

This commit is contained in:
Robert Bendun 2022-11-28 02:12:25 +01:00
parent 7f73f3dcad
commit 2630dff5ac
3 changed files with 132 additions and 129 deletions

View File

@ -7,11 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
## [0.3.1]
### Fixed ### Fixed
- release build script was producing executable with wrong path - release build script was producing executable with wrong path
- `examples/for-elise.mq` had bug in it - `examples/for-elise.mq` had bug in it
- in error reporting printing garbage instead of function name was fixed - in error reporting printing garbage instead of function name was fixed
- sending proper program change message
## [0.3.0] ## [0.3.0]

View File

@ -4,161 +4,161 @@ This may be unsupported by your device.
--------------------------------------------------------- ---------------------------------------------------------
-- Piano ------------------------------------------------ -- Piano ------------------------------------------------
AcousticGrandPiano := 0; AcousticGrandPiano := 0,
BrightAcousticPiano := 1; BrightAcousticPiano := 1,
ElectricGrandPiano := 2; ElectricGrandPiano := 2,
HonkyTonkPiano := 3; HonkyTonkPiano := 3,
RhodesPiano := 4; RhodesPiano := 4,
ChorusedPiano := 5; ChorusedPiano := 5,
Harpsichord := 6; Harpsichord := 6,
Clavinet := 7; Clavinet := 7,
-- Chromatic percussion --------------------------------- -- Chromatic percussion ---------------------------------
Celesta := 8; Celesta := 8,
Glockenspiel := 9; Glockenspiel := 9,
MusicBox := 10; MusicBox := 10,
Vibraphone := 11; Vibraphone := 11,
Marimba := 12; Marimba := 12,
Xylophone := 13; Xylophone := 13,
TubularBells := 14; TubularBells := 14,
Dulcimer := 15; Dulcimer := 15,
-- Organ ------------------------------------------------ -- Organ ------------------------------------------------
HammondOrgan := 16; HammondOrgan := 16,
PercussiveOrgan := 17; PercussiveOrgan := 17,
RockOrgan := 18; RockOrgan := 18,
ChurchOrgan := 19; ChurchOrgan := 19,
ReedOrgan := 20; ReedOrgan := 20,
Accordion := 21; Accordion := 21,
Harmonica := 22; Harmonica := 22,
TangoAccordion := 23; TangoAccordion := 23,
-- Guitar ----------------------------------------------- -- Guitar -----------------------------------------------
AcousticGuitarNylon := 24; AcousticGuitarNylon := 24,
AcousticGuitarSteel := 25; AcousticGuitarSteel := 25,
ElectricGuitarJazz := 26; ElectricGuitarJazz := 26,
ElectricGuitarClean := 27; ElectricGuitarClean := 27,
ElectricGuitarMuted := 28; ElectricGuitarMuted := 28,
OverdrivenGuitar := 29; OverdrivenGuitar := 29,
DistortionGuitar := 30; DistortionGuitar := 30,
GuitarHarmonics := 31; GuitarHarmonics := 31,
-- Bass ------------------------------------------------- -- Bass -------------------------------------------------
AcousticBass := 32; AcousticBass := 32,
ElectricBassFingered := 33; ElectricBassFingered := 33,
ElectricBassPicked := 34; ElectricBassPicked := 34,
FretlessBass := 35; FretlessBass := 35,
SlapBass1 := 36; SlapBass1 := 36,
SlapBass2 := 37; SlapBass2 := 37,
SynthBass1 := 38; SynthBass1 := 38,
SynthBass2 := 39; SynthBass2 := 39,
-- Solo strings ----------------------------------------- -- Solo strings -----------------------------------------
Violin := 40; Violin := 40,
Viola := 41; Viola := 41,
Cello := 42; Cello := 42,
Contrabass := 43; Contrabass := 43,
TremoloStrings := 44; TremoloStrings := 44,
PizzicatoStrings := 45; PizzicatoStrings := 45,
OrchestralHarp := 46; OrchestralHarp := 46,
Timpani := 47; Timpani := 47,
-- Ensamble --------------------------------------------- -- Ensamble ---------------------------------------------
StringEnsemble1 := 48; StringEnsemble1 := 48,
StringEnsemble2 := 49; StringEnsemble2 := 49,
SynthStrings1 := 50; SynthStrings1 := 50,
SynthStrings2 := 51; SynthStrings2 := 51,
ChoirAahs := 52; ChoirAahs := 52,
VoiceOohs := 53; VoiceOohs := 53,
SynthVoice := 54; SynthVoice := 54,
OrchestraHit := 55; OrchestraHit := 55,
-- Brass ------------------------------------------------ -- Brass ------------------------------------------------
Trumpet := 56; Trumpet := 56,
Trombone := 57; Trombone := 57,
Tuba := 58; Tuba := 58,
MutedTrumpet := 59; MutedTrumpet := 59,
FrenchHorn := 60; FrenchHorn := 60,
BrassSection := 61; BrassSection := 61,
SynthBrass1 := 62; SynthBrass1 := 62,
SynthBrass2 := 63; SynthBrass2 := 63,
-- Reed ------------------------------------------------- -- Reed -------------------------------------------------
SopranoSax := 64; SopranoSax := 64,
AltoSax := 65; AltoSax := 65,
TenorSax := 66; TenorSax := 66,
BaritoneSax := 67; BaritoneSax := 67,
Oboe := 68; Oboe := 68,
EnglishHorn := 69; EnglishHorn := 69,
Bassoon := 70; Bassoon := 70,
Clarinet := 71; Clarinet := 71,
-- Pipe ------------------------------------------------- -- Pipe -------------------------------------------------
Piccolo := 72; Piccolo := 72,
Flute := 73; Flute := 73,
Recorder := 74; Recorder := 74,
PanFlute := 75; PanFlute := 75,
BlownBottle := 76; BlownBottle := 76,
Shakuhachi := 77; Shakuhachi := 77,
Whistle := 78; Whistle := 78,
Ocarina := 79; Ocarina := 79,
-- Synth lead ------------------------------------------- -- Synth lead -------------------------------------------
Lead1Square := 80; Lead1Square := 80,
Lead2Sawtooth := 81; Lead2Sawtooth := 81,
Lead3Calliope := 82; Lead3Calliope := 82,
Lead4Chiff := 83; Lead4Chiff := 83,
Lead5Charang := 84; Lead5Charang := 84,
Lead6Voice := 85; Lead6Voice := 85,
Lead7Fifths := 86; Lead7Fifths := 86,
Lead8BassLead := 87; Lead8BassLead := 87,
-- Synth pad -------------------------------------------- -- Synth pad --------------------------------------------
Pad1NewAge := 88; Pad1NewAge := 88,
Pad2Warm := 89; Pad2Warm := 89,
Pad3Polysynth := 90; Pad3Polysynth := 90,
Pad4Choir := 91; Pad4Choir := 91,
Pad5Bowed := 92; Pad5Bowed := 92,
Pad6Metallic := 93; Pad6Metallic := 93,
Pad7Halo := 94; Pad7Halo := 94,
Pad8Sweep := 95; Pad8Sweep := 95,
-- Synth effects ---------------------------------------- -- Synth effects ----------------------------------------
FX1Train := 96; FX1Train := 96,
FX2Soundtrack := 97; FX2Soundtrack := 97,
FX3Crystal := 98; FX3Crystal := 98,
FX4Atmosphere := 99; FX4Atmosphere := 99,
FX5Brightness := 100; FX5Brightness := 100,
FX6Goblins := 101; FX6Goblins := 101,
FX7Echoes := 102; FX7Echoes := 102,
FX8SciFi := 103; FX8SciFi := 103,
-- Ethnic ----------------------------------------------- -- Ethnic -----------------------------------------------
Sitar := 104; Sitar := 104,
Banjo := 105; Banjo := 105,
Shamisen := 106; Shamisen := 106,
Koto := 107; Koto := 107,
Kalimba := 108; Kalimba := 108,
Bagpipe := 109; Bagpipe := 109,
Fiddle := 110; Fiddle := 110,
Shanai := 111; Shanai := 111,
-- Percussive ------------------------------------------- -- Percussive -------------------------------------------
TinkleBell := 112; TinkleBell := 112,
Agogo := 113; Agogo := 113,
SteelDrums := 114; SteelDrums := 114,
Woodblock := 115; Woodblock := 115,
TaikoDrum := 116; TaikoDrum := 116,
MelodicDrum := 117; MelodicDrum := 117,
SynthDrum := 118; SynthDrum := 118,
ReverseCymbal := 119; ReverseCymbal := 119,
-- Sound effects ---------------------------------------- -- Sound effects ----------------------------------------
GuitarFretNoise := 120; GuitarFretNoise := 120,
BreathNoise := 121; BreathNoise := 121,
Seashore := 122; Seashore := 122,
BirdTweet := 123; BirdTweet := 123,
TelephoneRing := 124; TelephoneRing := 124,
Helicopter := 125; Helicopter := 125,
Applause := 126; Applause := 126,
Gunshot := 127; Gunshot := 127,

View File

@ -107,7 +107,7 @@ void midi::Rt_Midi::send_note_off(uint8_t channel, uint8_t note_number, uint8_t
void midi::Rt_Midi::send_program_change(uint8_t channel, uint8_t program) void midi::Rt_Midi::send_program_change(uint8_t channel, uint8_t program)
{ {
send_message(*output, std::array { std::uint8_t(channel), program }); send_message(*output, std::array { std::uint8_t(Program_Change + channel), program });
} }
void midi::Rt_Midi::send_controller_change(uint8_t channel, uint8_t controller_number, uint8_t value) void midi::Rt_Midi::send_controller_change(uint8_t channel, uint8_t controller_number, uint8_t value)