TaraniTunes: Awesome music player for Taranis

openTx has introduced a range of new features, ideas and bling. It is fast becoming the firmware of choice for many users. openTx will run on ALL current hardware platforms, including the gruvin9x and sky9x boards. Work has already started to support the new FrSky X9D radio!
Post Reply
User avatar
GilDev
Posts: 9
Joined: Tue Jan 26, 2016 8:19 pm
Country: France
Location: Tours
Contact:

TaraniTunes: Awesome music player for Taranis

Post by GilDev »

This is a clone of this RCGroups post.

Hey guys!

I just made my first Lua script with OpenTX. I couldn't find any great music player for my Taranis Q X7. I was using this Simple Background Music Player but it only plays random songs. The TaraniJuke seems really promising but it was never released, though its functionalities of showing the timestamp, time remaining and automatically switch songs looks awesome but I have no idea how they were implemented.

Introducing TaraniTunes, compatible with FrSky Taranis Q X7 and Taranis X9D:

Image

It's kind of like a jukebox, you just scroll through your song, select one to play, hit a switch and tadaa!
You can assign different switches to do different actions:
* One switch to play the music (I use D-)
* One switch to choose a random music (I use D_)
* Two switches (or better: throttle trims) to play the next/previous song

Image

Click here to go to the GitHub repo (with downloads and instructions)!

Here is a video explaining how to install and use TaraniTunes:

https://youtu.be/gCiody4izEs
Last edited by GilDev on Sat Nov 04, 2017 10:02 pm, edited 1 time in total.
Someday soon, pandas will dominate the world…
Flying 250, 280 and 450 quadcopters running Betaflight with a Turnigy 9X running OpenTX.

User avatar
jhsa
Posts: 19483
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: TaraniTunes: Awesome music player for Taranis

Post by jhsa »

Want a good music player on your Taranis radio? Install Ersky9x :mrgreen:
Play albums or single files. Only doesn't do random function, yet. :) You can assign switches to Play / Pause, Start / Stop, Next / Previous. No need for scripts, the player is hardcoded in Ersky9x.. Just thought I would.make some publicity ;) :mrgreen:

João

Sent from my BLN-L21 using Tapatalk

My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
GilDev
Posts: 9
Joined: Tue Jan 26, 2016 8:19 pm
Country: France
Location: Tours
Contact:

Re: TaraniTunes: Awesome music player for Taranis

Post by GilDev »

Didn't know that! :) But I don't know why I would want to install Ersky9x instead of my faithful OpenTX… :?
Someday soon, pandas will dominate the world…
Flying 250, 280 and 450 quadcopters running Betaflight with a Turnigy 9X running OpenTX.
User avatar
jhsa
Posts: 19483
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: TaraniTunes: Awesome music player for Taranis

Post by jhsa »

Only one way to find out :) ;)

No, joking apart, you should stay with the system that better suit your needs. :)
I do have many reasons to use Ersky9x over openTX, one of them is hardware support on different systems (radios). stuff like more switches, sliders, bluetooth, etc.
I also like more the menus. Some people prefer the openTX menus.. It all depends on your taste and needs..
Now about the music player, yes, that is another cool feature. I love listening to music while flying my models, or in between flights when I'm alone at the field.
One good thing, is that Ersky9x pauses the music when there is an alarm, and resumes playing after the alarm was cleared.

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
rdeanchurch
Posts: 750
Joined: Tue Dec 27, 2011 11:22 pm
Country: United States
Location: Carson City, Nv

Re: TaraniTunes: Awesome music player for Taranis

Post by rdeanchurch »

Nice looking script. I'll give it a try on my QX7, OpenTx2.2

Thanks Gil
Dean
OldDmbThms: 1. Takeoff, 2. Crash, 3. Repair, GOTO 1

User avatar
GilDev
Posts: 9
Joined: Tue Jan 26, 2016 8:19 pm
Country: France
Location: Tours
Contact:

Re: TaraniTunes: Awesome music player for Taranis

Post by GilDev »

jhsa: Well I'm sure there is a lot of good about Ersky9x, I'm pretty happy with OpenTX though and I only have a Taranis Q X7 and Turnigy 9X, both running OpenTX 2.2. :)

