Skip to content

risgk/digital-synth-pra32-u2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Digital Synth PRA32-U2 v1.1.1

Overview

  • 4 Voice Polyphonic/Paraphonic Synthesizer for Raspberry Pi Pico 2/RP2350
    • Built-in Chorus and Delay FX
    • Controlled by MIDI -- PRA32-U2 is a MIDI sound module
    • Having the function of writing the parameters to the user programs and the flash
    • PRA32-U2 is an upgraded model of PRA32-U (for Raspberry Pi Pico/RP2040), but some specifications differ
  • 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 does not require an I2S DAC hardware)
      • KNOWN ISSUE: When using PWM Audio, signal discontinuity occurs approximately every 60-80 milliseconds
        • Click noise is particularly noticeable in the high frequency band and sine waves
  • Prebuilt UF2 files ("bin")
    • "Digital-Synth-PRA32-U2-Pimoroni-Pico-Audio-Pack.uf2" is for Raspberry Pi Pico and Pimoroni Pico Audio Pack

Preparation for modification

Features

MIDI (Input)

USB MIDI Device (Default)

  • MIDI Device Name: "Digital Synth PRA32-U2"
  • NOTE: Select USB Stack: "Adafruit TinyUSB" in the Arduino IDE "Tools" menu

UART MIDI (Optional)

Audio (Output)

I2S (Default)

  • Use an I2S DAC (Texas Instruments PCM5100A, PCM5101A, or PCM5102A is recommended), Sampling Rate: 48 kHz, Bit Depth: 16 bit
  • NOTE: The RP2350 system clock (sysclk) changes to overclocked 153.6 MHz by I2S Audio Library setSysClk()
  • Modify PRA32_U2_I2S_DAC_MUTE_OFF_PIN, PRA32_U2_I2S_DATA_PIN, PRA32_U2_I2S_MCLK_PIN, PRA32_U2_I2S_MCLK_MULT, PRA32_U2_I2S_BCLK_PIN, PRA32_U2_I2S_SWAP_BCLK_AND_LRCLK_PINS, and PRA32_U2_I2S_SWAP_LEFT_AND_RIGHT in "Digital-Synth-PRA32-U2.ino" to match the hardware configuration
    • Define PRA32_U2_I2S_DAC_MUTE_OFF_PIN and connect this pin to the I2S DAC mute off pin to reduce click noise when writing the parameters to the flash
  • The default setting is for Pimoroni Pico Audio Pack (PIM544)
#define PRA32_U2_I2S_DAC_MUTE_OFF_PIN          (22)
#define PRA32_U2_I2S_DATA_PIN                  (9)
//#define PRA32_U2_I2S_MCLK_PIN                  (0)
//#define PRA32_U2_I2S_MCLK_MULT                 (0)
#define PRA32_U2_I2S_BCLK_PIN                  (10)  // LRCLK Pin is PRA32_U2_I2S_BCLK_PIN + 1
#define PRA32_U2_I2S_SWAP_BCLK_AND_LRCLK_PINS  (false)
#define PRA32_U2_I2S_SWAP_LEFT_AND_RIGHT       (false)
//#define PRA32_U2_I2S_DAC_MUTE_OFF_PIN          (0)
#define PRA32_U2_I2S_DATA_PIN                  (26)
//#define PRA32_U2_I2S_MCLK_PIN                  (0)
//#define PRA32_U2_I2S_MCLK_MULT                 (0)
#define PRA32_U2_I2S_BCLK_PIN                  (27)  // LRCLK Pin is is PRA32_U2_I2S_BCLK_PIN + 1
#define PRA32_U2_I2S_SWAP_BCLK_AND_LRCLK_PINS  (false)
#define PRA32_U2_I2S_SWAP_LEFT_AND_RIGHT       (false)
//#define PRA32_U2_I2S_DAC_MUTE_OFF_PIN          (0)
#define PRA32_U2_I2S_DATA_PIN                  (22)
#define PRA32_U2_I2S_MCLK_PIN                  (26)
#define PRA32_U2_I2S_MCLK_MULT                 (256)
#define PRA32_U2_I2S_BCLK_PIN                  (27)  // LRCLK Pin is is PRA32_U2_I2S_BCLK_PIN + 1
#define PRA32_U2_I2S_SWAP_BCLK_AND_LRCLK_PINS  (true)
#define PRA32_U2_I2S_SWAP_LEFT_AND_RIGHT       (true)

PWM Audio (Optional)

  • PWM Audio can also be used instead of I2S
    • NOTE: Probably smaller output volume than I2S DAC boards
    • 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 for details on PWM audio
  • NOTE: Select CPU Speed: "150 MHz" in the Arduino IDE "Tools" menu
  • Uncomment out //#define PRA32_U2_USE_PWM_AUDIO_INSTEAD_OF_I2S in "Digital-Synth-PRA32-U2.ino" and modify PRA32_U2_PWM_AUDIO_L_PIN and PRA32_U2_PWM_AUDIO_R_PIN
  • The following is setting is for Pimoroni Pico VGA Demo Base (PIM553)
#define PRA32_U2_PWM_AUDIO_L_PIN               (28)
#define PRA32_U2_PWM_AUDIO_R_PIN               (27)
  • KNOWN ISSUE: When using PWM Audio, signal discontinuity occurs approximately every 60-80 milliseconds
    • Click noise is particularly noticeable in the high frequency band and sine waves

