“Bare Metal” Raspberry Pi Synth – Part 4

I wanted to revisit my “Bare Metal” Raspberry Pi Synth as I only really just got started.  But having left it some five months since last having a look, I had a bit of updating to do!  But then this post describes how I built and tried out the “minisynth” application from Rene Stange (rsta2) on GitHub that uses the same Circle “bare metal” environment I’ve been playing with.

Full index of posts in this series:

Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

These are the key tutorials for the main concepts used in this project:

If you are new to microcontrollers and single board computers, see the Getting Started pages.

Parts list

  • Raspberry Pi v1 model B (in my case).
  • 128Mb or greater SDHC SD Card.
  • Linux installation (I use Ubuntu in a virtual machine on my Windows PC).
  • HDMI monitor (for the display).
  • I2S audio output.
  • Amplification and lead for the headphone socket on the Pi.

Hardware

I’ve not done anything new hardware wise, so I’m using my Raspberry Pi v1 Model B Synth Board for serial MIDI (optional), but not for the IO yet; and I’m using one of the Raspberry Pi I2S Audio Interfaces for audio output.

I also have a USB MIDI keyboard for simple testing too and in the photo I’ve plugged it into my HDMIPi display.

IMG_5961

The Code

The first thing I did was resynchronise my Circle GitHub environment to the latest build, which now includes the MCP300x support as a standard add-on.  I won’t go into that any more here, but I’ve updated part 2 with the latest details and slightly updated my example code to match.

The main point of this post was to document how I tried Rene Stange’s “minisynth” application, which is a “bare metal” virtual synthesizer for the Raspberry Pi.  You can find full details of it here: https://github.com/rsta2/minisynth.

I’ve continued to use the virtual environment and cross-compilation setup I described in part 1. I cloned the minisynth repository into my “src” area as described in the readme file:

git clone https://github.com/rsta2/minisynth.git minisynth
cd minisynth
git submodule update --init
cd circle
git submodule update --init addon/lvgl/lvgl
cd ..

Then back in the main minisynth directory, I ran the configuration utility to setup my build for the Raspberry Pi V1 then ran the build.

./configure 1 arm-none-eabi-
./makeall clean
./makeall

This has left me with a kernel.img in the minisynth/src directory which I can copy over to my SD card in the usual way (see part 1).

It also requires the set of configuration files from the minisynth/config directory (see the readme).  The cmdline.txt file must be updated to tell the system to use I2S by adding “sounddev=sndi2s” to it as a configuration option otherwise it will default to using PWM output via the headphone jack.

Note my first attempt couldn’t get I2S working, but it turned out that I still had some 5-month old files in my minisynth repository, so I’ll “pulled” the latest files over and refreshed everything with a clean build and all was fine.

Then on connecting a HDMI display, USB keyboard (optionally a serial MIDI keyboard) and a mouse, I now have a fully working software/virtual synth to play with!

The video is cycling through the “preset” voices.  Remember all the sounds are generated using the virtual synth engine on the Pi.  You can see a screenshot of the user interface on the GitHub pages: https://github.com/rsta2/minisynth

Closing Thoughts

This is a great virtual synth and I’d really like to get it paired up with an embedded HDMI display and touch screen.  But where I’m ultimately really wanting to end up with all this is some kind of “twiddle the knobs” physical interface for a bare metal Raspberry Pi synth, so I’ve still a little way to go.

But as a relatively simple and understandable (in code) synth, I can certainly recommend having a bit of a play with Rene Stange’s “mini synth”.

Kevin

4 thoughts on ““Bare Metal” Raspberry Pi Synth – Part 4

  1. Hi Kevin,
    this is all very interesting! I share your idea to use the old Raspis I had collected.
    Yesterday I came so far as to the mini organ, today I had the MiniSynth working (but with a precompiled release only).
    I understood you still are working on the control code for the hardware control.
    I’m looking forward to hear of this.
    Jean-Claude

    Liked by 1 person

    1. Well I’m not actively working on it at the moment – all my RPi efforts really are on MiniDexed right now 🙂
      (BTW – did you see I’ve used MiniDexed on a Pi V1 too?)

      But I do plan to get back to it one day!

      Do let me know where you go next with it all yourself.

      Kevin

      Like

      1. Hi Kevin,

        in fact I remember now that I saw the MiniDexed first (in your newsletter).
        Then I got lost a bit and landed in your other posts.

        So I will look at the MiniDexed now.

        I have a good friend who is also interested in synths (-> weigu.lu) whom
        i excitedly showed my results.
        He asked me “Why not use a Teensy?” (I had already done some work on the
        Teensy ( -> https://github.com/jean-claudeF/TeensySynth ).
        My answer was similar to yours: I have some Raspis lying around that I
        want to use. And I was curious to see how difficult Bare Metal would be.
        Well, I only used the code of other people, but it was already interesting.

        Greetings,

        JC

        Liked by 1 person

      2. Yes, there is a port of Dexed to the Teensy – MicroDexed. I think it can support two tone generators? But as you say, when there are V1 Pis around, why not find a use for them 🙂

        Do keep me in touch with how you get on!

        Kevin

        Like

Leave a comment