Close
0%
0%

Pi-ano

Portable MIDI synth for use with an existing USB-MIDI out keyboard

Similar projects worth following
This is a little box to make sounds for a keyboard with USB-MIDI out. It's intended use is for open mic nights where available amplification is unpredictible but would generally include a guitar amp.

Its key features are to be portability, ease of set-up and compatibility with available equipment. It needs to output reasonable quality sound with minimal latency.

Inputs:

  • micro-USB (Power 5V DC) - run from battery instead
  • USB-A Female (USB MIDI)
  • *Mono Jack Socket (line in) Stereo mini-jack
  • *Mono Jack Socket (Sustain pedal)
  • *Mono Jack Socket (Soft pedal)
  • *DIN MIDI in

Outputs:

  •  Mono Jack Socket (at 'guitar level')
  • Stereo 3.5mm Jack Socket (headphone)
  • *DIN MINI out
  • *DIN MINI thru
  • *XLR (balanced output at microphone level?)

Controls:

  • Power off Separate power stitches for pi and amplifier
  • HeadphoneSpeaker Volume
  • * Instrument selector
  • - other controls to be provided via smartphone webapp

Gubbins:

  • Pi Zero
  • ESP8266 module
  • Loudspeaker
  • Amplifier (of some sort)
  • *Display (of some sort) - External Tablet app
  • Box (of some sort) to mount the project in
  • *VU meter(of some sort)
  • *battery and charger hardware

Software:

* = optional / to be added at later stage


Resources:


References:

datasheet.pdf

TDA7496L as used in amplifier board from junk box

Adobe Portable Document Format - 164.49 kB - 04/22/2020 at 13:25

Preview

pi-anio.fzz

Brief Fritzing design for basic circuit design using UDA1334A as there isn't a PCM5102a part available for Fritzing

fzz - 60.76 kB - 01/16/2020 at 12:41

Download

wpa_supplicant.conf

Configure WiFi access (copy to boot directory on SD card)

conf - 159.00 bytes - 01/12/2020 at 17:16

Download

ssh

Allow ssh access (copy to boot directory on SD card)

ssh - 0 bytes - 01/12/2020 at 17:16

Download

  • 1 × Raspberry Pi Zero
  • 1 × ESP12-F Serial to wifi bridge module
  • 1 × pcm5102a DAC module Data Converters / Digital to Analog Converters (DACs)
  • 1 × Speakers and Amplifier board Salvaged from old monitor
  • 2 × Toggle switch

