How to find the Raspberry Pi IP address?
Thank you to Code Signing Store for providing a DigiCert Code Signing Certificate and supporting open source software!
One question I receive quite often is: how to find the Raspberry Pi IP address on the local network? It's useful to know the IP address indeed to be able to SSH the Raspberry Pi.
First, you need to know the router's address. In a terminal / command prompt, do
ifconfigon Linux or
ipconfigon Windows, and you will find something like:
Default Gateway : 192.168.1.1
Now let's use the tool
nmap(available both on Linux with
apt installand on Windows here). Replace the last number by
This will allow
nmapto scan the network for machines in the range 192.168.1.0 to 192.168.1.254.
After a few seconds, it will display if the Raspberry Pi has been found, along with its IP address.
In many Raspberry Pi distributions (such as Raspbian / RaspiOS), you need to have a file
/boot/ssh (in the
boot partition) to be able to SSH the RPi!
We all love samples and audio files... but how to find the right one on your computer when you have thousands of WAV files? :)
The new software SampleIndexer (currently in beta) might help!
Get informed about the forthcoming release:
Short news again:
Many people have added a lot of features to SamplerBox in the last months. Big up to Erik, HansEhv, AlexM, Pavel, Rémi, Huskypop and many others!
- Side project: I've just released TalkTalkTalk, a small easy-to-install web chat, that you can host on your own server.
Huskypop's Mellotron made with SamplerBox.
Summer 2016 news!
A few short news:
Since the beginning of the project, I thought it was impossible to use the Raspberry Pi's built-in audio chip, because it always led to stuttering sound. This is wrong, I've now been able to make SamplerBox work with the Raspberry Pi's internal sound chip. Thus, a USB DAC is no longer mandatory. It is still recommanded for better audio quality, but not mandatory. More news about this in a future update!
Technical reason: I replaced
pyaudio(which has some bugs somewhere, note: this is not the first bug I discover in this library, there's also one leading to crashes on Winows platform, when devicenames use non-standard characters such as é or à!) by the module
python-sounddevice, which is equivalent (a python wrapper for PortAudio) but cleaner.
- A RaspberryPi 3 ready-to-use ISO image is now available here.
How to power the RaspberryPi for more than 7 hours with a single 18650 battery
Get a good 18650 battery by a dealer who knows what he's speaking about (and who has done some test to be able to tell it's not fake batteries).
Maybe I was just unlucky, but the red UltraFire battery I got from eBay was just crap. The good one was a Sanyo/EVVA 3400 Protégé got from PuissanceLed:
Get this 1€ battery charging board, and use this wiring:
- Ready to run for more than 7 hours!
During this test, the SamplerBox software was constantly running (so there was a non-negligible CPU usage), and these devices were connected to the RaspberryPi, taking some power:
- a USB DAC (for better audio quality),
- a USB MIDI keyboard (Akai LPK25),
- a USB SD card reader,
- a 7-segment 4-digits display,
so this means it could even be longer without these devices! I also read somewhere that it's possible to completely disable USB hubs, this could be useful for some other project.
And some other ideas for even longer battery-life (see this discussion):
- CPU throttling (allowing to decrease from 700Mhz to as low as 100Mhz when the RaspberryPi doesn't need much power),
- disable Ethernet port,
- plus many other ideas in this discussion...
Battery-powered, good news
In previous blog posts, I shared my disappointment because I wasn't able to have a decent battery life, when trying to power the RaspberryPi with battery. I couldn't get more than 1.5 hours with a 18650 battery (for those who don't know these: it's a 3.7V battery, a bit larger and higher capacity than standard AA batteries).
I was a bit sad because this meant to have to abandon the concept of portability, of being able to play outside with SamplerBox. Or to have to go for solutions like using many batteries (2 or 4) or big USB powerbanks, and I didn't like this idea. I didn't like it for this reason: a smartphone is able to run for one day or more, also runs Linux (Android uses Linux kernel), with a very small battery, so I wanted to be able to find a similar solution in terms of battery-size and battery-life, with a RaspberryPi.
Now there's good news.
Today I did some new tests, with a new 18650 battery that I bought from PuissanceLed. Waw, this guys knows what he's speaking about, he did some extensive benchmarks before selling his batteries! I chose the "Sanyo 3400 protégé", which costs 13,50€.
And the result is great: the RaspberryPi ran for a little bit more than 7 hours with a single battery, before it shut down (and tried to reboot, but the battery was empty).
Why was the result so poor (only 1.5 hours) with the previous 18650 battery that I tried? Probably because it was a cheap fake 18650 battery from eBay. My conclusions here about this subject.
What we have done and what we haven't done (yet)
After a few months on this project, a lot of feedback (thanks everyone!) and some long holidays in Italia with both sun and rain (yes this is our tent but surprisingly all was fine 2 hours later!),
it's now time to think about the big picture of the project (by the way, bigpictu.re is another project of mine: if you like mind maps, or an infinite panning and zooming whiteboard, you're gonna like it!).
What was the initial goal of SamplerBox?
- to be able to jam anywhere with a portable instrument,
- for hours,
- without having to connect many cables and many other stuff, i.e. the goal was all-in-oneness,
- to have great sound quality, low latency, high polyphony,
- to be able to load 500MB+ piano sample sets,
- to have fast boot like on every normal synthesizer.
What is currently achived? What is not?
I think #4 and #5 are done, thanks to the RaspberryPi, a good cheap USB DAC, and my not-too-bad code (I spent some time on code optimization to allow high polyphony). After some work, #6 is now ok as well.
About #3, my dream would be to be able to build an all-in-one keyboard + SamplerBox unit, like this (or maybe 3 octaves instead?):
Let's call it SamplerBox Keyboard. I'd like to have your feedback about this! What do you think? Would you like such a unit?
Anyway, this is probably for later.
Now the main problem for me is #2 : if we want many hours of battery life, we need expensive and/or big size batteries. I don't like this idea. Maybe we need to change the whole board: RaspberryPi is cool but not for having the device run for 10+ hours with a 5.5cm x 4cm x 0.5cm battery (the size of my phone's battery):
So right now my main question is: is there a board that is able to run Linux, is small-sized, has some good CPU, and can run 10+ hours on battery? Yes smartphones are like this! Does this exist in the form of a board (in the fashion of Arduino, RaspberryPi, Teensy, etc.)? I need your help about this!
About #1, I'd need to experiment more with small-sized loudspeakers.
I'm often asked this question: “Do I really need to build the whole thing (electronic parts, etc.) to be able to use SamplerBox?” In fact, no.
The project has been designed in such a way that, you can start small, and add more parts then, if you like it. Here are various ways (that all work!) of using SamplerBox:
“I'll just use a bare RaspberryPi + SamplerBox program. No enclosure, no electronic parts for me!”
“I would like to have MIDI IN, so I'll just add the small MIDI circuit, but nothing else (no LED display, no buttons etc.)”
“I would like to build the whole thing, but without the wooden enclosure, and without the MIDI IN circuit (because all my keyboards are USB, so I won't use MIDI IN plug)”
- “I will build the whole thing and even add more features!”
Of course, we'll be happy here if you choose #4, but any other choice will work...
Help wanted for...
Some features that would be cool:
Battery-powered: the goal would be to have a really portable instrument, with which you can jam outside!
I already tried with a single 3.7V 18650 battery:
It worked well for more than 1 hour.
But in order to have a really cool user experience, we need a circuit that would automatically charge the battery when a phone charger is plugged in (case #2 below), and that automatically switches to battery-powering when the charger is removed (case #1). The switching should be done without any 1-second-power-interruption (that would reboot the Raspberry Pi)!
And a last thing: we should be able to detect "Low battery" and print it on the main display.
Help wanted on these topics!
- Loudspeaker: find a small-sized loudspeaker + an amplifier that could be embedded in the box. LM386-amp or PAM8403-amp? I already tried a bit, but not really happy with the result.
Should the headphones output also be amplified? If not, we need to turn the amp off when headphones are plugged, and turn it on when using loudspeakers (i.e. when no headphones are plugged).
Again, help wanted for this part!
How to create a sample set
Here is a picture showing how to create a sample set, and where to put it:
These are the available keywords in the
%notename: C1, C2, C3, D#3, F#4, etc.
%midinote: 36, 48, 60, 63, 78, etc.
%velocity: 1, 43, 72, 127 (maximum), etc.