Arduino RGB strip

Collaborate with other modders to make Synthesia the way you want it.
Always the latest versions: [ colors.xml | ui.xml ]
Read the Getting Started topic to learn how important it is to MERGE YOUR CHANGES every time you download a new dev preview.
Montelion2004
Posts: 12

Post by Montelion2004 »

Hi,
Is there a way to do something like this in Synthesia?
https://www.linkedin.com/pulse/musescor ... cucinotta/
It's like the PianoMaestro.
I tried it, but Synthesia is way better for learning piano than MuseScore.
Any ideas?
Monty
Nicholas
Posts: 13170

Post by Nicholas »

The "Finger-based channel" key light mode (under Settings --> [your virtual MIDI port] --> Key Lights) is designed specifically to support this kind of thing. It'll take a little bit of adaptation of their Arduino code, but all of the upcoming-note information is nicely exposed using that setting.
Montelion2004
Posts: 12

Post by Montelion2004 »

UH-OH!
Arduino doesn't show up as a MIDI instrument!
What can I do? :?:
Monty
Nicholas
Posts: 13170

Post by Nicholas »

You'll probably need some app that pretends to be a virtual MIDI device and can write to the Arduino's serial port. Or you could update the Arduino's boot loader to behave like a physical USB-MIDI device. (The Arduino-compatible Teensy boards have this built in and available just by changing a drop-down menu option. I know this because I just used one to do something rather similar.) :D

In any event, some programming will be involved somewhere -- either on the Arduino or computer side -- to get this up and running. Synthesia isn't compatible with that MuseScore feature out of the box.
Montelion2004
Posts: 12

Post by Montelion2004 »

Ok. Thanks!
Monty
GeorgeProfenza
Posts: 2

Post by GeorgeProfenza »

Nicholas' suggestion is great: Teensy is pretty easy to do MIDI with.

Additionally, if you have a Leonardo / Yun or another Atmega 32u4 based micro-controller you can use https://github.com/rkistner/arcore

For Uno you might be able to get away with Hairless MIDI and their MIDI/Serial support software: http://projectgus.github.io/hairless-midiserial/

Might be able to get away on an Uno with LUFA too, but it's not as straight forward as the previously mentioned options:
http://www.fourwalledcubicle.com/LUFA.php (MIT license)
Montelion2004
Posts: 12

Post by Montelion2004 »

Thanks! I don't know why but I couldn't install the MIDI bootloader, and I couldn't find any alternative.
Monty
Astinsa
Posts: 1

Post by Astinsa »

Has anything come of it?
Montelion2004
Posts: 12

Post by Montelion2004 »

Yeaaaah....
Nope. I gave up one year ago, and never tried again. Maybe one day I'll be able to finish this project...
Sadly I'm a procrastinator...
thiagolr
Posts: 37

Post by thiagolr »

I'm working on it, but I'm still waiting for some parts that I bought on ebay! =)

I will make a post here about the progress later!
Montelion2004
Posts: 12

Post by Montelion2004 »

That's great! :D
Monty
lenz
Posts: 1

Post by lenz »

Hello. I made an implementation of the Arduino RGB Strip for an application on android. But I need a little help to finish the project to the end, I was engaged in the analysis of the protocol and did not fully understand how the program indicates the duration of pressing the keys?
P.S. Sory for my bad English.
Nicholas
Posts: 13170

Post by Nicholas »

Sorry for the wait on this.

In MIDI the duration isn't usually specified. Instead of a single event with a start/end time, MIDI notes are sent in two separate events: the "Note On" event when the note (or key light in this case) should begin. Then a "Note Off" event when it should end.

Does that help?
thiagolr
Posts: 37

Post by thiagolr »

Nicholas,

Would it be possible to have some extra information from Synthesia for RGB lights?

Example:
- which color is selected for each hand/channel (maybe using a custom SysEx message?)
- different led light channels for each hand/channel

Thanks!
Nicholas
Posts: 13170

Post by Nicholas »

Hmm, this might get a little tricky because you can technically use all the colors on each hand. Each track lets you choose per-hand colors independently. Combined with the hand splitting tool (or just a song with lots of tracks), and you can get some arbitrary combinations.

In the "Finger-Based Channel" mode, right now the Note On messages don't use the 7 bits of the velocity parameter for anything particularly useful. So we've got some room to add data without sending any additional messages. If we assume that Synthesia only has six colors (which has been true for 13 years but won't be forever), we could fit both the original note channel and the note's color in those 7 bits.

That scheme would break once more arbitrary colors were allowed.

Can you think of anything useful you'd use the original note channel for? If not, we could dedicate all 7 of those bits to the color, which gives a lot of room for future flexibility in the number of available colors.
thiagolr
Posts: 37

Post by thiagolr »

I can't think of anything useful, the idea to add the color to the velocity data is very interesting.

With 7 bits with have room for 128 predefined colors, which is more than enough for this purpose!

If you decide to do this (with the current 6 colors), I can test it here on a dev preview!
Nicholas
Posts: 13170

Post by Nicholas »

Instead of going the predefined color route, I was thinking more along the lines of just doing a "7 bit hue" or maybe a "6 bit hue with 1 bit toggle for 'bright' or 'dark'". Either 128 or 64 hues would be more than enough for anything I'd ever expect to offer a choice between.

Heck, even 32 different hues is plenty and we could reserve the last two bits for future use. :lol: We talked about the ceiling on the number of useful colors a million years ago, over here. If you look at the image linked in qwertyo76's post that follows mine there, 36 shades is already in "holy moly" territory. :D

This solution changes the requirement for implementers from needing to store a big table of pre-selected colors into a simple description: "the H from HSV, starting at 0 and proceeding to 360° linearly as you reach the value 31."
thiagolr
Posts: 37

Post by thiagolr »

I agree, it is easier and no one would actually need/use all those colors!

My RGB strip is almost done, it is already functional and is working as expected! I just need to do some "beautification", organize the wires, print a 3D case for the arduino, etc.

Image
Nicholas
Posts: 13170

Post by Nicholas »

That looks awesome. :D
User avatar
srimantha@gmail.com
Posts: 14

Post by srimantha@gmail.com »

Have you already updated Synthesia to send color information along velocity parameter ?

My RGB strip also ready, and waiting for your update. :)
iPiano.us | MIDIVisualizer.com
Post Reply