View all 15 components

  • Testing... testing...

    The_Mekon05/02/2020 at 18:06 0 comments

    I've finally got hold of the step-up converter and connected everything together.  This won't merit an entry in the annals of neat wiring, but it does the job and everything fits in the case, even if it is only held togther with blu-tac right now.

    "Did you say cut the red wire?"

    Running the system has thrown up a few problems, but nothing too worrying.

    • Amplifier resets Pi.  Turning on the amp after the pi causes the latter to reset.  I'd guess it's pulling a lot of current on start-up and dropping the power available.  Not a problem if the amp's switched on first.
    • Noise.  There's a fair amount of noise coming from the pi, more than I noticed when I ran the DAC into my hi-fi amp.  I might need to add some flitering, or just shield things better.
    • Crummy volume control.  It takes a fair amount of fiddling to get the volume right  I might have to actually buy a correctly specced pot instead of relying on a random salvaged part.

    Crucially, the pi-ano has now been tested by a real pi-anist!

  • Software Thoughts

    The_Mekon05/01/2020 at 14:43 0 comments

    I have fluidsynth installed and it'll happily run with the roll-up keyboard. I've attempted no optimisations but the latency is acceptable.

    At the moment there's no startup script on the pi.  I have cobbled together some javascript to run on the remote tablet or 'phone to send commands to the pi. It runs through logging in, starting fluidsynth and connecting any plugged-in MIDI device.  It works and allows the user to monitor the whole startup process, but it can be slow and doesn't allow for the pi-ano to start without a wi-fi connected controller.  For now, this is a good way to adjust the settings easily, but once I've worked out a typical useable setup I'll put the commands into a shell script along the lines of that usd by PiMiDi.

    My current start-up commands (URLencoded):

    'screen',
    '%01c',
    ' ',
    'fluidsynth+-C0+-R0+-r22050+-l+-a+alsa+-o+audio.alsa.device=plughw:0+-o+synth.polyphony=64+/usr/share/sounds/sf2/FluidR3_GM.sf2',
    '%01c',
    ' ',
    'aconnect -i',
    'aconnect 20:0 128:0',
    'ls /usr/share/sounds/sf2/',
    '%011',
    'fonts'

    For testing, the roll-up keyboard takes up an unreasonable amount of space so I've been trying to use the much smaller (and cooler) Harmonix Rock Band keyboard via a USB/MIDI converter.  The pi recognises the coverter as a "QinHeng Electronics CH345 MIDI adapter", but I don't seem to receive any commands fron the keyboard to fluidsynth after connecting.  Connecting the keyboard and adapter to an old (pre General MIDI) Roland MIDI module allows me to hear sounds transmitted from the keyboard in drum mode (channel 10) but nothing in its normal keyboard operation (channel 1).  I believe the roll-up USB keyboard transmits on channel 0, so perhaps the problem lies in the way instruments are mapped in fluidsynth or the way they are connected in Alsa Connect. 


    This is all a bit of a dark art to me.  My plan is to keep thowing things at it until either it works, or I give up and get out the ironing board to set up the roll-up keybord instead.

    Pi-ano with Roland MIDI Sequencer
    Trying to connect to real MIDI devices via a cheap USB/MIDI adaptor - no luck so far

  • Fitting it together...

    The_Mekon04/24/2020 at 17:11 0 comments

    I've laid out everything in the case, stuck down with blu-tac until I get hold of some tiny screws to secure the boards to the case.  I've managed to order a step-down converter instead of a step-up converter, so I need to order the right thing now.  Otherwise it should just be a matter of wiring it all together.

  • Amplification Working

    The_Mekon04/23/2020 at 10:40 0 comments

    I salvaged an amplifier board and speakers from an old monitor some time ago.  Having looked it over, it's very simple to use.  One jack is stereo in, the other for stereo out (headphones?).  Speakers plug in via a socket and there are connectors for power and volume control.  Volume is controlled by a voltage beween 0 and 5v.


    The only awkward thing about the board is that it needs to be powered by somewhere between 10 and 18 volts.  I'm using a USB power supply so I only have 5v available.  I will be adding cheap step-up converter to power the board, but in the mean time I have tested it as working with a separate 12v supply.

    Fitting the case

    A VHS video case is about the right size to fit all the components.  The idea is that in use, the lid will be lifted like the lid on a grand piano.

    It might be a little snug, but everything seems to fit. I still need to add the postage stamp sized DC-DC converter and all the wiring. I need to make holes in the case for the following things:

    • Volume control
    • Line out jack, left
    • Line out jack, right
    • Headphone mini-jack, stereo
    • Line out mini-jack, stereo
    • USB power
    • USB OTG
    • Power switch(es)

    I may need to work out how to switch between charging the power bank and powering the device directly from an external supply since the bank doesn't seem to charge whilst powering things.  If it runs for a few hours after each charge, then I'll leave it to run on battery only.

  • Working Synth, Working Wifi

    The_Mekon04/21/2020 at 21:11 0 comments

    Working as a MIDI Synth using fliudsynth and communicating via wifi using the esp8266!


  • CS4344 Sound

    The_Mekon03/16/2020 at 13:44 0 comments

    It boots!


    It looks as if this won't work.  The CS4344 needs an MCLK (Master Clock) signal, which the pi cannot provide. 

View all 6 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates