Beginner advice and/or consultancy?

Pete Jones posted Feb 14, 21:57:

Hey guys, I’m a complete beginner to this, i have along (decades) history of music making with samplers etc but the coding thing with RPi is a totally new experience.

I love that this is open source and sharing the knowledge is awesome.

I wonder if we could come up with a ‘beginners’ page or doc for people like me? I’m of course happy to contribute, but i think it would open the gates for so many more people if we could?

Here is an example of my experience as a total beginner- and please do not mistake this for a complaint!! It's just to give you savvy people an idea of the entry point i started from!

  • Discovered SamplerBox via a Sound on Sound forum - looking for ways to trigger loops with the Rhythm Stick (as midi instrument i invented many years ago that is coming out now for fun jammin sessions!)

  • LOve the open source atitude

  • Have a history of electronics design (mostly hardware not coding etc)

  • Thouht fuk i can now integreate samples, into the Rhythm Stick (used to need external racks of expensive samplers back in the day).

  • Am prepared to try to do this.

  • Buy the RPi3 and kit for SamplerBox RPi3 version

  • My laptop didn't recognise the SD card so i had to buy a external USB micro SD card reader to download the latest RPi3 image.

  • Didn't know what an ‘image’ was before!

  • Found and used some great advice and instructions across the various SamplerBox contributor websites - but i found it a bit disparate.

  • Fiannly managed to get SamplerBox RPi3 image written on micro SD card (i’m impressed with my self that i’m even saying this!!!)

  • Booted my RPi3 to receive a prompt for login ?????????

  • Please bear in mind i had spent many hours reading the forums and documents - that are extremely helpful - but maybe more tilted to those who know like you.

  • Discovered (at Hams’ forum?) that the logins are root/root :)
    Tried that and it worked!

  • Then discovered a flashing prompt and welcome to SamplerBox but can not for the life of me work out what to do next (i did say a total beginner!)

That's where I’m at… totally excited and love this project so want to help but i think my help can perhaps be best to explain the bumps i’m going over to make it happen?

Also, I notice that people can buy PCBs for the SamplerBox very soon - this is excellent! - I would have done that but how about this?

People like me (i don't have much money but) I would pay someone to help/consult me one on one to help me achieve my aims and be able to create by steering and advising me through setting up SamplerBox for my project. I really do believe SamplerBox is a wonderful creative project and deeply thank all those involved :)

BiG LOve (we need a lot of that in our world right now), Pete :)

Nimbo77 posted Feb 17, 16:05:

Hi Pete.

Pretty noobish myself, but perhaps I can help you along a bit:)

You have the Pi booting, so well done on that part. In theory, the SamplerBox is now working. You don't even have to log in for it to work, assuming two things:

  1. There are samples available
  2. You have a MIDI device connected

Pretty simple huh? Unfortunately real life is usually slightly more complicated:)

First thing's first; you need to test the audio on your Pi. And to do that, you need some MIDI input, either over USB or old school DIN. For old school DIN, you have to build a MIDI in circuit; have you done that? Unless you've retrofitted the Rhythm Stick with USB somehow, you're gonna need that DIN socket.

If I were you, I'd just connect a MIDI keyboard that has USB for now. Play some notes and see if the Pi outputs audio. SamplerBox will have a basic sampleset loaded by default.

There are two audio outputs on the Pi; the headphone jack, and also audio through the HDMI. Make sure to try both outputs to rule out software issues. I BELIEVE the Pi is set up to output through HDMI by default, with the headphone jack overriding when headphones are plugged in. The easiest way to test HDMI audio is to just plug it into a TV or computer screen that has speakers. And make sure HDMI audio isn't muted on the screen/TV. That should be the default on any screen, unless you've turned on muting for some reason.

I have a bad habit when doing projects like this. I tend to try to do too many thhings at a time and gambling it will all just work together. Then when something inevitably doesn't work, I have to take it all apart again to identify the problem. It really is much more logical to add ONE thing at a time, and confirm each step before proceeding. Hence my above recommendation.

