cracktor
Posts: 12
Joined: Tue Jan 12, 2016 2:43 pm

Re: fruitbox MP3 jukebox

Tue Jan 23, 2018 7:23 pm

wow this is exactly where i was looking for! Nice work ! (i want to make an 80's style gettoblaster with a volume control and buttons)

dlink
Posts: 12
Joined: Thu Jan 18, 2018 2:12 am

Re: fruitbox MP3 jukebox

Tue Jan 23, 2018 8:18 pm

Mike any way we can assign a key to move a set number of pages like 10 or 20 instead of single page turns. Like maybe map '<' and '>' to forward and backward a set number of pages called out in the fruitbox.cfg file? When you have 4000 songs and you have your music sorted by artist it takes a long time to get from A to Z using the arrow keys. This way we could set buttons on the interface that would look like this < << >> >.

User avatar
fruitbox
Posts: 246
Joined: Mon Feb 22, 2016 7:35 pm
Location: UK

Re: fruitbox MP3 jukebox

Tue Jan 23, 2018 9:06 pm

dlink wrote:
Tue Jan 23, 2018 8:18 pm
Mike any way we can assign a key to move a set number of pages like 10 or 20 instead of single page turns. Like maybe map '<' and '>' to forward and backward a set number of pages called out in the fruitbox.cfg file? When you have 4000 songs and you have your music sorted by artist it takes a long time to get from A to Z using the arrow keys. This way we could set buttons on the interface that would look like this < << >> >.
No prob -that's a fairly small and safe change. I'll stick that in release 1.4...

Mike

OklahomaGreyBeard
Posts: 35
Joined: Thu Feb 11, 2016 3:14 am

Re: fruitbox MP3 jukebox

Tue Jan 23, 2018 9:26 pm

What specifically is the program looking for as a "key press" to initiate an action? I have a couple of control options including one I've had stuck in my head for years. The first and the one I primarily used with WinCab is a usb keypad that has clear keys and custom inserts for my A-D 1-4, page, volume, select, etc. I've managed on the pi to remap those keys so at the terminal when I press what is normally "NumLock" or 0x45, C5 etc it outputs a lower case "a". The / is a "b"., etc. These keys all work at the terminal, but are ignored in fruitbox. My first thought was because it's USB but I currently control it with a Logitech wireless keyboard that is a USB dongle.

My ultimate goal is control of a SteamPunk themed jukebox I'm building (an idea that's been rolling around in my skull at least 5 years) and the song selection will be done from a python script that listens to pulses on a GPIO pin. It then outputs a keystroke based on those pulses. (no letters only numbers 0-9) If I knew what fruitbox expects to see I could feed it what it wants.

User avatar
fruitbox
Posts: 246
Joined: Mon Feb 22, 2016 7:35 pm
Location: UK

Re: fruitbox MP3 jukebox

Tue Jan 23, 2018 9:42 pm

OklahomaGreyBeard wrote:
Tue Jan 23, 2018 9:26 pm
What specifically is the program looking for as a "key press" to initiate an action? I have a couple of control options including one I've had stuck in my head for years. The first and the one I primarily used with WinCab is a usb keypad that has clear keys and custom inserts for my A-D 1-4, page, volume, select, etc. I've managed on the pi to remap those keys so at the terminal when I press what is normally "NumLock" or 0x45, C5 etc it outputs a lower case "a". The / is a "b"., etc. These keys all work at the terminal, but are ignored in fruitbox. My first thought was because it's USB but I currently control it with a Logitech wireless keyboard that is a USB dongle.

My ultimate goal is control of a SteamPunk themed jukebox I'm building (an idea that's been rolling around in my skull at least 5 years) and the song selection will be done from a python script that listens to pulses on a GPIO pin. It then outputs a keystroke based on those pulses. (no letters only numbers 0-9) If I knew what fruitbox expects to see I could feed it what it wants.
Currently fruitbox (up to v1.3) looks for hard-coded values from the keyboard file device driver which linux provides. In V1.4, I have given the input handling a major overhaul. It is now possible to take input from a variety of input devices - keyboard, touch screen, USB controllers (namely joysticks) and GPIO pins. There will be a new command line option which will allow you assign your buttons. When prompted, you just have to press your input devices' key and fruitbox should auto-detect it. It then creates a button file which is used to provide the mapping.

