A digital instrument with all the flare of a trombone, with the power and flexibility of an MIDI instrument
My 5v little amp was delivered today - good times!
Tomorrow I'm going to give it a little test with a speaker and the phone to ensure it works.
Folowing that phase I'm going to create a small shield for my Pro Micro.
The shield will have the pressure sensor mounted directly to it, and will have headers for an ultrasonic sensor, and a few buttons. This will give me a nice tidy board to attach to my trombone and to start tweaking my code.
While I'm toying with the idea of using the Android phone to process sounds I still want to retain output via a speaker.
I've found a cheap one of EBay for around £7 that is powered by 5v that would be nice and easy to work with. It won't be any kind of decent audio quality, but it allows me to keep trying out my plans.
I'm away on holiday next week so when I get back it will have arrived and I'll be able to have something assembled not long after i get back. Woop!
In the early hours of this morning I managed to get my hands on an old phone of mine; a Samsung Galaxy A3. It's a 2015 model, so not too dated, but the battery is pretty pants on it ha ha.
Anyhow, I installed the FluidSynth app and found a little USB-OTG adaptor (i knew i had a bag of them somewhere!).
I had a Pro Micro that I had stuck a 'test tone' script on (Playing a middle C for a second, every 3 seconds) and boom - it just worked.
This is perfect for prototyping, as now i can use the phone to quickly test any progress on reading the Pro Micro scripts and interpreting the sensors.
It would also serve as a great 'stunt double' for any Pi-based FluidSynth system while i put together any hardware.
I'm also keeping my eyes peeled for a cheap 5v Amp for the project.
Much cheaper than the Justboom Amp + DAC setup I have on the Pi at present, plus I'd be able to power the amp and the phone from a single 5v power source or a set of stepped up Li-Ion batteries.
Using the phone instead of the Pi could be an absolute game-changer - a brand new handset can be bought for roughly the same price as a Pi these days, and they have all the features needed for this - touchscreen, headphone out, compatibly with software... All without needing to buy extra adaptors or HATs.
I've been tied up with worm far more than expected over these last few weeks and months, so progress has been slow. It has always been at the back of my mind but i havent really been able to push further forward with development.
In order to speed up the process to getting something making noises and getting something worthy of making a video log of for my project I've been looking at alternatives to plug holes in the project and revisit them later.
The first is the frame - while I discuss with pBone a donor instrument or perhaps constructing my own frame I'm going to use my own plastic trombone as a mounting frame for the time being. Itll be messy running wires all over and not being able to modify it, but it'll give me a great platform to test my project on.
Secondly is the onboard processing.
The plan is to create my own custom image for Raspberry Pi to run an instance of Fluidsynth and then output via a gpio mounted DAC to a speaker.
In order to plug this one I've done a random search for MIDI capable synth on the Android platform; the thought being that I could use an old phone to interprete the Arduino output until I get the Pi side up and running. Lo and behold I've managed to even find a Fluidsynth basesmd android app in the Google Play store, ideal for the stand in role!
After sitting pondering on the thought for most of this evening I'm really starting to warm to the idea of an old phone being used instead of the Pi in the project: it has a touchscreen for easy operation, easy to mount with any number of off-the-shelf holder's, has it's own battery, can connect to the Arduino via USB-otg, and has a headphone out to run to an amplifier or an active speaker.
Christ, if I can find a 5v amp I can power it all from a 5v power bank as well.
Quite recently I had a shift in thought over how the Arduino was going to communicate with the Pi. At first I was going to use a serial connection to share commands but eventually realised it would be silly not to use MIDI. Especially when there are Arduino built upon the AtMega32u4 that would just be recognised like a normal midi input device in the Pi, and any other PC the DigiBone could be plugged into.
Tonight I've stumbled across OpenDeck, which packs some fantastic open source software to simplify the whole process.
I'm looking forward to putting this to use on an Arduino tomorrow.
Just a couple of things to report:
After stumbling upon it in a Hackaday article I've become somewhat infatuated with the idea of using the software used in the http://zynthian.org/ project.
Pi based, DAC support and plenty of apps to try it seems perfect to use in my project.
I will focus on turning my Arduino portion into a MIDI device to work with the software as expected.
Also a little while ago I contacted a company that make a product called pBone, a lightweight and cheap plastic trombone that would make for a perfect mounting frame for this build. They finally got back in touch - hopefully if they are open to providing some parts that have failed QC or have been marked for the scrap heap I will be able to build my project around That!
Just a quick update as I've been reasonably quiet, and I'm on holiday next week.
The DigiBone script is getting closer. I've ditched the LCD screen for the moment, and plan to include a Nextion display in the not-too-distant future. The Nextion screen will allow for a lovely GUI for controlling settings, and only needs a serial connection to communicate with the Arduino.
Finally got round to adding the Ping sensor to my board.
Did some work to the code to incorporate the NewPing library to handle my ping sensor, uploaded the code and got an LCD full of gibberish.
I'm assuming it is power related (The rest of the script runs fine) soon will have a look at rewiring the breadboard tomorrow.
On a lighter note the Arduino has been successfully talking to the python script via serial and sending data, and the python script has been playing according beeps.
Next step is to add some debouncing to the arduino code buttons, and then focus on using the Ping data and range value to determine what note to send to the Python script.
I would like to use an air pressure sensor to trigger when notes are to be played; it keeps the hands free to use the pitching buttons and also is in keeping with the trombone.
The pressure sensor will most likely be used in an on/off sense and not to dictate the velocity of the notes.
Coding the Arduino will follow a pattern of:
If air pressure sensor returns a value indicative of air being put into it, then:
read slide position and range value, and send the corresponding note to the Pi.
I will be ordering some of these on pay day to give them a try. They look small enough to be inserted inside a mouthpiece so that's a brucey bonus:
This is the middle Range of the scale, and octaves can be achieved by adding or subtracting 12; C3 would be 48, and C5 would be 72.
I have used the MIDI Values to map out what notes an actual trombone can play on its positions. This way the final product will be very playable for trombone players.
|8: Top Bb||70||69||68||67||66||65||64|
For the final Slide mechanism I will take a total of whatever potentiometer/s values and divide it by 7 to determine the slide position and the pitching value (controlled by the PitchUp/PitchDown buttons) to then play the correct value.
The arduino code will all be triggered by either a momentary button or an air sensor to trigger playback; while the play button is pressed the arduino will then pass the serial data to the Pi.