Diccon
Posts: 5
Joined: Mon Mar 11, 2019 8:38 pm

Automating setup of midi piano

Tue Mar 12, 2019 11:31 pm

This is my first project with my Pi 3 B+.

I have a USB Piano Keyboard that i want to use with my Pi. I have gt it working using Fluidsynth and then connecting the ports using aconnect is a separate terminal widow.

I now want to automate the setup so that my children can just switch it on.

To do this I have added script to the global autostart file.

Code: Select all

#!/bin/bash/sh
fluidsynth -is --audio-driver-alsa --gain 3 /usr/share/sounds/sf2/FluidR3_GM.sf2
wait(30)
aconnect 20:0 128:0
I know that fluidsynth is loading as the client appears when I run aconnect -o

Thak you

tvjon
Posts: 692
Joined: Mon Jan 07, 2013 9:11 am

Re: Automating setup of midi piano

Thu Mar 14, 2019 9:48 am

Diccon wrote:
Tue Mar 12, 2019 11:31 pm
This is my first project with my Pi 3 B+.

...
To do this I have added script to the global autostart file.
...

I know that fluidsynth is loading as the client appears when I run aconnect -o

Thak you


I imagine they'll be really pleased with your project.

What name shows up for your usb midi keyboard via:

aconnect -o

& which "global autostart file" would that be?


Unzip the attached small application, & run it from a terminal thus:

$ ./keysynth /usr/share/sounds/sf2/FluidR3_GM.sf2 The_name_of_your_Keyboard


All being well, you can put that line in your script, eg., this is the one I currently use, although not autostarting.

Code: Select all

#!/bin/bash/sh
./keysynth /usr/share/sounds/sf2/8MBGMSFX.SF2 Uno

tvjon
Posts: 692
Joined: Mon Jan 07, 2013 9:11 am

Re: Automating setup of midi piano

Thu Mar 14, 2019 9:54 am

tvjon wrote:
Thu Mar 14, 2019 9:48 am
Diccon wrote:
Tue Mar 12, 2019 11:31 pm
This is my first project with my Pi 3 B+.

...
To do this I have added script to the global autostart file.
...

I know that fluidsynth is loading as the client appears when I run aconnect -o

Thak you


I imagine they'll be really pleased with your project.

What name shows up for your usb midi keyboard via:

aconnect -o

& which "global autostart file" would that be?


Unzip the attached small application, & run it from a terminal thus:

$ ./keysynth /usr/share/sounds/sf2/FluidR3_GM.sf2 The_name_of_your_Keyboard


All being well, you can put that line in your script, eg., this is the one I currently use, although not autostarting.

Code: Select all

#!/bin/bash/sh
./keysynth /usr/share/sounds/sf2/8MBGMSFX.SF2 Uno
OOps, forgot to add the file.
Attachments
keysynth.zip
(3.75 KiB) Downloaded 24 times

Diccon
Posts: 5
Joined: Mon Mar 11, 2019 8:38 pm

Re: Automating setup of midi piano

Thu Mar 14, 2019 9:13 pm

Thank you, I will give that a go.

I have run the aconnect -o command and the keyboard appears on 20 and fluidsynth on 128. Once the system has booted up if I type aconnect 20:0 128:0 everything works which is how I know fluidsynth is loading properly.

The autostart file is /etc/xdg/lxsession/LXDE-pi/autostart

Thanks for the help

Diccon
Posts: 5
Joined: Mon Mar 11, 2019 8:38 pm

Re: Automating setup of midi piano

Thu Mar 14, 2019 11:28 pm

The keyboard name on aconnect -o is miniKEY

Diccon
Posts: 5
Joined: Mon Mar 11, 2019 8:38 pm

Re: Automating setup of midi piano

Thu Mar 14, 2019 11:35 pm

Sorry to be a pain.

I have loaded it onto the pie and I am getting

bash: ./keysynth: Permission denied

I am running from the Pi account.

Any ideas please?

Diccon
Posts: 5
Joined: Mon Mar 11, 2019 8:38 pm

Re: Automating setup of midi piano

Fri Mar 15, 2019 12:18 am

I had another play and works perfectly including in the autostart file

Thank you

Return to “Other projects”