As 1.4 is imminent, you could wait and give it a try; if it still doesn't fit your needs, then I can try again!

Cheers,
Mike

ajMatus
Posts: 6
Joined: Sun Dec 03, 2017 9:17 pm

Re: fruitbox MP3 jukebox

Tue Jan 23, 2018 10:12 pm

fruitbox wrote:
Tue Jan 23, 2018 9:42 pm
OklahomaGreyBeard wrote:
Tue Jan 23, 2018 9:26 pm
What specifically is the program looking for as a "key press" to initiate an action? I have a couple of control options including one I've had stuck in my head for years. The first and the one I primarily used with WinCab is a usb keypad that has clear keys and custom inserts for my A-D 1-4, page, volume, select, etc. I've managed on the pi to remap those keys so at the terminal when I press what is normally "NumLock" or 0x45, C5 etc it outputs a lower case "a". The / is a "b"., etc. These keys all work at the terminal, but are ignored in fruitbox. My first thought was because it's USB but I currently control it with a Logitech wireless keyboard that is a USB dongle.

My ultimate goal is control of a SteamPunk themed jukebox I'm building (an idea that's been rolling around in my skull at least 5 years) and the song selection will be done from a python script that listens to pulses on a GPIO pin. It then outputs a keystroke based on those pulses. (no letters only numbers 0-9) If I knew what fruitbox expects to see I could feed it what it wants.
Currently fruitbox (up to v1.3) looks for hard-coded values from the keyboard file device driver which linux provides. In V1.4, I have given the input handling a major overhaul. It is now possible to take input from a variety of input devices - keyboard, touch screen, USB controllers (namely joysticks) and GPIO pins. There will be a new command line option which will allow you assign your buttons. When prompted, you just have to press your input devices' key and fruitbox should auto-detect it. It then creates a button file which is used to provide the mapping.

As 1.4 is imminent, you could wait and give it a try; if it still doesn't fit your needs, then I can try again!

Cheers,
Mike
Sounds amazing! Will be looking forward to this, and see the ease of use with coin acceptors :D

scnolan
Posts: 1
Joined: Wed Jan 24, 2018 4:00 am

Re: fruitbox MP3 jukebox

Wed Jan 24, 2018 4:08 am

Been trying to install this on a Retropie install however I'm getting a error after I try to run:

[email protected]:~/rpi-fruitbox-master $ ./fruitbox --cfg skins/WallJuke/fruitbox.cfg

./fruitbox: error while loading shared libraries: libpng16.so.16: cannot open shared object file: No such file or directory

I have no idea what I'm doing

alfarero
Posts: 8
Joined: Sun Jan 21, 2018 2:36 pm

Re: fruitbox MP3 jukebox

Wed Jan 24, 2018 7:27 am

A suggestion for the creator. You could create an image type .img that enters a microSD of about 8GB already with the program installed self-executing when booting and the MP3 will be loaded by a USB stick

User avatar
karrika
Posts: 1047
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: fruitbox MP3 jukebox

Wed Jan 24, 2018 4:01 pm

fruitbox wrote:
Tue Jan 23, 2018 5:43 pm
Touch screen teaser for release 1.4 ...

TouchSeven.JPG

Mike
Sweet display. Congrats!

ajMatus
Posts: 6
Joined: Sun Dec 03, 2017 9:17 pm

Re: fruitbox MP3 jukebox

Wed Jan 24, 2018 5:56 pm

Suggestion, couldn't find how to do this. Is there a way to browse by artists/albums and then selecting the songs you'd want in the album? On another note, it would be cool if in the future it could play music videos for those who have collections of music videos like myself :)

OklahomaGreyBeard
Posts: 35
Joined: Thu Feb 11, 2016 3:14 am

Re: fruitbox MP3 jukebox

Wed Jan 24, 2018 7:26 pm

ajMatus wrote:
Wed Jan 24, 2018 5:56 pm
Suggestion, couldn't find how to do this. Is there a way to browse by artists/albums and then selecting the songs you'd want in the album? On another note, it would be cool if in the future it could play music videos for those who have collections of music videos like myself :)
The sorting information and what album it belongs to is all based on the tags of the MP3 file but I would bet that playlists would be an option in the future. You can choose the sorting on the current version in the config file. Maybe we need to have a separate app for more control of the database file. At some point though it stops being a jukebox and becomes another media player.

