diff --git a/README.md b/README.md index c85b061..ac78dea 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![minidexed](https://user-images.githubusercontent.com/2480569/161813414-bb156a1c-efec-44c0-802a-8926412a08e0.jpg) -MiniDexed is a FM synthesizer closely modeled on the famous DX7 by a well-known Japanese manufacturer running on a bare metal Raspberry Pi (without a Linux kernel or operating system). On Raspberry Pi 2 and larger, it can run 8 tone generators, not unlike the TX816/TX802 (8 DX7 instances without the keyboard in one box). [Featured on HACKADAY](https://hackaday.com/2022/04/19/bare-metal-gives-this-pi-some-classic-synths/). +MiniDexed is a FM synthesizer closely modeled on the famous DX7 by a well-known Japanese manufacturer running on a bare metal Raspberry Pi (without a Linux kernel or operating system). On Raspberry Pi 2 and larger, it can run 8 tone generators, not unlike the TX816/TX802 (8 DX7 instances without the keyboard in one box). [Featured by HACKADAY](https://hackaday.com/2022/04/19/bare-metal-gives-this-pi-some-classic-synths/) and [adafruit](https://blog.adafruit.com/2022/04/25/free-yamaha-dx7-synth-emulator-on-a-raspberry-pi/). ## Features @@ -11,7 +11,7 @@ MiniDexed is a FM synthesizer closely modeled on the famous DX7 by a well-known - [x] Runs on all Raspberry Pi models (except Pico); see below for details - [x] Produces sound on the headphone jack, HDMI display or [audio extractor](https://github.com/probonopd/MiniDexed/wiki/Hardware#hdmi-to-audio) (better), or a [dedicated DAC](https://github.com/probonopd/MiniDexed/wiki/Hardware#i2c-dac) (best) - [x] Supports multiple voices through Program Change and Bank Change LSB/MSB MIDI messages -- [x] Loads `.syx` files from SD card (e.g., using `getsysex.sh` or from [Dexed_cart_1.0.zip](http://hsjp.eu/downloads/Dexed/Dexed_cart_1.0.zip)) +- [x] Loads voices from `.syx` files from SD card (e.g., using `getsysex.sh` or from [Dexed_cart_1.0.zip](http://hsjp.eu/downloads/Dexed/Dexed_cart_1.0.zip)) - [x] Menu structure on optional [HD44780 display](https://www.berrybase.de/sensoren-module/displays/alphanumerische-displays/alphanumerisches-lcd-16x2-gr-252-n/gelb) and rotary encoder - [x] Runs up to 8 Dexed instances simultaneously (like in a TX816) and mixes their output together - [x] Allows for each Dexed instance to be detuned and stereo shifted @@ -45,6 +45,7 @@ Video about this project by [Floyd Steinberg](https://www.youtube.com/watch?v=Z3 * Boot * Start playing * If the system seems to become unresponsive after a few seconds, remove `usbspeed=full` from `cmdline.txt` and repeat ([details](https://github.com/probonopd/MiniDexed/issues/39)) +* Optionally, put voices in `.syx` files onto the SD card (e.g., using `getsysex.sh`) * See the Wiki for [Menu](https://github.com/probonopd/MiniDexed/wiki/Menu) operation * If something is unclear or does not work, don't hesitate to [ask](https://github.com/probonopd/MiniDexed/discussions/)! diff --git a/src/mididevice.cpp b/src/mididevice.cpp index 837d8e9..47f3f11 100644 --- a/src/mididevice.cpp +++ b/src/mididevice.cpp @@ -208,7 +208,15 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign break; case MIDI_CC_DETUNE_LEVEL: - m_pSynthesizer->SetMasterTune (maplong (pMessage[2], 0, 127, -99, 99), nTG); + if (pMessage[2] == 0) + { + // "0 to 127, with 0 being no celeste (detune) effect applied at all." + m_pSynthesizer->SetMasterTune (0, nTG); + } + else + { + m_pSynthesizer->SetMasterTune (maplong (pMessage[2], 1, 127, -99, 99), nTG); + } break; case MIDI_CC_ALL_SOUND_OFF: diff --git a/src/serialmididevice.cpp b/src/serialmididevice.cpp index 2c11a33..b03dfad 100644 --- a/src/serialmididevice.cpp +++ b/src/serialmididevice.cpp @@ -59,6 +59,8 @@ void CSerialMIDIDevice::Process (void) // Process MIDI messages // See: https://www.midi.org/specifications/item/table-1-summary-of-midi-message + // "Running status" see: https://www.lim.di.unimi.it/IEEE/MIDI/SOT5.HTM#Running- + for (int i = 0; i < nResult; i++) { u8 uchData = Buffer[i]; @@ -76,6 +78,7 @@ void CSerialMIDIDevice::Process (void) case 1: case 2: + DATABytes: if (uchData & 0x80) // got status when parameter expected { m_nSerialState = 0; @@ -90,7 +93,20 @@ void CSerialMIDIDevice::Process (void) { MIDIMessageHandler (m_SerialMessage, m_nSerialState); + m_nSerialState = 4; // State 4 for test if 4th byte is a status byte or a data byte + } + break; + case 4: + + if ((uchData & 0x80) == 0) // true data byte, false status byte + { + m_nSerialState = 1; + goto DATABytes; + } + else + { m_nSerialState = 0; + goto MIDIRestart; } break;