rdeanchurch: If you try it, be sure to post a photo of it! :)
Someday soon, pandas will dominate the world…
Flying 250, 280 and 450 quadcopters running Betaflight with a Turnigy 9X running OpenTX.
User avatar
jhsa
Posts: 19483
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: RE: Re: TaraniTunes: Awesome music player for Taranis

Post by jhsa »


GilDev wrote:jhsa: Well I'm sure there is a lot of good about Ersky9x, I'm pretty happy with OpenTX though and I only have a Taranis Q X7 and Turnigy 9X, both running OpenTX 2.2.
That is why I said that we should use what suits us better :)
Another good reason I use er9x also on my 9x radios with the original board is that I can have more switches or change 2 position switches to 3 positions, voice, and the ability to backup/ restore models to/from the sd card, and computer..
Er9x for 9x is still being developed unlike openTX as far as I know.
But enough of my off topic talking.. :) I am an er9x and Ersky9x lover obviously ;)

A bit more on topic, I think your player would be even better if you introduced the ability of reading albums stored in folders on the sd card. This is not criticism, it is a suggestion :)

João

Sent from my BLN-L21 using Tapatalk


My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
GilDev
Posts: 9
Joined: Tue Jan 26, 2016 8:19 pm
Country: France
Location: Tours
Contact:

Re: TaraniTunes: Awesome music player for Taranis

Post by GilDev »

Well I personally don't mod my switches but that sure is a great feature. You have voice on OpenTX and also the backup/restore model to/from the SD card if I make no mistake.
Yes that would be great but it sadly is impossible… To play music, I create a special function “BgMusic” and this takes as a parameter a name of 6 characters. This name is the filename of a WAV file in /SOUNDS/en and can't be anything else, that's why my initial idea of using a MUSICS folder can't work, and also reading albums stored in folders… :?
Someday soon, pandas will dominate the world…
Flying 250, 280 and 450 quadcopters running Betaflight with a Turnigy 9X running OpenTX.
User avatar
jhsa
Posts: 19483
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: TaraniTunes: Awesome music player for Taranis

Post by jhsa »

GilDev wrote: Fri Nov 03, 2017 5:24 pm Well I personally don't mod my switches but that sure is a great feature. You have voice on OpenTX and also the backup/restore model to/from the SD card if I make no mistake.
On the original 9x radio you can have voice with the megasound connected in parallel. I don't think openTX supports backing up models to the sound module's SD card..
Er9x support serial connection between the mainboard and the voice module.. it takes only 2 connections instead of 5 (I think) when connecting it to the LCD lines. The only downside compared to the former connection is that we have to move the throttle trim connections to the Sound Module, and free the serial pins on the atmega chip. But it works. anyway, off topic again :( sorry..
Yes that would be great but it sadly is impossible… To play music, I create a special function “BgMusic” and this takes as a parameter a name of 6 characters. This name is the filename of a WAV file in /SOUNDS/en and can't be anything else, that's why my initial idea of using a MUSICS folder can't work, and also reading albums stored in folders… :?
Maybe the player would have to be hardcoded.. Ask the devs if they could implement it. If you love music, it is really nice to have it.. And it can also help in some RC applications like training some aerobatics. I see people having others reading the aerobatic figures to the pilot. With the player we can practice without the need of another person :)
But having music while flying and in between flights is priceless :)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
rdeanchurch
Posts: 750
Joined: Tue Dec 27, 2011 11:22 pm
Country: United States
Location: Carson City, Nv

Re: TaraniTunes: Awesome music player for Taranis

Post by rdeanchurch »

GIl
I use a full SD card path in scripts with playFile() and it works fine.
I'll try it on bg sounds. Did you try with the full path?
local audioDir = "/SOUNDS/en/GoRace/" -- location of GoRace audio sounds on SD card.
...
local startTone = audioDir.."RaceTone.wav" -- start = go sig
Dean
OldDmbThms: 1. Takeoff, 2. Crash, 3. Repair, GOTO 1
User avatar
MikeB
9x Developer
Posts: 18056
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: TaraniTunes: Awesome music player for Taranis

Post by MikeB »