The video part though would be cool with the collection of 80's videos I have. I can't see though how you could do it with the pi. You can only run one monitor at a time and if it's playing a video you lose the option to make more selections.

-The Other Mike

User avatar
fruitbox
Posts: 246
Joined: Mon Feb 22, 2016 7:35 pm
Location: UK

Re: fruitbox MP3 jukebox

Wed Jan 24, 2018 10:15 pm

Hi

fruitbox version 1.4 is now released!

Please download from github as usual...

https://github.com/chundermike/rpi-fruitbox

(see README.md for installation instructions)

Highlights:

-> *new* Button remapping
-> *new* USB controller (joystick) support
-> *new* Touch screen support (tested on official Raspberry Pi 7")
-> *new* GPIO input support for buttons (no need for Adafruit retrogame anymore)
-> *new* GPIO output from status objects
-> *new* User-configurable text descriptions for song pages
-> *new* Prevention of repeated random songs (in user and Auto mode)
-> Various bug fixes and extra features
-> Added a bunch of new status $ variables
-> Improved and extended song sorting

...see release_notes.txt on github for a complete and detailed list.

Note that all of the skin config files have been tweaked for V1.4 changes. Apologies - these were to fix inconsistent status variable naming. future fruitbox versions should be backwards compatible with the skins from now on.

If you have an official Raspberry Pi 7" touch screen, be sure to check out the new "TouchOne" skin. And if you plan to use GPIO, touch or joystick button input please read the user-guide carefully for instructions on how to map buttons to these different inputs.

As usual, please feedback any bugs to me (this release has lots of changes), and let me know of any improvements you'd like to see.

Cheers,
Mike

OklahomaGreyBeard
Posts: 35
Joined: Thu Feb 11, 2016 3:14 am

Re: fruitbox MP3 jukebox

Thu Jan 25, 2018 4:12 pm

Still showing some interesting things with regards to controls. On one of my USB keypads there are three keys that do not register when auto programming the buttons. Their native symbols are home, mail and calculator. Using the command showkey these come up as 172,155,140. However showkey also comes up with different numbers for all the keys. For example on the keypad the original numbers (1,2,3,4,5,6,7,8,9) map with your mapping command as 38,39,40,41,42,43,44,45,46 and using showkey they are 79,80,81,75,76,77,71,72,73.

Are you reporting back what the system says the key is? Could this be an issue of your keyboard mapped as a English UK and mine being English US?

Also when doing the auto mapping there should be a timeout to set a button at the default when nothing is pressed. If someone used this feature to map their buttons but didn't have anything for A-K only using numbers for selection, they have to have a separate keyboard hooked up to press the missing keys. *although I guess they would have one anyway to have run the command in the first place...

-The Other Mike

User avatar
fruitbox
Posts: 246
Joined: Mon Feb 22, 2016 7:35 pm
Location: UK

Re: fruitbox MP3 jukebox

Thu Jan 25, 2018 5:13 pm

OklahomaGreyBeard wrote:
Thu Jan 25, 2018 4:12 pm
Still showing some interesting things with regards to controls. On one of my USB keypads there are three keys that do not register when auto programming the buttons. Their native symbols are home, mail and calculator. Using the command showkey these come up as 172,155,140. However showkey also comes up with different numbers for all the keys. For example on the keypad the original numbers (1,2,3,4,5,6,7,8,9) map with your mapping command as 38,39,40,41,42,43,44,45,46 and using showkey they are 79,80,81,75,76,77,71,72,73.

Are you reporting back what the system says the key is? Could this be an issue of your keyboard mapped as a English UK and mine being English US?

Also when doing the auto mapping there should be a timeout to set a button at the default when nothing is pressed. If someone used this feature to map their buttons but didn't have anything for A-K only using numbers for selection, they have to have a separate keyboard hooked up to press the missing keys. *although I guess they would have one anyway to have run the command in the first place...

-The Other Mike
Hi Mike

I'll take a look at those keyboard codes to see if there's anything I can do. The key codes come from the Allegro API so not sure how the values are derived. But as long as you use the codes generated by fruitbox itself the keys it does recognise will map to the correct buttons.

On your second point, to skip keys you don't want to assign, just press the escape key (as mentioned). If you make a mistake and press a wrong button then you can simply edit the fruitbox.btn file by hand afterwards, rather go through the whole process again. If you're not sure of a code, then you can use the fruitbox --test-buttons command line option to check them,,,

Mike

OklahomaGreyBeard
Posts: 35
Joined: Thu Feb 11, 2016 3:14 am

Re: fruitbox MP3 jukebox

Thu Jan 25, 2018 7:28 pm

I had a brain spasm this morning and wondered how difficult it would be for you to allow network injection (perhaps a REST API) to add a song to the queue and/or allow the reading of the song database. I envision a QR code on the front of my jukebox that leads to an app that will let party goers select songs or possibly let them "vote" on the next song and the song with the highest votes plays next. Even if the voting part is handled by a separate program it would still need to be able to inject the song to play next as well as poll the time remaining on the currently playing song to see when to end voting. It may be a completely different direction than you were thinking, but it could be interesting. Even a simple API would even allow control of the jukebox via Alexa, Google, Siri, etc.

dlink
Posts: 12
Joined: Thu Jan 18, 2018 2:12 am

Re: fruitbox MP3 jukebox

Thu Jan 25, 2018 8:13 pm

Mike,
there is an issue in the Status0 file with the IF_NOT statements as I know you fixed them but appears they didn't get corrected in this file.

Shows:
NOW PLAYING:
$IF_SONG_PLAYING$NOW_PLAYING_TITLE$END_IF
$IF_SONG_NOT_PLAYING$IF_SONG_NOT_LOADING$IF_SONG_NOT_UNLOADING$IF_TIMER_HI** SELECT SONG **$END_IF$END_IF$IF_SONG_PLAYINGby $NOW_PLAYING_ARTIST$END_IF
$IF_SONG_PLAYING$NOW_PLAYING_ELAPSED_TIME / $NOW_PLAYING_LENGTH$END_IF

Should be:
NOW PLAYING:
$IF_SONG_PLAYING$NOW_PLAYING_TITLE$END_IF
$IF_NOT_SONG_PLAYING$IF_NOT_SONG_LOADING$IF_NOT_SONG_UNLOADING$IF_TIMER_HI** SELECT SONG **$END_IF$END_IF$IF_SONG_PLAYINGby $NOW_PLAYING_ARTIST$END_IF
$IF_SONG_PLAYING$NOW_PLAYING_ELAPSED_TIME / $NOW_PLAYING_LENGTH$END_IF

Also in the WallSmall Skin the fruitbox.cfg has a spelling issue for the word center.

Shows:
ArtistText = 2 200 64 32 255 centre true true false 0 6

Should be
ArtistText = 2 200 64 32 255 center true true false 0 6

Shows:
SortSongsBy Title
SortSongsBy Artist

Shouldn't it be ?
SortSongsBy = Title
SortSongsBy = Artist

BTW
I tested adding the PageJump = 10 to the fruitbox.cfg file and it works great after mapping the jump key's. I did however have to use sudo ./fruitbox --config-buttons to map the buttons. I also tested the Mono files and they now work perfect. Thanks so much, looks like a lot of work went into version 1.4 :)

User avatar
fruitbox
Posts: 246
Joined: Mon Feb 22, 2016 7:35 pm
Location: UK

Re: fruitbox MP3 jukebox

Thu Jan 25, 2018 9:01 pm

OklahomaGreyBeard wrote:
Thu Jan 25, 2018 7:28 pm
I had a brain spasm this morning and wondered how difficult it would be for you to allow network injection (perhaps a REST API) to add a song to the queue and/or allow the reading of the song database. I envision a QR code on the front of my jukebox that leads to an app that will let party goers select songs or possibly let them "vote" on the next song and the song with the highest votes plays next. Even if the voting part is handled by a separate program it would still need to be able to inject the song to play next as well as poll the time remaining on the currently playing song to see when to end voting. It may be a completely different direction than you were thinking, but it could be interesting. Even a simple API would even allow control of the jukebox via Alexa, Google, Siri, etc.
Hi Mike

I am thinking of adding dbus support...would this be able to support your requirements?

Cheers
Mike

User avatar
fruitbox
Posts: 246
Joined: Mon Feb 22, 2016 7:35 pm
Location: UK

Re: fruitbox MP3 jukebox

Thu Jan 25, 2018 9:16 pm

dlink wrote:
Thu Jan 25, 2018 8:13 pm
Mike,
there is an issue in the Status0 file with the IF_NOT statements as I know you fixed them but appears they didn't get corrected in this file.

Shows:
NOW PLAYING:
$IF_SONG_PLAYING$NOW_PLAYING_TITLE$END_IF
$IF_SONG_NOT_PLAYING$IF_SONG_NOT_LOADING$IF_SONG_NOT_UNLOADING$IF_TIMER_HI** SELECT SONG **$END_IF$END_IF$IF_SONG_PLAYINGby $NOW_PLAYING_ARTIST$END_IF
$IF_SONG_PLAYING$NOW_PLAYING_ELAPSED_TIME / $NOW_PLAYING_LENGTH$END_IF

Should be:
NOW PLAYING:
$IF_SONG_PLAYING$NOW_PLAYING_TITLE$END_IF
$IF_NOT_SONG_PLAYING$IF_NOT_SONG_LOADING$IF_NOT_SONG_UNLOADING$IF_TIMER_HI** SELECT SONG **$END_IF$END_IF$IF_SONG_PLAYINGby $NOW_PLAYING_ARTIST$END_IF
$IF_SONG_PLAYING$NOW_PLAYING_ELAPSED_TIME / $NOW_PLAYING_LENGTH$END_IF

Also in the WallSmall Skin the fruitbox.cfg has a spelling issue for the word center.

Shows:
ArtistText = 2 200 64 32 255 centre true true false 0 6

Should be
ArtistText = 2 200 64 32 255 center true true false 0 6

Shows:
SortSongsBy Title
SortSongsBy Artist

Shouldn't it be ?
SortSongsBy = Title
SortSongsBy = Artist

BTW
I tested adding the PageJump = 10 to the fruitbox.cfg file and it works great after mapping the jump key's. I did however have to use sudo ./fruitbox --config-buttons to map the buttons. I also tested the Mono files and they now work perfect. Thanks so much, looks like a lot of work went into version 1.4 :)
Hi,

Thanks for highlighting the out of date status variables...I'm sure I fixed these but they obviously slipped through the net. I'll get them corrected asap.

The misspelling of centre doesn't matter since fruitbox is only looking for the first unique character ('c' in this case).

For the SortSongsBy entries, it actually doesn't matter the = is missing; fruitbox can cope with that (and also : instead of =).

Yes I forgot to mention that whenever GPIO is involved (input or output) you need to run fruitbox as sudo because fruitbox needs direct access to the Broadcom peripheral registers ...this includes the button test and config.

...and I've noticed that I've forgot to add status variables for checking the new page jump buttons (I.e. $IF_BUTTON_LEFT_JUMP_PRESSED etc)...I'll add those in the next (minor) release.

Thanks for your feedback...much appreciated!

Cheers
Mike
Last edited by fruitbox on Fri Jan 26, 2018 1:03 am, edited 1 time in total.

OklahomaGreyBeard
Posts: 35
Joined: Thu Feb 11, 2016 3:14 am

Re: fruitbox MP3 jukebox

Thu Jan 25, 2018 10:14 pm

fruitbox wrote:
Thu Jan 25, 2018 9:01 pm

Hi Mike

I am thinking of adding dbus support...would this be able to support your requirements?

Cheers
Mike
Not sure as I've never used dbus before. Then again I thought I'd never used C++ either and just realized yesterday that it's what I have been using to program Arduinos with. I'm more of what you'd call a hack programmer knowing just enough to get me in trouble and learning the rest as I go when it's needed for a project. (The current is an ESP8266 that connects to WiFi and I can use my morse key to control home automation. It also receives updates and plays them back on an old railroad sounder in morse.

User avatar
fruitbox
Posts: 246
Joined: Mon Feb 22, 2016 7:35 pm
Location: UK

Re: fruitbox MP3 jukebox

Fri Jan 26, 2018 12:22 am

OklahomaGreyBeard wrote:
Thu Jan 25, 2018 10:14 pm
fruitbox wrote:
Thu Jan 25, 2018 9:01 pm

Hi Mike

I am thinking of adding dbus support...would this be able to support your requirements?

Cheers
Mike
Not sure as I've never used dbus before. Then again I thought I'd never used C++ either and just realized yesterday that it's what I have been using to program Arduinos with. I'm more of what you'd call a hack programmer knowing just enough to get me in trouble and learning the rest as I go when it's needed for a project. (The current is an ESP8266 that connects to WiFi and I can use my morse key to control home automation. It also receives updates and plays them back on an old railroad sounder in morse.
Hi Mike

I've never used dbus before either, and to be honest not even heard of it before it was previously mentioned on this forum (despite 30yrs as a professional electronics engineer...). However, a quick google and it looks ideal. Described on Wiki as a "mechanism that allows communication between multiple computer programs (that is, processes) concurrently running on the same machine" it seems like the solution we are looking for...I'm sure I can integrate it into fruitbox somehow so that we can enable song selections and feedback elapsed playtimes to other apps (and most probably every other fruitbox control and status).

Cheers
Mike

OklahomaGreyBeard
Posts: 35
Joined: Thu Feb 11, 2016 3:14 am

Re: fruitbox MP3 jukebox

Fri Jan 26, 2018 6:07 am

Not necessarily specific to Fruitbox but I'm curious to ask people that use a digital jukebox. What is the point when you consider it to be "too many songs" for a jukebox format? At some point you have so many, people will spend more time looking at what can be played than they do playing songs. If you're sorted by artist and have say 5000 songs and are currently looking at ABBA, checking for STYX can be tedious even if your layout shows 40 songs at a time not to mention the 12 on a 7" screen. Having the jump X pages option now helps, but honestly, my current MP3 collection is well into 6 digits not to mention those songs in FLAC format (FLAC support would be great too BTW).

I guess the question may go beyond the jukebox issue and be more of a how do you select your favorite songs after 50 years of being a musician that listens from Opera to Rock and everything in between.

And this is why I don't post online after midnight..... :lol:

-The Other Mike

mamer999
Posts: 50
Joined: Fri Jan 26, 2018 7:56 am
Location: Germany

Re: fruitbox MP3 jukebox

Fri Jan 26, 2018 8:02 am

Hi Mike,
i am very excited about this excellent software! I only have one problem. I use different buttons on the GPIO's, but they all bounce a lot.

User avatar
fruitbox
Posts: 246
Joined: Mon Feb 22, 2016 7:35 pm
Location: UK

Re: fruitbox MP3 jukebox

Fri Jan 26, 2018 7:30 pm

mamer999 wrote:
Fri Jan 26, 2018 8:02 am
Hi Mike,
i am very excited about this excellent software! I only have one problem. I use different buttons on the GPIO's, but they all bounce a lot.
Hi,

So I have done a bit of experimenting and it seems like my debouncing is a little flaky. I've hopefully fixed this now and it's available in the next release (v1.5)

Thanks for highlighting this issue!

Cheers,
Mike

User avatar
fruitbox
Posts: 246
Joined: Mon Feb 22, 2016 7:35 pm
Location: UK

Re: fruitbox MP3 jukebox

Fri Jan 26, 2018 7:33 pm

Hi,

fruitbox version 1.5 is now released!

Just a few changes this time...

Added new status object $ variables...
-> $IF_BUTTON_LEFT_JUMP_PRESSED
-> $IF_NOT_BUTTON_LEFT_JUMP_PRESSED
-> $IF_BUTTON_RIGHT_JUMP_PRESSED
-> $IF_NOT_BUTTON_RIGHT_JUMP_PRESSED

-> Improved GPIO input debouncing

as usual, it's available from github...

https://github.com/chundermike/rpi-fruitbox

No skin changes this time, except a fix to the WallJuke status0.txt file as I missed a change during the v1.4 release.


Cheers,
Mike

bernyone
Posts: 49
Joined: Fri Sep 29, 2017 8:42 pm

Re: fruitbox MP3 jukebox

Fri Jan 26, 2018 9:10 pm

hi mike

just installed 1.5 on the miniJuke loaded TouchOne but no responce when i touch the screen.....

any ideas?

Jon

Return to “Graphics, sound and multimedia”