Files

  • "Digital-Synth-PRA32-U2.ino" is a Arduino sketch for Raspberry Pi Pico/RP2040/RP2350 core
    • Modify PRA32_U2_MIDI_CH to change the MIDI Channel
  • "pra32-u2-make-sample-wav-file.cc" is for debugging on PC
    • GCC (g++) for PC is required
    • "pra32-u2-make-sample-wav-file-cc.bat" makes a sample WAV file (working on Windows)
  • "pra32-u2-generate-*.rb" generates source or header files
    • A Ruby execution environment is required

PRA32-U2 Editor

  • "pra32-u2-editor.html": Editor (MIDI Controller) Application for PRA32-U2, HTML App (Web App)
    • Modify PRA32_U2_MIDI_CH to change the MIDI Channel
  • We recommend using Google Chrome, which implements Web MIDI API
  • Select "Digital Synth PRA32-U2" in the list "MIDI Out"
  • Functions
    • PRA32-U2 Editor converts Program Changes (#0-7 for Preset programs, #8-15 for user programs) into Control Changes
    • 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-U2 Editor 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-U2 Editor
    • PRA32-U2 can also be controlled by MIDI without using PRA32-U2 Editor
    • Refer to "PRA32-U2-MIDI-Implementation-Chart.txt" for the supported functions
    • The default program is #8
    • Programs #0-15 can be modified by editing "pra32-u2-program-table.h"
    • PRA32-U2 Editor functions related to parameter writing
      • Write: Write the current parameters to PRA32-U2 (Program #8-15 and the flash)
      • Program Change: Send Program Change to PRA32-U2 directry (NOTE: The current parameters of PRA32-U2 will not be updated)

Examples of Option Combinations

  • PRA32-U2 (USB MIDI Device, I2S), Default
  • PRA32-U2 (USB MIDI Device, UART MIDI, I2S)
  • PRA32-U2 (USB MIDI Device, PWM Audio)
  • PRA32-U2 with Panel (USB MIDI Device, UART MIDI, I2S, Control Panel)

Synthesizer Block Diagram

Polyphonic Mode

graph LR
    subgraph V1[Voice 1]
        V1O1[Osc 1 w/ Sub Osc] --> V1OM[Osc Mixer]
        V1O2[Osc 2] --> V1OM
        V1OM --> V1F[Filter]
        V1F --> V1A[Amp]
        E[EG] -.-> V1O1 & V1O2 & V1F
        V1AE[Amp EG] -.-> V1A
    end
    V1A --> VM[Voice Mixer]
    V2[Voice 2] & V3[Voice 3] & V4[Voice 4] --> VM
    VM --> C[Chorus FX] --> D[Delay FX] --> AO[Audio Out]
    C --> D
    D --> AO
    N[Noise Gen]  --> V1O2 & V1OM & V2 & V3 & V4
    N -.-> L[LFO w/ S/H]
    L -.-> V1O1 & V1O2 & V1F & V2 & V3 & V4
Loading

Paraphonic Mode

graph LR
    subgraph V1[Voice 1]
        V1O1[Osc 1 w/ Sub Osc] --> V1OM[Osc Mixer]
        V1O2[Osc 2] --> V1OM
        V1OM --> V1G[Gate]
    end
    V1G --> VM[Voice Mixer]
    V2[Voice 2] & V3[Voice 3] & V4[Voice 4] --> VM
    VM --> F[Filter] --> A[Amp] --> C[Chorus FX] --> D[Delay FX] --> AO[Audio Out]
    C --> D
    D --> AO
    N[Noise Gen]  --> V1O2 & V1OM & V2 & V3 & V4
    N -.-> L[LFO w/ S/H]
    L -.-> V1O1 & V1O2 & V2 & V3 & V4 & F
    E[EG] -.-> V1O1 & V1O2 & V2 & V3 & V4 & F
    AE[Amp EG] -.-> A
Loading

Monophonic Mode

graph LR
    O1[Osc 1 w/ Sub Osc] --> OM[Osc Mixer]
    O2[Osc 2] --> OM
    OM --> F[Filter] --> A[Amp] --> C[Chorus FX] --> D[Delay FX] --> AO[Audio Out]
    C --> D
    D --> AO
    N[Noise Gen] --> O2 & OM
    N -.-> L[LFO w/ S/H]
    L -.-> O1 & O2 & F
    E[EG] -.-> O1 & O2 & F
    AE[Amp EG] -.-> A
Loading

Wave Table Graphs

Wave Table Graphs

Simple Circuit for PWM Audio (Optional)

Circuit Diagram (Simple Circuit for PWM Audio)

Circuit Diagram

  • This image was created with Fritzing.
    • Actually, it is necessary to use Raspberry Pi Pico 2 (instead of Raspberry Pi Pico)
  • 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

  • This image was created with Fritzing.
    • Actually, it is necessary to use Raspberry Pi Pico 2 (instead of Raspberry Pi Pico)

License

CC0

Digital Synth PRA32-U2 v1.1.1 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-U2 v1.1.1.

You should have received a copy of the CC0 legalcode along with this work. If not, see http://creativecommons.org/publicdomain/zero/1.0/.

For Your Information

If PRA32-U2 is to be embedded in instruments or others, it would be nice (but not required) to display the following:

  • Powered by ISGK Instruments PRA32-U2
  • Powered by PRA32-U2

About

PRA32-U2 is a 4 Voice Polyphonic/Paraphonic Synthesizer for Raspberry Pi Pico 2/RP2350

Topics

Resources

License

Stars

Watchers

Forks