It seems you can't play a file as "background music" from the LUA script. Perhaps a request to have this available as a facility might be useful.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
rdeanchurch
Posts: 750
Joined: Tue Dec 27, 2011 11:22 pm
Country: United States
Location: Carson City, Nv

Re: TaraniTunes: Awesome music player for Taranis

Post by rdeanchurch »

MikeB is right, as usual!
I just looked at your playSong() and see you actually played BGmusic with a SF.
and you cannot put a path on a Special Function, bummer.
Dean
OldDmbThms: 1. Takeoff, 2. Crash, 3. Repair, GOTO 1
User avatar
GilDev
Posts: 9
Joined: Tue Jan 26, 2016 8:19 pm
Country: France
Location: Tours
Contact:

Re: TaraniTunes: Awesome music player for Taranis

Post by GilDev »

jhsa: Sure, hardcoding it and making it available as a firmware's optional feature would be great but I don't think anyone wants to spend time on this, including me, as it could take quite some time to get used to OpenTX's C repository, code and everything. For me, my TaraniTunes is plenty enough. =)

rdeanchurch: Exactly like you and MikeB said. =)

I just edited the first post to add a video I made explaining how to install and use TaraniTunes!
Someday soon, pandas will dominate the world…
Flying 250, 280 and 450 quadcopters running Betaflight with a Turnigy 9X running OpenTX.
User avatar
jhsa
Posts: 19483
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: TaraniTunes: Awesome music player for Taranis

Post by jhsa »

My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
rdeanchurch
Posts: 750
Joined: Tue Dec 27, 2011 11:22 pm
Country: United States
Location: Carson City, Nv

Re: TaraniTunes: Awesome music player for Taranis

Post by rdeanchurch »

Gil
Are you interested in streamlining this script re: easy of installation?
I'm a tinker/hacker. The logical switches could all be replaced with
getValue() for 'sd' and 'trim-thr' and a little logic. (The return from getValue('trim-thr') is the new throttle trim value, not an up/down.)
It would be easier to install if it was all done in the script, rather than having to put in the logic switches.

If it is good enough for your intended use, you may just prefer to let it be.
Dean
OldDmbThms: 1. Takeoff, 2. Crash, 3. Repair, GOTO 1
User avatar
GilDev
Posts: 9
Joined: Tue Jan 26, 2016 8:19 pm
Country: France
Location: Tours
Contact:

Re: TaraniTunes: Awesome music player for Taranis

Post by GilDev »

rdeanchurch: I agree with this and in fact, at first, I made it like this. The problem is when you want to use other switches and positions, it becomes kind of a pain to configure in the file and to do all the logic that it involves (different values for trims and switches as you said).
That's why I have used the current approach, the downside is those 4 logical switches to configure every time. Personally, I have a “Template” model with everything set up correctly (TaraniTunes, volume potentiometer, my “read and reset timer” switch…) and I copy it every time I create a new model. That's cumbersome… No idea if I will make a version like you suggested.
Someday soon, pandas will dominate the world…
Flying 250, 280 and 450 quadcopters running Betaflight with a Turnigy 9X running OpenTX.
rdeanchurch
Posts: 750
Joined: Tue Dec 27, 2011 11:22 pm
Country: United States
Location: Carson City, Nv

Re: TaraniTunes: Awesome music player for Taranis

Post by rdeanchurch »

Understood.
The complexity isn't too bad if only using physical 2 or 3 position switches, but adding trim (which is very convenient to use in this case) is a pain. I had never tried it before and didn't even realize that the returned value was just a number incremented or decremented, and not true/false or Up/Down indicator. It seems contradictory to what we can access in logical switches and special functions.
I'm busy on another script right now and may come back to this later.
Dean
Dean
OldDmbThms: 1. Takeoff, 2. Crash, 3. Repair, GOTO 1
User avatar
GilDev
Posts: 9
Joined: Tue Jan 26, 2016 8:19 pm
Country: France
Location: Tours
Contact:

Re: TaraniTunes: Awesome music player for Taranis

Post by GilDev »

Exactly, I also thought at first that I could get a boolean value from the trims but it's not possible…
Someday soon, pandas will dominate the world…
Flying 250, 280 and 450 quadcopters running Betaflight with a Turnigy 9X running OpenTX.

Post Reply

Return to “openTx”