diff --git a/Digital-Synth-PRA32-U/Digital-Synth-PRA32-U.ino b/Digital-Synth-PRA32-U/Digital-Synth-PRA32-U.ino index b1425cc..31998dc 100644 --- a/Digital-Synth-PRA32-U/Digital-Synth-PRA32-U.ino +++ b/Digital-Synth-PRA32-U/Digital-Synth-PRA32-U.ino @@ -33,6 +33,8 @@ #define PRA32_U_PWM_AUDIO_L_PIN (28) #define PRA32_U_PWM_AUDIO_R_PIN (27) +//#define PRA32_U_USE_PWM_AUDIO_DITHERING_INSTEAD_OF_ERROR_DIFFUSION + #define PRA32_U_USE_2_CORES_FOR_SIGNAL_PROCESSING #define PRA32_U_USE_EMULATED_EEPROM @@ -52,7 +54,7 @@ MIDI_CREATE_INSTANCE(Adafruit_USBD_MIDI, usbd_midi, USB_MIDI); #endif // defined(PRA32_U_USE_USB_MIDI) #if defined(PRA32_U_USE_UART_MIDI) -MIDI_CREATE_INSTANCE(HardwareSerial, Serial2, SERIAL_MIDI); +MIDI_CREATE_INSTANCE(HardwareSerial, Serial2, UART_MIDI); #endif #if defined(PRA32_U_USE_PWM_AUDIO_INSTEAD_OF_I2S) @@ -130,13 +132,13 @@ void __not_in_flash_func(setup)() { #if defined(PRA32_U_USE_UART_MIDI) Serial2.setTX(PRA32_U_UART_MIDI_TX_PIN); Serial2.setRX(PRA32_U_UART_MIDI_RX_PIN); - SERIAL_MIDI.setHandleNoteOn(handleNoteOn); - SERIAL_MIDI.setHandleNoteOff(handleNoteOff); - SERIAL_MIDI.setHandleControlChange(handleControlChange); - SERIAL_MIDI.setHandleProgramChange(handleHandleProgramChange); - SERIAL_MIDI.setHandlePitchBend(handleHandlePitchBend); - SERIAL_MIDI.begin(MIDI_CHANNEL_OMNI); - SERIAL_MIDI.turnThruOff(); + UART_MIDI.setHandleNoteOn(handleNoteOn); + UART_MIDI.setHandleNoteOff(handleNoteOff); + UART_MIDI.setHandleControlChange(handleControlChange); + UART_MIDI.setHandleProgramChange(handleHandleProgramChange); + UART_MIDI.setHandlePitchBend(handleHandlePitchBend); + UART_MIDI.begin(MIDI_CHANNEL_OMNI); + UART_MIDI.turnThruOff(); Serial2.begin(PRA32_U_UART_MIDI_SPEED); #endif // defined(PRA32_U_USE_UART_MIDI) @@ -179,7 +181,7 @@ void __not_in_flash_func(loop)() { #endif // defined(PRA32_U_USE_USB_MIDI) #if defined(PRA32_U_USE_UART_MIDI) - SERIAL_MIDI.read(); + UART_MIDI.read(); #endif } diff --git a/Digital-Synth-PRA32-U/pra32-u-program-table.h b/Digital-Synth-PRA32-U/pra32-u-program-table.h index 3c421c0..4f5f354 100644 --- a/Digital-Synth-PRA32-U/pra32-u-program-table.h +++ b/Digital-Synth-PRA32-U/pra32-u-program-table.h @@ -13,7 +13,7 @@ const uint8_t g_preset_table_OSC_2_COARSE [] = {64 , 64 , 64 , 64 , 64 , 64 , const uint8_t g_preset_table_OSC_2_PITCH [] = {109, 72 , 72 , 72 , 72 , 72 , 72 , 72 , 109, 72 , 72 , 72 , 72 , 72 , 72 , 72 }; const uint8_t g_preset_table_MIXER_OSC_MIX [] = {64 , 64 , 64 , 64 , 64 , 64 , 64 , 0 , 64 , 64 , 64 , 64 , 64 , 64 , 64 , 0 }; -const uint8_t g_preset_table_FILTER_CUTOFF [] = {115, 115, 91 , 103, 55 , 115, 79 , 127, 115, 115, 91 , 103, 55 , 115, 79 , 127}; +const uint8_t g_preset_table_FILTER_CUTOFF [] = {115, 115, 91 , 103, 55 , 115, 67 , 127, 115, 115, 91 , 103, 55 , 115, 67 , 127}; const uint8_t g_preset_table_FILTER_RESO [] = {64 , 0 , 32 , 32 , 64 , 64 , 32 , 0 , 64 , 0 , 32 , 32 , 64 , 64 , 32 , 0 }; const uint8_t g_preset_table_FILTER_EG_AMT [] = {64 , 64 , 88 , 16 , 112, 64 , 64 , 64 , 64 , 64 , 88 , 16 , 112, 64 , 64 , 64 }; const uint8_t g_preset_table_FILTER_KEY_TRK [] = {64 , 64 , 64 , 64 , 64 , 64 , 64 , 0 , 64 , 64 , 64 , 64 , 64 , 64 , 64 , 0 }; @@ -36,7 +36,7 @@ const uint8_t g_preset_table_LFO_FADE_TIME [] = {0 , 0 , 0 , 0 , 0 , 0 , const uint8_t g_preset_table_LFO_OSC_AMT [] = {96 , 96 , 64 , 64 , 64 , 96 , 64 , 64 , 96 , 96 , 64 , 64 , 64 , 96 , 64 , 64 }; const uint8_t g_preset_table_LFO_OSC_DST [] = {0 , 0 , 0 , 0 , 0 , 127, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 127, 0 , 0 }; const uint8_t g_preset_table_LFO_FILTER_AMT [] = {64 , 64 , 88 , 88 , 88 , 64 , 88 , 64 , 64 , 64 , 88 , 88 , 88 , 64 , 88 , 64 }; -const uint8_t g_preset_table_AMP_GAIN [] = {100, 100, 100, 100, 100, 100, 127, 100, 100, 100, 100, 100, 100, 100, 127, 100}; +const uint8_t g_preset_table_AMP_GAIN [] = {90 , 90 , 90 , 90 , 90 , 90 , 127, 90 , 90 , 90 , 90 , 90 , 90 , 90 , 127, 90 }; const uint8_t g_preset_table_AMP_ATTACK [] = {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }; const uint8_t g_preset_table_AMP_DECAY [] = {0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }; diff --git a/Digital-Synth-PRA32-U/pra32-u-synth.h b/Digital-Synth-PRA32-U/pra32-u-synth.h index 03a43c3..57970e3 100644 --- a/Digital-Synth-PRA32-U/pra32-u-synth.h +++ b/Digital-Synth-PRA32-U/pra32-u-synth.h @@ -1061,9 +1061,32 @@ class PRA32_U_Synth { int16_t delay_fx_output_l = m_delay_fx.process(chorus_fx_output_l, chorus_fx_output_r, delay_fx_output_r); #if defined(PRA32_U_USE_PWM_AUDIO_INSTEAD_OF_I2S) +#if defined(PRA32_U_USE_PWM_AUDIO_DITHERING_INSTEAD_OF_ERROR_DIFFUSION) // Dithering - right_level = delay_fx_output_r + ((noise_int15 + 16384) >> 11); - return delay_fx_output_l + ((noise_int15 + 16384) >> 11); + right_level = delay_fx_output_r + (((noise_int15 + 16384) >> 11) - 8); + return delay_fx_output_l + (((noise_int15 + 16384) >> 11) - 8); +#else // defined(PRA32_U_USE_PWM_AUDIO_DITHERING_INSTEAD_OF_ERROR_DIFFUSION) + // Error diffusion + static uint16_t s_output_error_l = 0; + static uint16_t s_output_error_r = 0; + + uint32_t pwm_audio_l = delay_fx_output_l + 0x8000; + uint32_t pwm_audio_r = delay_fx_output_r + 0x8000; + pwm_audio_l += ((noise_int15 + 16384) >> 14); + pwm_audio_r += !((noise_int15 + 16384) >> 14); + pwm_audio_l *= 3075; + pwm_audio_r *= 3075; + pwm_audio_l += s_output_error_l; + pwm_audio_r += s_output_error_r; + + volatile uint16_t prev_output_error_l = s_output_error_l; + volatile uint16_t prev_output_error_r = s_output_error_r; + s_output_error_l = pwm_audio_l & 0xFFFF; + s_output_error_r = pwm_audio_r & 0xFFFF; + + right_level = delay_fx_output_r + (prev_output_error_r > s_output_error_r) * 22; + return delay_fx_output_l + (prev_output_error_l > s_output_error_l) * 22; +#endif // defined(PRA32_U_USE_PWM_AUDIO_DITHERING_INSTEAD_OF_ERROR_DIFFUSION) #else // defined(PRA32_U_USE_PWM_AUDIO_INSTEAD_OF_I2S) right_level = delay_fx_output_r; return delay_fx_output_l; diff --git a/PRA32-U-Change-History.md b/PRA32-U-Change-History.md new file mode 100644 index 0000000..cc964c9 --- /dev/null +++ b/PRA32-U-Change-History.md @@ -0,0 +1,65 @@ +## Digital Synth PRA32-U Change History + +- v2.2.0 (2024-01-26): + - Use error diffusion for PWM audio output by default + - Eliminate noise when PWM audio output is silent + - Change the display of PRA32-U CTRL + - Modify Presets; + - Tested with Adafruit TinyUSB Library version 2.3.3 +- v2.1.0 (2024-01-14): + - Reduce noise from PMIC (Turn off RT6150 Power Save); + - Support Osc 1 Sine Wave Phase Modulation (Osc 1 Shape and Osc 1 Morph); + - Add the function of writing the parameters to Program #8-15 and the flash; + - Modify Presets; + - Add JSON files for PRA32-U CTRL; + - Use core 0 for main processing; + - Rename constant macros; + - Officially support PWM audio output option; + - Rename Serial MIDI to UART MIDI; + - Enable UART MIDI to be used at the same time as USB MIDI; + - Use Serial1 for Debug Print and Serial2 for UART MIDI; + - Raspberry Pi Pico/RP2040 core version 3.6.3 is recommended +- v2.0.1 (2024-01-05): + - Fix Ping Pong Delay to start from the left + - Fix Parameter Guide (Filter Resonance) +- v2.0.0 (2024-01-04): + - Add Delay Mode (Ping Pong Delay); + - Support Breath Controller (Breath Filter Amt and Breath Amp Mod); + - Support Note ON Velocity (EG Velocity Sensitivity and Amp Velocity Sensitivity); + - Modify EG and Amp EG; + - Modify Presets; + - Change the control numbers of Control Changes + (Voice Mode: 27 -> 14, LFO Wave: 18 -> 12, Filter Mode: 86 -> 78, EG Amp Mod: 87 -> 28, and Chorus Mix: 93 -> 27); + - Change the meanings of the values of Control Changes + (Osc 1 Wave, Osc 2 Wave, EG Osc Dst, Voice Mode, LFO Wave, LFO Osc Dst, Filter Mode, EG Amp Mod, Release = Decay, Breath Amp Mod, and Delay Mode); + - Increase DMA buffer size (audio latency: 2.7 ms -> 5.3 ms); + - Use 2 cores for signal processing in Polyphonic and Paraphonic Modes; + - Add PWM audio output option (experimental) +- v1.2.1: Fixed an oscillation problem caused by Delay Feedback +- v1.2.0: Renew High Pass Filter; Raspberry Pi Pico/RP2040 core version 3.6.2 is recommended +- v1.1.1: Revert Filter clipping in High Pass mode +- v1.1.0: Fix Filter clipping (behavior during oscillation); Extend Pitch Bend Range; + Delete the code for Waveshare Pico-Audio Rev2.1 +- v1.0.3: Fix a problem with received MIDI messages being dropped; Improve README; Fix UF2 files +- v1.0.2: Turn MIDI Thru Off +- v1.0.1: Fix unstable PRA32-U CTRL operation when using Serial MIDI (DIN/TRS MIDI); Fix README +- v1.0.0: Change Control Numbers of Control Changes; + Change the meanings of the values of Osc 1/2 Wave, Voice Mode, and LFO Wave; Add Sine Wave to Osc 1 and 2; + Limit the change range and the change rate of Osc 1 Shape; Change Noise specifications; + Change Sub Osc Triangle Wave to Sine Wave; Change LFO Triangle Wave 2 to Sine Wave; + Improve resolution of Filter Resonance; Limit the change rate of Filter Cutoff due to modulation; + Change Amp Level to Amp Gain; Change Chorus Mode to Chorus Mix; Add Delay Fx; + Delete Chorus Delay Time, Chorus Bypass, and Pitch Bend by CC; Update Presets; Other changes +- v0.4.0 (Prototype): Extend Osc 2 Coarse range; Change Osc 2 Fine curve; Rename "Osc 2 Fine" to "Osc 2 Pitch"; + Change LFO Osc/Filter Amt curve; Update Presets +- v0.3.1 (Prototype): Adjust smoothing time when parameters change; Update Presets; Fix LFO Osc/Filter Amt; Other changes +- v0.3.0 (Prototype): Extend Note Number range; Remove drift of Oscillators; Improve Triangle Wave; Change Portamento curve; + Improve Filter Low Cut Mode; Rename Filter Mode LC (Low Cut) to HP (High Pass); Modify Filter coefficients; + Change EG curve; Extend LFO Rate curve; Change LFO Fade Time; Change Chorue Rate curve; Update Presets; + Fix Filter Key Track (Fix problem with strange sound when pitch is outside of note number range); + Fix behavior when Portamento is 0 (Off); Other changes +- v0.2.0 (Prototype): Change Sampling Rate to 48000 Hz; Support MCLK for I2S; Support Polyphonic Mode; + Extend Filter Cutoff frequency change range to 10+ octaves; + Change "Mixer Sub Osc" to "Mixer Noise/Sub Osc"; Add "EG Amp Mod", "Release = Decay", and "Filter Mode"; + Enable Osc 1 Shape, Morph, Noise/Sub Osc, and Osc 2 in Paraphonic and Polyphonic Modes; Other changes +- v0.1.0 (Prototype): The first release diff --git a/PRA32-U-MIDI-Implementation-Chart.md b/PRA32-U-MIDI-Implementation-Chart.md index 4f4f906..95b955f 100644 --- a/PRA32-U-MIDI-Implementation-Chart.md +++ b/PRA32-U-MIDI-Implementation-Chart.md @@ -1,6 +1,6 @@ ``` - [Polyphonic/Paraphonic Synthesizer] Date: 2024-01-14 - Model: Digital Synth PRA32-U MIDI Implementation Chart Version: 2.1.0 + [Polyphonic/Paraphonic Synthesizer] Date: 2024-01-26 + Model: Digital Synth PRA32-U MIDI Implementation Chart Version: 2.2.0 +-------------------------------+---------------+---------------+-------------------------------------+ | Function... | Transmitted | Recognized | Remarks | +-------------------------------+---------------+---------------+-------------------------------------+ diff --git a/PRA32-U-Parameter-Guide.md b/PRA32-U-Parameter-Guide.md index e7889b1..64d7399 100644 --- a/PRA32-U-Parameter-Guide.md +++ b/PRA32-U-Parameter-Guide.md @@ -1,6 +1,6 @@ -# Digital Synth PRA32-U Parameter Guide v2.1.0 +# Digital Synth PRA32-U Parameter Guide v2.2.0 -- 2024-01-14 ISGK Instruments +- 2024-01-26 ISGK Instruments - ## Control Change Parameters diff --git a/README.md b/README.md index 011bb63..bff25b9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Digital Synth PRA32-U v2.1.0 +# Digital Synth PRA32-U v2.2.0 -- 2024-01-14 ISGK Instruments +- 2024-01-26 ISGK Instruments - @@ -12,118 +12,64 @@ - Having the function of writing the parameters to the user programs and the flash - Modifiable with Arduino IDE and Arduino-Pico (by Earle F. Philhower, III) - An **I2S DAC** hardware (e.g. Pimoroni Pico Audio Pack) is required - - PWM Audio can also be used instead of I2S + - PWM Audio can also be used instead of I2S (PWM Audio does not require an I2S DAC hardware) - Prebuilt UF2 files ("bin") - - "Digital-Synth-PRA32-U-2.1.0-Pimoroni-Pico-Audio-Pack.uf2" is for Raspberry Pi Pico and Pimoroni Pico Audio Pack - - -## Change History - -- v2.1.0 (2024-01-14): - - Reduce noise from PMIC (Turn off RT6150 Power Save); - - Support Osc 1 Sine Wave Phase Modulation (Osc 1 Shape and Osc 1 Morph); - - Add the function of writing the parameters to Program #8-15 and the flash; - - Modify Presets; - - Add JSON files for PRA32-U CTRL; - - Use core 0 for main processing; - - Rename constant macros; - - Officially support PWM audio output option; - - Rename Serial MIDI to UART MIDI; - - Enable UART MIDI to be used at the same time as USB MIDI; - - Use Serial1 for Debug Print and Serial2 for UART MIDI; - - Raspberry Pi Pico/RP2040 core version 3.6.3 is recommended -- v2.0.1 (2024-01-05): - - Fix Ping Pong Delay to start from the left - - Fix Parameter Guide (Filter Resonance) -- v2.0.0 (2024-01-04): - - Add Delay Mode (Ping Pong Delay); - - Support Breath Controller (Breath Filter Amt and Breath Amp Mod); - - Support Note ON Velocity (EG Velocity Sensitivity and Amp Velocity Sensitivity); - - Modify EG and Amp EG; - - Modify Presets; - - Change the control numbers of Control Changes - (Voice Mode: 27 -> 14, LFO Wave: 18 -> 12, Filter Mode: 86 -> 78, EG Amp Mod: 87 -> 28, and Chorus Mix: 93 -> 27); - - Change the meanings of the values of Control Changes - (Osc 1 Wave, Osc 2 Wave, EG Osc Dst, Voice Mode, LFO Wave, LFO Osc Dst, Filter Mode, EG Amp Mod, Release = Decay, Breath Amp Mod, and Delay Mode); - - Increase DMA buffer size (audio latency: 2.7 ms -> 5.3 ms); - - Use 2 cores for signal processing in Polyphonic and Paraphonic Modes; - - Add PWM audio output option (experimental) -- v1.2.1: Fixed an oscillation problem caused by Delay Feedback -- v1.2.0: Renew High Pass Filter; Raspberry Pi Pico/RP2040 core version 3.6.2 is recommended -- v1.1.1: Revert Filter clipping in High Pass mode -- v1.1.0: Fix Filter clipping (behavior during oscillation); Extend Pitch Bend Range; - Delete the code for Waveshare Pico-Audio Rev2.1 -- v1.0.3: Fix a problem with received MIDI messages being dropped; Improve README; Fix UF2 files -- v1.0.2: Turn MIDI Thru Off -- v1.0.1: Fix unstable PRA32-U CTRL operation when using Serial MIDI (DIN/TRS MIDI); Fix README -- v1.0.0: Change Control Numbers of Control Changes; - Change the meanings of the values of Osc 1/2 Wave, Voice Mode, and LFO Wave; Add Sine Wave to Osc 1 and 2; - Limit the change range and the change rate of Osc 1 Shape; Change Noise specifications; - Change Sub Osc Triangle Wave to Sine Wave; Change LFO Triangle Wave 2 to Sine Wave; - Improve resolution of Filter Resonance; Limit the change rate of Filter Cutoff due to modulation; - Change Amp Level to Amp Gain; Change Chorus Mode to Chorus Mix; Add Delay Fx; - Delete Chorus Delay Time, Chorus Bypass, and Pitch Bend by CC; Update Presets; Other changes -- v0.4.0 (Prototype): Extend Osc 2 Coarse range; Change Osc 2 Fine curve; Rename "Osc 2 Fine" to "Osc 2 Pitch"; - Change LFO Osc/Filter Amt curve; Update Presets -- v0.3.1 (Prototype): Adjust smoothing time when parameters change; Update Presets; Fix LFO Osc/Filter Amt; Other changes -- v0.3.0 (Prototype): Extend Note Number range; Remove drift of Oscillators; Improve Triangle Wave; Change Portamento curve; - Improve Filter Low Cut Mode; Rename Filter Mode LC (Low Cut) to HP (High Pass); Modify Filter coefficients; - Change EG curve; Extend LFO Rate curve; Change LFO Fade Time; Change Chorue Rate curve; Update Presets; - Fix Filter Key Track (Fix problem with strange sound when pitch is outside of note number range); - Fix behavior when Portamento is 0 (Off); Other changes -- v0.2.0 (Prototype): Change Sampling Rate to 48000 Hz; Support MCLK for I2S; Support Polyphonic Mode; - Extend Filter Cutoff frequency change range to 10+ octaves; - Change "Mixer Sub Osc" to "Mixer Noise/Sub Osc"; Add "EG Amp Mod", "Release = Decay", and "Filter Mode"; - Enable Osc 1 Shape, Morph, Noise/Sub Osc, and Osc 2 in Paraphonic and Polyphonic Modes; Other changes -- v0.1.0 (Prototype): The first release + - "Digital-Synth-PRA32-U-2.2.0-Pimoroni-Pico-Audio-Pack.uf2" is for Raspberry Pi Pico and Pimoroni Pico Audio Pack + + +## [Change History](/PRA32-U-Change-History.md) ## Preparation for modification - Please install **Arduino IDE** - - **NOTE**: Large noise is generated during the sketch upload if other than Update Method: "Default (UF2)" is used + - NOTE: Large noise is generated during the sketch upload if other than Update Method: "Default (UF2)" is used - Info: - Please install Arduino-Pico = **Raspberry Pi Pico/RP2040** (by Earle F. Philhower, III) core - Additional Board Manager URL: + - This sketch is tested with version **3.6.3**: - Info: - - Raspberry Pi Pico/RP2040 core **version 3.6.3** is recommended -- Please install **MIDI Library** (by Francois Best, lathoub) +- Please install **Adafruit TinyUSB Library** for Arduino (by Adafruit) + - This sketch is tested with version **2.3.3**: + - Info: +- Please install Arduino **MIDI Library** (by Francois Best, lathoub) + - This sketch is tested with version **5.0.2**: - Info: - - MIDI Library **version 5.0.2** is recommended ## Features -### MIDI Input +### MIDI (Input) -#### USB MIDI Input (Default) +#### USB MIDI Device (Default) - MIDI Device Name: "Digital Synth PRA32-U" -- **NOTE**: Select USB Stack: "Adafruit TinyUSB" in the Arduino IDE "Tools" menu +- NOTE: Select USB Stack: "Adafruit TinyUSB" in the Arduino IDE "Tools" menu -#### UART MIDI Input (Optional) +#### UART MIDI (Optional) - UART MIDI can also be used -- Uncomment out `//#define PRA32_U_USE_UART_MIDI` in "Digital-Synth-PRA32-U.ino" and modify `PRA32_U_UART_MIDI_SPEED` +- Uncomment out `//#define PRA32_U_USE_UART_MIDI` in "Digital-Synth-PRA32-U.ino" + and modify `PRA32_U_UART_MIDI_SPEED`, `PRA32_U_UART_MIDI_TX_PIN`, and `PRA32_U_UART_MIDI_RX_PIN` - Speed: 31250 bps (default, for DIN/TRS MIDI) or 38400 bps -- GP0 and GP1 pins are used by UART0 TX and UART0 RX by default +- GP4 and GP5 pins are used by UART1 TX and UART1 RX by default - DIN/TRS MIDI is available by using (and modifying) Adafruit MIDI FeatherWing Kit, for example - Adafruit [MIDI FeatherWing Kit](https://www.adafruit.com/product/4740) - 木下研究所 [MIDI-UARTインターフェースさん キット](https://www.switch-science.com/products/8117) (Shipping to Japan only) - necobit電子 [MIDI Unit for GROVE](https://necobit.com/denshi/grove-midi-unit/) (Shipping to Japan only) -### Audio Output +### Audio (Output) -#### I2S Audio Output (Default) +#### I2S (Default) - Use an I2S DAC (e.g. Texas Instruments PCM5100A and Cirrus Logic CS4344), Sampling Rate: 48 kHz, Bit Depth: 16 bit -- **NOTE**: The RP2040 system clock (sysclk) changes to overclocked 147.6 MHz by I2S Audio Library setSysClk() +- NOTE: The RP2040 system clock (sysclk) changes to overclocked 147.6 MHz by I2S Audio Library setSysClk() - Modify `PRA32_U_I2S_DAC_MUTE_OFF_PIN`, `PRA32_U_I2S_DATA_PIN`, `PRA32_U_I2S_MCLK_PIN`, `PRA32_U_I2S_MCLK_MULT`, `PRA32_U_I2S_BCLK_PIN`, and `PRA32_U_I2S_SWAP_BCLK_AND_LRCLK_PINS` in "Digital-Synth-PRA32-U.ino" to match the hardware configuration - - **NOTE**: To avoid noise, the parameters will not be written to the flash if `PRA32_U_I2S_DAC_MUTE_OFF_PIN` is not defined + - NOTE: To avoid noise, the parameters will not be written to the flash if `PRA32_U_I2S_DAC_MUTE_OFF_PIN` is not defined - The default setting is for Pimoroni [Pico Audio Pack](https://shop.pimoroni.com/products/pico-audio-pack) (PIM544) ``` #define PRA32_U_I2S_DAC_MUTE_OFF_PIN (22) @@ -163,10 +109,10 @@ ``` -#### PWM Audio Output (Optional) +#### PWM Audio (Optional) - PWM Audio can also be used instead of I2S - - **NOTE**: To avoid noise, the parameters will not be written to the flash when using PWM audio output + - NOTE: To avoid noise, the parameters will not be written to the flash when using PWM audio - We recommend adding RC filter (post LPF) circuits to reduce PWM ripples - A 1st-order LPFs with a cutoff frequency 7.2 kHz (R = 220 ohm, C = 100 nF) works well - See "PWM audio" in [Hardware design with RP2040](https://datasheets.raspberrypi.com/rp2040/hardware-design-with-rp2040.pdf) @@ -202,6 +148,22 @@ - When Program Change #127 is entered or Control Change #111 is changed from Off (63 or lower) to On (64 or higher), "Rand Ctrl" is processed - PRA32-U CTRL stores the current control values and the user programs (#8-15) in a Web browser (localStorage) - Current parameter values and user programs (#8-15) can be imported/exported from/to JSON files +- When not using PRA32-U CTRL + - PRA32-U can also be controlled by MIDI without using PRA32-U CTRL + - Refer to "PRA32-U-MIDI-Implementation-Chart.txt" for the supported functions + - The default program is #0 + - Programs #0-15 can be modified by editing "pra32-u-program-table.h" + - PRA32-U CTRL functions related to parameter writing + - Write: Write the current parameters to PRA32-U (Program #8-15 and the flash) + - Program Change: Send Program Change to PRA32-U directry + (NOTE: The current parameters of PRA32-U will not be updated) + + +## Examples of Option Combinations + +- PRA32-U (USB MIDI Device, I2S), Default +- PRA32-U (USB MIDI Device, UART MIDI, I2S) +- PRA32-U (USB MIDI Device, PWM Audio) ## [Parameter Guide](/PRA32-U-Parameter-Guide.md) @@ -274,15 +236,35 @@ graph LR ``` +## Circuit Diagram (Simple Circuit for PWM Audio) + +![Circuit Diagram](./pra32-u-pwm-audio-circuit-diagram.png) + +- This image was created with Fritzing. + +- Adding 10 uF electrolytic capacitors (AC coupling capacitors) will cut + the DC components of the audio outputs. + +- NOTE: Connect an amplifier or an active speaker to the audio jack. + Connecting a headphone or a passive speaker may cause a large current to flow and damage the devices. + + +## Actual Wiring Diagram (Simple Circuit for PWM Audio) + +![Actual Wiring Diagram](./pra32-u-pwm-audio-bread-board.png) + +- This image was created with Fritzing. + + ## License ![CC0](http://i.creativecommons.org/p/zero/1.0/88x31.png) -**Digital Synth PRA32-U v2.1.0 by ISGK Instruments (Ryo Ishigaki)** +**Digital Synth PRA32-U v2.2.0 by ISGK Instruments (Ryo Ishigaki)** To the extent possible under law, ISGK Instruments (Ryo Ishigaki) has waived all copyright and related or neighboring rights -to Digital Synth PRA32-U v2.1.0. +to Digital Synth PRA32-U v2.2.0. You should have received a copy of the CC0 legalcode along with this work. If not, see . diff --git a/bin/Digital-Synth-PRA32-U-2.1.0-Pimoroni-Pico-Audio-Pack.uf2 b/bin/Digital-Synth-PRA32-U-2.2.0-Pimoroni-Pico-Audio-Pack.uf2 similarity index 56% rename from bin/Digital-Synth-PRA32-U-2.1.0-Pimoroni-Pico-Audio-Pack.uf2 rename to bin/Digital-Synth-PRA32-U-2.2.0-Pimoroni-Pico-Audio-Pack.uf2 index 1983e01..7871b69 100644 Binary files a/bin/Digital-Synth-PRA32-U-2.1.0-Pimoroni-Pico-Audio-Pack.uf2 and b/bin/Digital-Synth-PRA32-U-2.2.0-Pimoroni-Pico-Audio-Pack.uf2 differ diff --git a/pra32-u-ctrl.html b/pra32-u-ctrl.html index 0322f48..18bdf74 100644 --- a/pra32-u-ctrl.html +++ b/pra32-u-ctrl.html @@ -41,7 +41,7 @@ }