# Playing the piano on the Dashboard

**URL:** https://discourse.nodered.org/t/playing-the-piano-on-the-dashboard/66877
**Category:** Dashboard
**Tags:** node-red-dashboard, function-node
**Created:** [25 August 2022 06:53 UTC](https://discourse.nodered.org/t/playing-the-piano-on-the-dashboard/66877 "2022-08-25T06:53:08Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![sefaguntepe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sefaguntepe/32/94497_2.png) [@sefaguntepe](https://discourse.nodered.org/u/sefaguntepe)
#### Post date: [25 August 2022 06:53 UTC](https://discourse.nodered.org/t/playing-the-piano-on-the-dashboard/66877/1 "2022-08-25T06:53:08Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [25 August 2022 08:57 UTC](https://discourse.nodered.org/t/playing-the-piano-on-the-dashboard/66877/2 "2022-08-25T08:57:04Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [25 August 2022 10:38 UTC](https://discourse.nodered.org/t/playing-the-piano-on-the-dashboard/66877/3 "2022-08-25T10:38:06Z")

</div>

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](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/1/912dcaec9242608e43d6906cd335cbe14bab90e9.gif)

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

[dash-piano.json](https://discourse.nodered.org/uploads/short-url/2FsxxS6th6uDFDC8tJYHIMyIyg2.json) (36.2 KB)

---

<div class="post-metadata">

### Author: ![sefaguntepe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sefaguntepe/32/94497_2.png) [@sefaguntepe](https://discourse.nodered.org/u/sefaguntepe)
#### Post date: [25 August 2022 11:48 UTC](https://discourse.nodered.org/t/playing-the-piano-on-the-dashboard/66877/4 "2022-08-25T11:48:52Z")

</div>

> [@Steve-Mcl](#):
>
> [GitHub - mrcoles/javascript-piano: An HTML5 JavaScript synth piano that generates all of its sounds using data URIs.](https://github.com/mrcoles/javascript-piano)

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.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/e/6e2dc4664163b37e118f91efdefb4105bfaf77dc.png)

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [25 August 2022 12:03 UTC](https://discourse.nodered.org/t/playing-the-piano-on-the-dashboard/66877/5 "2022-08-25T12:03:28Z")

</div>

> [@sefaguntepe](#):
>
> When I send certain commands, I want the 1st button to be pressed. How can I do?

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?

---

<div class="post-metadata">

### Author: ![sefaguntepe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sefaguntepe/32/94497_2.png) [@sefaguntepe](https://discourse.nodered.org/u/sefaguntepe)
#### Post date: [25 August 2022 12:05 UTC](https://discourse.nodered.org/t/playing-the-piano-on-the-dashboard/66877/6 "2022-08-25T12:05:15Z")

</div>

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

---

<div class="post-metadata">

### Author: ![sefaguntepe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sefaguntepe/32/94497_2.png) [@sefaguntepe](https://discourse.nodered.org/u/sefaguntepe)
#### Post date: [25 August 2022 12:08 UTC](https://discourse.nodered.org/t/playing-the-piano-on-the-dashboard/66877/7 "2022-08-25T12:08:04Z")

</div>

We can roughly think of it as

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/0/5071a72bb6b394006c28cbc9627421af7ff04a5b.png)

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [25 August 2022 12:10 UTC](https://discourse.nodered.org/t/playing-the-piano-on-the-dashboard/66877/8 "2022-08-25T12:10:52Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [25 August 2022 15:34 UTC](https://discourse.nodered.org/t/playing-the-piano-on-the-dashboard/66877/9 "2022-08-25T15:34:34Z")

</div>

> [@Steve-Mcl](#):
>
> doesnt sound realistic like MIDI would

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.
