Playing the piano on the Dashboard

Hello, I want to play piano notes or 7-8 musical notes on the dashboard. I don't want to save the notes in .mp3 format. Because it's not realistic. I tried MIDI applications but I didn't know how to make sound from the dashboard.

You will need to share more information. Do you want to use a synth to actually produce the sounds for example? Or just use your client browser?

Also, what part does node-red play? If you use the browser for the sound, you can do it all in the front-end and wouldn't need node-red at all.

If you want to connect a synth, you will need to either use node-red or the browser to output the midi data to the synth, the choice of which is down to where the synth is connected physically.

Here is a piano that doesnt rely on MIDI but instead generates its own audio blobs - doesnt sound realistic like MIDI would but here you go...

chrome_GKEPFz2S37

All credits to https://github.com/mrcoles/javascript-piano - I just copy + pasted :slight_smile:

dash-piano.json (36.2 KB)

1 Like

Thank you very much it works. However, I have a small problem. When I send certain commands, I want the 1st button to be pressed. How can I do?

ex.

No idea. You will need to work that out or go with another library.

Can I assume you didnt actually want a virtual "piano on the dashboard" but just to be able to make piano sounds on the dashboard?

Yes, I want to receive a signal over MQTT and extract notes according to that signal.

We can roughly think of it as

In which case, a set of small mp3 or wav samples stored on the node-red server would be more suited.

MQTT --> switch node (determine note) --> file node (load file) --> play audio node.

1 Like

Midi only sounds anywhere near realistic if you are using a decent synth and probably a decent processor on top. After all MIDI is only control data, it has no sounds of its own.