Let me know how you get on, and I'll try to make suggestions as to where to go from there.

You're likely going to have to put in some work to get this to where you want it, but I dare say it's worth it in the end:)

Pete Jones posted Feb 25, 13:36:

Hey Nimbo! Thanks for your help :)

I have two issues...

  1. after booting, i typed 'root' as login, but it would not accept root again from the keyboard! I tried several times and unplugged teh Pi several times, changed the usb port the keyboard was in. i got it to boot up SamplerBox finally, but thats worrying!?

So after that i get it to teh point where the hdmi screen says "welcome to SamplerBox" and that the program "should be up and running".

There is a flashing curser after teh line "root@samplerbox~#" and thast it.

I have a midi to usb converter - that i tested elsewhere - an am sending midi via usb to teh Pi. i tried all channels but there is nothing.

What confuses me - sorry begginer alert! - is there is no 'program' to use SamplerBox, ive not got the display or any GPIO stuff connected, do i need that to say change midi chanel etc. Like where does all teh setup action take place, via teh hdmi plugged in screen or via teh Pi itselk via the display?

Thanks for your help!!

Pete Jones posted Feb 25, 18:40:

Update: I connected the display and three switches, the display lights up but there is just a row of squares and the SB still doesnt work \:(

HansEhv posted Feb 26, 22:07:

Hi Pete,
Perhaps samplerbox won't start because of a setting in the script that needs to be adapted to your hardware.
Issue "systemctl status samplerbox" to see the state of the service. If it shows any error, then it is not started. Rest of the info there is not very helpful usually...
If it seems OK, you can stop it with "systemctl stop samplerbox". This will (obviously) stop it. You may check with the statsu command however.
Next you start the script manually with "Samplerbox/" and hopefully it will show you enough messages to grasp the problem or upload a next question to the forum so we can help you further. Stopping can be done by issuing ctrl-c.
There are too much possibilties now to try shooting in the dark hoping to hit the isue :-)
Also next commands can help in identifying important configuration items:

python -m sounddevice

amidi -l


aconnect -i


HansEhv posted Feb 26, 22:23:

