Remote GUI to play/stop

Good Afternoon,

I am new to Sonic Pi and coding and am in need of some help.

I have recently set up a Raspberry Pi 3 B+ with the 7" touchscreen (though I have mouse and keyboard attached for ease)
I am trying to make a remote GUI with a play and stop button that will execute the run and stop function in Sonic Pi.
I am able to make a GUI window using Thonny Python IDE that is included with the OSC that I bought with the Raspberry Pi. I just need to get the GUI window and Sonic Pi to talk to one another. I am running Sonic Pi v3.2.2.

I have read some things online and watched some videos, however I am stuck. When I go into the command prompt in the Raspberry Pi and enter pi@raspberrypi:# s gem install sonic-pi-cli -v0.1.3
I receive the following error:
Fetching: osc-ruby-gem (100%)
ERROR: while executing gem…(Gem: :FilePermissionError)
you don’t have qrite permissions for the /var/lib/gems/2.5.0 directory.

Any help to get a play/stop GUI functioning would be very appreciated.

Thank you
Phil

use
sudo gem install sonic-pi-cli -v0.1.3

Fantastic, that has worked :slight_smile: now to see if I can get this GUI working.

Thank you for the help

Great. funnily enough I was having a play with something similar last week. I did a similar project with an early version of Sonic Pi some time ago.

EDIT in that I used a very cumbersome way of installing the sonic-pi-cli fiddling with permissions. Much easier just using sudo!

Fabulous, I was actually looking at an older one of yours with the play/stop remote GUI using Frere Jaques. looking at the Jukebox one now and currently installing Kivy.

Thank you again for the help.

I was following the Kivy install section, and it was going well up until step 9. then I started to get errors (I have included spaces in the code as I am unable to post links as a new member):

pi@raspberrypi:~ $ sudo apt-get -y install pkg-config libl1-mesa-dev libgles2-mesa-dev \

python-pygame python-setuptools libgstreamer1.0-dev git-core \

gstreamer1.0-plugibs-{bad,bse,good,ugly} \

gstreamer1.0-{omx,alsa} python-dev

Reading package lists… Done

Building dependency tree

Reading state information… Done

Note, selecting ‘git’ instead of ‘git-core’

E: Unable to locate package libl1-mesa-dev

E: Unable to locate package gstreamer1.0-plugibs-bad

E: Couldn’t find any package by glob ‘gstreamer1.0-plugibs-bad’

E: Couldn’t find any package by regex ‘gstreamer1.0-plugibs-bad’

E: Unable to locate package gstreamer1.0-plugibs-bse

E: Couldn’t find any package by glob ‘gstreamer1.0-plugibs-bse’

E: Couldn’t find any package by regex ‘gstreamer1.0-plugibs-bse’

E: Unable to locate package gstreamer1.0-plugibs-good

E: Couldn’t find any package by glob ‘gstreamer1.0-plugibs-good’

E: Couldn’t find any package by regex ‘gstreamer1.0-plugibs-good’

E: Unable to locate package gstreamer1.0-plugibs-ugly

E: Couldn’t find any package by glob ‘gstreamer1.0-plugibs-ugly’

E: Couldn’t find any package by regex ‘gstreamer1.0-plugibs-ugly’

pi@raspberrypi:~ $ ~wget https ://raw.github. com/pypa/pip/master/contrib/get-pip.py

bash: ~wget: command not found

pi@raspberrypi:~ $ get https ://raw.github. com/pypa/pip/master/contrib/get-pip.py

bash: get: command not found

pi@raspberrypi:~ $ sudo python get-pip.py

python: can’t open file ‘get-pip.py’: [Errno 2] No such file or directory

pi@raspberrypi:~ $ wget https : // raw.github . com/pypa/pip/master/contrib/get-pip.py

–2020-06-04 15:22:24-- https :// raw.github .com/pypa/pip/master/contrib/get-pip.py

Resolving raw. github . com (raw. github. com)… 199.232.56.133

Connecting to raw . github. com (raw. github. com)|199.232.56.133|:443… connected.

HTTP request sent, awaiting response… 301 Moved Permanently

Location: https :// raw. githubusercontent .com/pypa/pip/master/contrib/get-pip.py [following]

–2020-06-04 15:22:25-- https :// raw.githubusercontent . com/pypa/pip/master/contrib/get-pip.py

Resolving raw. githubusercontent. com (raw. githubusercontent. com)… 199.232.56.133

Connecting to raw. githubusercontent. com (raw. githubusercontent. com)|199.232.56.133|:443… connected.

HTTP request sent, awaiting response… 404 Not Found

2020-06-04 15:22:25 ERROR 404: Not Found.

pi@raspberrypi:~ $ sudo python get-pip.py

python: can’t open file ‘get-pip.py’: [Errno 2] No such file or directory

pi@raspberrypi:~ $ sudo pip install cython pygments docutils

Looking in indexes: https :// pypi. org/simple, https:// www.piwheels. org/simple

Collecting cython

^[[15~ Downloading https:// files. pythonhosted. org/packages/ba/b7/00ef671f74ee4694de58d88101e6f9a655cb8009e37a66a57f19642ff5d6/Cython-0.29.19-py2.py3-none-any.whl (971kB)

100% |████████████████████████████████| 972kB 247kB/s

Collecting pygments

Downloading https:// www. piwheels. org/simple/pygments/Pygments-2.6.1-py2.py3-none-any.whl (914kB)

100% |████████████████████████████████| 921kB 256kB/s

Pygments requires Python ‘>=3.5’ but the running Python is 2.7.16

pi@raspberrypi:~ $ ~git clone https:// github .com/kivy/kivy

bash: ~git: command not found

pi@raspberrypi:~ $ cd kivy

bash: cd: kivy: No such file or directory

pi@raspberrypi:~ $ pyhton setup.py install

bash: pyhton: command not found

pi@raspberrypi:~ $ sudo python setup.py install

python: can’t open file ‘setup.py’: [Errno 2] No such file or directory

would I need all of this to get the button on my Tkinter script to control Sonic Pi?

the GUI I am currently working with is:

from tkinter import *

from tkinter import messagebox

window = Tk()

window.title(“Fantasy Sounds”)

‘’

window.geometry(‘350x200’)

‘’

def clicked():

messagebox.showinfo(‘Message title’, ‘Message content’)

btn = Button(window,text=‘Click here’, command=clicked)

btn.grid(column=0,row=0)

window.mainloop()

Apologies for all the questions.

Thank you :slight_smile:

This project is 4 years old and I guess a lot of stuff will be out of date. I haven’t looked at the project really since I did it. It would require quite a lot of research to get going I think, so I can’t give any instant advice.
Maybe see if there are any more up to date kivy projects for a start. I can remember it being quite an effort at the time to get it going.