VEXcode V5 Pro - LVGL Music Demo

The LittleV Graphics Library (LVGL) has some nice demo code. One example is a music player demo, it needs the latest version of LVGL. I was updating the VEXcode LVGL library repo today to the latest (7.11.0) and thought it might be fun to try the music player on the V5. Works quite nicely.


source the for project is here.

and if you want to change LVGL configuration, the vexcode lvgl library project is here.


um… a music player without a speaker… or…?

Is this a sneak preview of some kind?


No, it’s just the most recent demo that LVGL seems to use everywhere.
Just wanted to show, again, that VEXcode V5 Pro can easily use LVGL to create a more advanced UI.


Taran, speakers are not the only way to play music - any mechanical system that could generate vibrations in the audible frequency range could be used as a musical instrument:

Here is a simple Stepper Motor Music making tutorial with step-by-step build instructions, note frequency chart, and source code examples:

And a more detailed one with the math that, at the first glance, is way over my head could be found here:

The biggest challenge would be to turn mp3 audio into midi format, but there are plenty of online mp3 to midi converters. And, coincidentally, LVGL music demo lv_demo_music, that James linked, comes with a spectrum analyser script that uses one of the popular python libraries for doing such conversions.

I think that, once you are done with LRT project, and given all these code examples and a small pile of noisy V5 motors, you should be able to tackle this music thing with ease. :wink:


There is also these, but these might be a bit harder to do.


That video is awesome! The (what I presume to be a) saw tooth sound of the coil fits perfectly with that song.

What happened to the VEX three wire speaker?
I remember seeing it somewhere and was wondering if it was an official product and why it isn’t for sale.

vex 3-wire speaker for the cortex was discontinued in 2018.


Could you just connect a separate (not competition legal) speaker to the 3-wire ports and manually send analog data to it? I don’t know it it’s possible either to get a speaker that would work in the port or to manually send the analog waveform to it. It would be cool though.

you can’t do that, as we have explained before. The cortex used a dedicated connection for the speaker that was connected to a digital to analog converter, the cpu driving the 3wire ports on a V5 does not have that capability.


Easy solution:

3-wire expander
8x MC29
Splice MC29 wires into 8 monotone speakers with different pitches
Connect MC29s to ADI expander
Write some code to play tones on the right speaker
Write some code to convert sound files to bleeps and bloops


Or just duct tape a Bluetooth speaker to the robot…

How do you propose that that be controlled via code on the brain?

You have a music player and have the robot push the buttons…


Or you could highjack the speaker at comps and play music on those.

1 Like