By the way: which version of the samplerbox are you using now?
Considering "three switches" and the row of squares, it looks like my build (from Otherwise we have at least a crucial difference here as the original samplerbox has 2 switches and a 3-digit display (and obviously different gpio connections...).
...and ofcourse other functionality...

HansEhv posted Feb 26, 22:25:
HansEhv posted Feb 26, 22:33:

and oops again :-(
"Samplerbox/" should be "SamplerBox/".

Pete Jones posted Jul 13, 18:23:

Hi Hans,

Sorry i've been working on getting MegaDrum working the way i need to to for the last few months. Just come back to SamplerBox and tbh, i’m really confused!

I’d really appreciate some help please!

I’m not sure which SamplerBox to use, yours (which is based on a pi3 which i have) or Joseph’s - which i can't see any instructions to build for Pi3.
I built your version [] with three switches and the 16x2 display as i thought it was the latest development with more features like the display, velocity and voice ideas.
I’m really new to this Pi thing and ‘not’ a programmer!
I have worked out that after i burn an image on a SD card with the SamplerBox image, i do not need to have the raspbian OS SD card installed in the Pi3’s internal SD card slot - i.e. that it needs to be replaced with the SB SD card (correct!?!).
I've not had any luck getting Joseph’s version working so i just burnt the SD card with your image (2016-12-28 version) and booted the Pi3 with the display and 3 switches.
Finally i get something! But after a second of “Starting SamplerBox” showing on the display it reverts to “kyb 87%” on the top line of the display and “Invalid mixerdev” on the bottom line. Do you know what that means?
I have a Akai MPK mini 2 midi keyboard plugged in but no usb stick with samples.

Please can you shed any light on this? Would you be up for a phone call maybe? I’m really keen to get it all going for the re-invention of The Jamma ( and very happy to credit you and anyone else who can help big time!

:) pete

HansEhv posted Jul 14, 22:53:

Hi Pete,
Actually I ran into the same issue myself and uploaded a new to the "Build it" tab on my site.
Just download the files mentioned on the last line/dot of "The Software" paragraph.
The samplerbox_audio.pyx hasn't changed, so it's up to to fownload for safety or just skip :-)

If it still doesn't work (which can be be intermediate per powercycle as some cards show their own or sometimes fallback to the default "PCM" which is know to the script), you have to check alsamixer (command line utility).
Use F6 to select your soundcard. Then look how the output is called; I cannot give directions as the view varies per soundcard, but it's not that hard to interpret.
Then add this name to MIXER_CONTROL in the Just append the value to the three item list. If it works, let know what name you had to append and I will update my source as well.

If it still does not work, I don't have a fast solution other than bypass by setting "USE_ALSA_MIXER" to false. This will disable the possibility of using the buttons to change the volume and "87%"on the display will also be gone (being useless now). It's not a really crucial function.

Hope this helps, Hans

HansEhv posted Jul 14, 22:56:

By the way: you can edit the relatively easy by using nano ("nano" in /root/SamplerBox/ folder). Somewhat more friendly editor than vi.

Pete Jones posted Jul 15, 15:16:

Hey Hans,

Many thanks! OK i'm gonna sound really stupid here but as said, i'm no programmer and really new to all this, how do i get to edit stuff like teh .py files? Teh hdmi screen doesnt work with the SamplerBox Sd card in teh Pi3, its just blank?

sorry to be dumb!

HansEhv posted Jul 15, 23:02:

Ok, hm, slight issue :-) No matter. That's what this forum is for.

Th HDMI connection should be working IF it is connected BEFORE powerup. It is not hot pluggable.
Using the hdmi screen and a usb keyboard you can do things, but you need linux knowledge for that (which is the slight issue here) and you won't be able to put the script I mentioned above on your PI.
It is be worthwhile to try to get this working anyway as you then don't really need the console viewer below.
I never use this direct access however (unless I need to see the startup message or screwed up the network stuff somehow :-) )

