It’s been almost a year but today I did my initial commit to the new Convergence Jukebox 2 software. Users wont find much difference between the two versions other than the Jukebox 2 GUI code is written using Kivy. My belief is that a Kivy base will allow me to speed up new features for Convergence Jukebox 2, many of which I have preliminary working Python code for.
During the year of re-coding errors on the Github site were reported –primarily missing files– which I took time this morning to fix. Everything from a Windows OS perspective appears to be working and I updated the associated readme’s to explain how to use the software.
The initial commit of of Convergence Jukebox 2 is now available on its Github page.
Convergence Jukebox 2 Kivy Based GUI
Convergence Jukebox 2 is an update to the original Convergence Jukebox using a Kivy based GUI in place of Tkinter. Convergence Jukebox 2 is now the working version of the software meaning it will be continually developed from this point forward.
Convergence Jukebox 2 is a fully functional retro jukebox application. It emulates “physical” jukeboxes and is written in Python. The software has been designed to be fully functional, playing mp3’s both randomly and via a credit system.
Convergence Jukebox 2 is open source Python based software that has been written in Python 2.7 to emulate a “retro” style jukebox. The type of jukebox that was popular in bars, restaurants and recreation areas during the 1950’s and 60’s. Written from scratch by Brad Fortner of Convergence Communications, Convergence Jukebox 2 plays properly formed ID3 tagged mp3 media.
The Jukebox can be controlled for “personal” use by your computer keyboard but is better operated with a USB keypad. Its output resolution is modifiable allowing it to connect to inexpensive computer, laptop or TV displays with its “retro look and feel”. It can even be connected to bill, coin or card acceptors for “pay to play” situations. More information can including an FAQ and instructions on how to format mp3’s be found on the Convergence Jukebox blog at www.convergencejukebox.com.
- Unlimited mp3 library size: Currently operating in our development centre is a version containing 15,800 mp3 files. This implementation runs on minimum hardware. In this case it’s an HP MINI 210 PC that contains an Atom N450 processor, 1024 MB of memory and a 160.0 GB hard drive. Jukebox 2.0 has yet to be tested on a Raspberry Pi.
- Automatic Song Detection: MP3 library database is built automatically when additional properly formed ID3 tagged files are added to the media folder and the program is restarted.
- Multiple Display Resolutions: Developers can change display resolution, skins and customize all items on the screen (such as song name positions) using Python Kivy code.
- Customizable To Your Location: The Jukebox name or service at top of arch can be customized in the Python Kivy code.
- Background Music System: Convergence Jukebox plays library loaded in Jukebox in a continuous manner randomly. Makes an excellent background music system.
- Different Styles Of Music: mp3’s can be tagged with genres in comment area of ID3 tag. Random play can be set to play specific genres by altering a simple text file.
- Songs Can Be Skipped: mp3’s can be tagged “norandom” meaning they will never play randomly. This means mp3’s with potentially unsuitable content can only be played if selected.
- Avoids Repeating The Same Songs Continuously: mp3’s on the random list are only played once during a random play cycle.
- Automatic Resetting Of Random List: Convergence Jukebox resets the random list when the software is rebooted or all selections in the jukebox have been played once randomly.
- Clearly Identified Songs: While song is playing, song title and artist are displayed prominently under the Jukebox arch on the display.
- More detailed song information is displayed in the green display (top left) that includes year released, song length and album name pulled from the mp3 id3 tags.
- Convergence Jukebox plays user selected songs (paid) as a priority: When selected songs are listed in order of selection under the Upcoming Selections heading in the status area.
- Users cannot select the same song if it’s on the Upcoming Selections list. This eliminates the same song from being played repeatedly.
- Songs played via selection are removed from the random playlist. This eliminates the same song from being played repeatedly.
- Random play resumes once user selected songs have completed playing.
- Number of Credits, cost per credit and the number of songs available in the library are clearly displayed (and editable in the Python code) at the bottom left of the green screen .
- Users can navigate through available music using up/down/left/right navigation keys.
- Users can navigate through music selecting songs by either Title or Artist.
- Users can navigate to the alphabetical start of either Artist or Title using specific letter keys that employ multiple keypresses.
- A log is kept of each song played randomly, each song paid to play, when the Jukebox is rebooted, when songs are added and when a new random list is generated.
- Python code has been written for is included in Convergence Jukebox that’s not been documented in the released version that talks to the Dropbox folder to providing RSS feeds for digital signage systems. As well as It is possible to include code to create tweets to Twitter accounts making the jukebox useful as a global barker system.
New In Convergence Jukebox 2.001;
- Jukebox GUI re-written in Kivy.
- Bug fix so last song on selection screen can now be accessed.
- Artists are kept in proper alphabetical order including bands that start with The.
- Bug fix so GUI wont crash when there are no titles or artists during Title Or Artist selection search.
The Convergence Jukebox website at http://www.convergencejukebox.com contains links to Python source code.
For the record I haven’t stopped developing Convergence Jukebox. I’m looking at a number of new features and improved interoperability. I spent the last several months working towards additional features and have developed initial code that includes;
- An additional module that searches Wikipedia and returns Artist info as song is playing for possible display.
- A panel that allows one to select Genres, Year Range and Artist names for random play
- The ability to search by typing in artist or song names to narrow searches down.
- A module that will add “The” to bands whose names begin with the while maintaining alphabetical order.
- Animation that will potentially show a 45RPM record spinning with artist name and title while music is playing.
To add all these features to Convergence Jukebox I decided that I could no longer work with tkinter. So I opted to learn Kivy after reading about it’s many features that seem much more modern in its design. So today I proud to display a development image of Convergence Jukebox 2.0 with it’s main screen being rendered by Kivy. It will look pretty familiar displaying all of the objects positioned on the screen required to be functional in it’s initial release. Here’s what it looks like;
I’m hoping that a Kivy version will be much easier to package for Windows, Mac and Raspberry PI. As well Kivy offers a path to an Android and IOS version using its Python Code base.
You can find more about what I’ve been learning about Kivy by following a series of blogposts starting with Kivy For The Non Computer Scientist – Part 1: Making It Simple. And more specifically you can look at Kivy For The Non Computer Scientist – Part 17: Making Natural Looking GUI’s Using Kivy’s Float Layout.
This month’s updates to Convergence Jukebox (March 2016).
- A screen has been added that lets users know when the song database is updating and to be patient.
- Genre file changes are now detected by timestamp generated when genre-flags.txt is changed. This negates the need for the built-in text timestamp in genre-flags.txt file.
- to negate Convergence Jukebox from crashing when improperly tagged mp3 files are added to the /music subdirectory
- mp3 files deleted from /music subdirectory if Unicode characters found in their song title ID3 tag.
- mp3 files deleted from /music subdirectory if Unicode characters found in their artist ID3 tag.
- mp3 files deleted from /music subdirectory if Unicode characters found in their comment ID3 tag.
- mp3 files deleted from /music subdirectory if song title ID3 tag found empty
- mp3 files deleted from /music subdirectory if artist ID3 tag found empty.
The code at the GitHub site, the Windows.exe and Raspberry Pi image have all been updated to include the additions.
In case you’re interested, here is a slideshare of the presentation and software demonstration made at the Raspberry Pi Toronto Meetup group March 10, 2016.
One of the things you may wish to do with Convergence Jukebox is create an always on Jukebox to both random play your music and allow you to do credit plays when you feel like listening to a specific song.
Here’s how you set one up using any Raspberry Pi (Version 1 or 2);
- Next step is to install PuTTy and WinSCP between your Windows Computer and your Raspberry Pi. This will allow you to transfer files between the two computers. An explaination on how to do this can be found at http://bit.ly/1NVLAWP, while a concise video on how to do this can be found at https://www.youtube.com/watch?v=RyNii3UcHPw
- The layout on the Convergence Jukebox requires 720p resolution. Edit the R-Pi configuration file so the Raspberry Pi will output 720p using HDMI.
- Edit the R-Pi configuration file so the Raspberry Pi will output sound to the appropriate output. In this case the setting is HDMI to your computer monitor.
- Download convergencegui.py, convergencejukebox.py, convergeneplayer.py, gui_launch_pi.bat, run_gui_py, jukebox.png, success.mp3 and buzz.mp3 from the Convergence Jukebox GitHub site at https://github.com/bradfortner/convergence_jukeboxUltimately you want to create a /home/pi/python/jukebox subdirectory to house the Convergence Jukebox python software. If you don’t know how to do this it is done by:
- From your Raspberry Pi’s /home/pi directory create a python subdirectory.
- From the /home/pi/python directory create a jukebox subdirectory. This is the subdirectory at home/pi/python/jukebox whereconvergencegui.py, convergencejukebox.py, convergeneplayer.py, gui_launch_pi.bat, run_gui_py, jukebox.png, success.mp3 and buzz.mp3 are to be placed. Transfer them…..
- These three functions can be done using WinSCP on your Windows computer. First create the subdirectories and then make the transfers
WinSCP Transferring Appropriate Files T0 /home/pi/python/jukebox Subdirectory From Windows Computer To Raspberry Pi.
- Two files require execute permission. They are gui_launch_pi.bat and run_gui_py. You can change their permissions using your Raspberry Pi’s File Manager (as shown below) by;
- Selecting the folder where the files are located.
- Right clicking on the file.
- Select Permissions tab.
- Changing the execute Access Control to Anyone.
gui_launch_pi.bat and run_gui_py Files permissions must be changed to anyone in order for Convergence Jukebox to operate.
- Download a zip file containing 79 creative commons mp3’s from http://bit.ly/1nHJCUG. These are mp3 files containing properly formed ID3 tags and will work right out of the box with Convergence Jukebox.
- When downloaded unzip them in a folder on your Windows Computer
- To operate, Convergence Jukebox requires Python 2.7 with the following libraries added to it;
- hsaudiotag – sudo pip install hsaudiotag
- mpg321 – sudo apt-get install mpg321
- pillow – sudo pip install pillow
- ImageTk – sudo apt-get install python-imaging-tk
- PyRSS2Gen -sudo pip install PyRSS2Gen
- So the mouse cursor will disappear once your jukebox starts operating install Unclutter – sudo apt-get install unclutter
- To start jukebox when your Pi is booted, edit the Raspberry Pi’s autostart file by typing sudo nano /home/pi/.config/lxsession/LXDE-pi/autostart. Add the following two lines of code (above @xscreensaver -no-splash) as shown below;
- @/usr/bin/python /home/pi/python/jukebox/convergencejukebox.py
Edit autostart found in /home/pi/.config/lxsession/LXDE-pi/ by adding the two lines as shown above.
- While in the same file edit and add the following ato the end of the file to disable screen blanking;
- place a # in front of the @xscreensaver -no-splash
- @xset s off
- @xset -dpms
- @xset s noblank
- save and exit the file
Final edit to autostart file found in /home/pi/.config/lxsession/LXDE-pi subdirectory
- Reboot your Raspberry Pi.
Screenshot Showing First Boot Of Convergence Jukebox. On First Boot It Stops And Asks For You To Transfer At Least Fifty MP3’s Into Its /home/pi/python/jukebox/music Subdirectory.
- If all was done correctly your Raspberry Pi should reboot and Convergence Jukebox will stop (as shown above) asking you to add mp3’s to it’s music directory.
- Unzip the zip file that you downloaded earlier containing the 79 creative commons mp3’s into a folder on your Windows computer.
- Using WinSCP transfer the 79 songs from the folder on your Windows computer to the /home/pi/python/jukebox/music subdirectory on your Raspberry Pi.
Using WinSCP transfer the Creative Commons mp3’s downloaded earlier from your Windows computer to /home/pi/python/jukebox/music subdirectory on your Raspberry Pi.
It will take up to 3 minutes for Convergence Jukebox to create a database of the 79 songs in its music directory and once done the GUI will appear and the Jukebox will start playing them randomly.