Alternative: attach the box to your home network with a network cable. Once the cable is connected, the PI presents itself as samplerbox to the network and can be accesssed via protected console access (SSH = secure shell).
You can access this console via a console emulator on your PC. I suggest you download PuTTY. It is free, robust, reliable and does not need installing as it is a plain EXE file (double click on the putty.exe and it will start).
When started, fill in samplerbox in the host name box, make sure SSH is selected in the line below that box (you will the Port box with value 22) and click "open" to start.
You'll get some warnings about an unknown host, accept that and you be bothered by that anymore. You can save these settings, so next time will be quicker.
After a short while you are on the command line of your box. Logon with user=root and password=root as well.
On this command line you then can type the "alsamixer" command, press enter and do steps I described inprevious post. Pressing Esc quits the program.
If you want (you don't need to ever), you can quit the session with the "exit" command. Mind that Linux is case sensitive.

If you need to do something permanent here , it is important to know that the filesystem is readonly. This is to make sure you can simply unplug the power without damaging the system drive (just like windows does not like that either).
This filesystem can made R/W with command "mount -o remount,rw /" (this is also shown the the welcome message).
PuTTY has a nice feature: if you select this command (don't forget the slash) and use your right mouse button, the selected text will be copied to the command line immediately.
Warning: if you have made the filesystem R/W, it is crucial not to unplug power anymore. You need to power off first: use the "poweroff" or "reboot" command for this (that's easy eeh?).

Since Linux is a tough thingy if you're not used to it, I suggest to leave it to the above for now and do the rest via FTP. You may already have an ftp program.
If not, there are several free ones. It needs to support SFTP (Secure FTP, this SSH based). PuTTY also has an ftp client along with it, but is command line based which is not your piece of cake.
I'm using CoreFTP, because it is also small and robust. But there are several others, often offering a better looking GUI's.
Again, you can connect to samplerbox, if you use the right protocol. Depending on the software you have, it might be called SecureFTP/SFTP or ftp using port 22.
Here user and password both root again (to keep it simple....).
Using this ftp program, you can navigate through the folders (samplerbox is in /root/SamplerBox - mind Linux is case sensitive!!).
You can take the script files from the box to your PC and edit with any text editor (notepad, wordpad, even word)
Remember to save as plain .txt files and do not let the extension be screwed up (word might save as Not good, remove the .txt).
Also: when you download scripts from my website as I suggested, they have the extension .txt. This is to make it easier for your browser to process them - but you need to rename the files to remove this .txt extension.

So now you can have a lift-off I hope. Just start using these tools to take a look on the box. As long as you don't make the system R/W it is impossible to break anything.
Important are the steps when you want to change something in script:

  • log on with the terminal emulator to make the system read-write
  • make the the changes on windows to your liking
  • also keep he original files there in case you need to backout
  • upload the changes to the proper directory. Remember case sensitivity and the extension
  • issue a poweroff (or reboot) to safeguard the filesystem.
    If you're adding files, there are more things to care about. So: do not delete the originals, but replace/overwrite them.

Once you see the scripts I talked about, it will all start to make more sense - you do not need to be a programmer for that.

Ah, another thing: Linux remembers commands. You can walk through history using cursor up/down keys. With PuTTY you can also scroll back in the current session to see what the questions and answers were.

HansEhv posted Jul 17, 00:03:

Hi Pete,
That were quite some long stories "just in case".
Please first use FTP as described to overwrite the with the new version from my site.
If that works, the all other info can be kept until new issues arise :-)
Plse let me know, Hans

Pete Jones posted Jul 20, 19:27:

Hey Hans,

You rock! Thank you so much for all your time to explain.

I certainly didnt expect to have to learn how to edit in Linux but it's cool - funny you wouldn't think way back in 1990 (? ish) i was MD of teh first internet firewall company that used a Linux kernel! We even offered a $25,000 reward to anyone who could hack through it. Most of teh attempts were from teh secret services...

OK so cool thanks again ive downloaded free FTP having check out a few and will atempt to fix it as you suggest :) Pete

Pete Jones posted Jul 20, 19:32:

humm just to add, cant i just re-format teh sd card and reload teh latest image?

HansEhv posted Jul 20, 22:25:

Sure, even without reformat. But if you are using mine, you may already have the latest image (it's dated december 28 2016).
I have made improvements to the script later which can help with your audio issues (no guarantee though, but it's in the same area). But haven't and uploaded a new image yet, so for these improvements FTP is the only way out now
But even when using an up2date image, there is always a possibility that you have to adapt something to your own situation. So you may have to look at an old but familiar looking black square with real letters some time :-)
Welcome to the world of open source DIY projects :-)

Lars Madsen posted Aug 27, 21:30:

Hello. I found the samplerbox online as I was looking for a way to make a lightweight setup for playing on the street. I am not a programmer and have never used Linux.
Great idea thank you for sharing!!!

So far I have managed to install the Samplerbox image and boot it. (it does'nt boot on it's own and I need to login) (I bought a monitor and a keyboard)

There is no sound (not through the jack output and neither through the hdmi)

I am using a Raspberry pi 3

My questions are;

  1. Which program do I use to edit the samplerbox sourcecode?

  2. How do I can make it boot on it's own without login and password?

I hope this makes sence and thanks in advance

Lars Madsen posted Aug 28, 00:14:

Ok so now I got WinSCP for my PC and have accessed the Raspberry on my PC. I have tried to change the AUDIO_DEVICE_ID to 0, 1 and 2 to no avail. Still have no sound. Any ideas?


  (not published)
  I want to post as guest