Problems with node-red-contrib-music due to changes in node-red-contrib-osc (I think)

Hi old friends. Hope you are well. I could use soem help. I reached out to Steve Bradley on this.. but in the event I dont hear from him.. i'm posting here :slight_smile:

in 2020 i creates a 10 m long keyboard for the bass player for the band Phish using node-red contrib-music code. That ran fine on. pi 4 using the OS and node-red nodes of the time. I’m doing some maintenance on the unit and am trying to run the same code on a new pi 4 running a fresh Bullseye install . I’m using the latest node-red, nodejs, supercollider, jack… Etc. I’ve installed the node-red-contrib-music and node-red-contrib-osc nodes. Something seemed to have changed in the OSC path to supercollider. My code hasn’t changed, but I see some mention that the OSC node has changed.. but despite my google efforts, I haven’t seen an example of what I need to do to configure the input to the OSC node to make it work. Any ideas ? Thanks so much !
-jc

I’m getting the following errors . in my node-red console

Error: The specified packet was not recognized as a valid OSC message or bundle. Packet was: {
"args": "tick"
}

using this flow:

[{"id":"82500a7fef352205","type":"tab","label":"Flow 4","disabled":false,"info":"","env":[]},{"id":"1f72d32a49767a16","type":"osc","z":"82500a7fef352205","name":"","path":"","metadata":false,"x":530,"y":140,"wires":[["ad56a2a6c2262910"]]},{"id":"e125e032da3a0e98","type":"inject","z":"82500a7fef352205","name":"tick","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"tick","payloadType":"str","x":170,"y":160,"wires":[["04b3d5812f307f5a"]]},{"id":"04b3d5812f307f5a","type":"synth","z":"82500a7fef352205","name":"","synthtype":"kick","filterTags":{},"volume":50,"octave":0,"root":"","scale":"","degree":"","outBus":0,"synthcontrols":{"mod_freq":"2","beater_noise":"0.05","pan":"0"},"sampleName":"","x":310,"y":100,"wires":[["1f72d32a49767a16"]]},{"id":"ad56a2a6c2262910","type":"udp out","z":"82500a7fef352205","name":"","addr":"127.0.0.1","iface":"","port":"57110","ipv":"udp4","outport":"57111","base64":false,"multicast":"false","x":640,"y":20,"wires":[]}]

Supercollider is giving me console errors that look like:

12 Nov 22:48:37 - [error] [osc:1f72d32a49767a16] Error: The specified packet was not recognized as a valid OSC message or bundle. Packet was: {
"args": "tick"
}

any help much appreciated !
-jc

Hi John, good to hear from you. Node-red-music changed at version 2 so that the OSC node is no longer required, you connect the synth node directly to the supercollider node. Hope that helps! Let me know if not, and good to hear the project is still going…

1 Like

Steven,
Thanks so much for the response !. Thats very helpful.
What else might have changed. I am having trouble getting a simple example working on a fresh Bullseye install with fresh node-red. The importable examples also dont seem to be complete. Can you please point me t a working sample flow and/or docs of version 2 ?

FWIW here are soem of the error messages I'm getting in the node-red console.. It's closer but still no sound. THanks so much for your help

> 
>  not recognized as a valid OSC message or bundle. Packet was: {
>   "address": "synthtype",
>   "args": "kick"
> }
> 14 Nov 13:53:10 - [error] [osc:1f72d32a49767a16] Error: The specified packet was not recognized as a valid OSC message or bundle. Packet was: {
>   "address": "synthtype",
>   "args": "kick"
> }
> FAILURE IN SERVER: pretty_bellnE Command not found
> FAILURE IN SERVER: pretty_bellnE Command not found
> FAILURE IN SERVER: piano Command not found

Looks like the synths I use are not being loaded... tryign to figure out how to reinstall supercollider

Hi John,
could you post the flow you are using now, either as JSON or as an image? And could you let me see what the palette manager says about the node-red-contrib-music version number and/or the nodes listed in the palette? This is what it looks like and it works for me. I had to do some rebuilding to get things going, I could deploy my latest updates if necessary.

here's my flow
[{"id":"82500a7fef352205","type":"tab","label":"Flow 4","disabled":false,"info":"","env":[]},{"id":"25b8ee79.fca652","type":"supercollider","z":"82500a7fef352205","host":"127.0.0.1","port":"57110","x":470,"y":680,"wires":[]},{"id":"acb14a01f3cc6c9f","type":"synth","z":"82500a7fef352205","name":"","synthtype":"piano","filterTags":{},"volume":50,"octave":0,"root":"","scale":"","degree":"","outBus":0,"synthcontrols":{"pan":"0"},"sampleName":"","x":310,"y":680,"wires":[["25b8ee79.fca652"]]},{"id":"c3f76f5cb3b1ac53","type":"inject","z":"82500a7fef352205","name":"","props":[{"p":"payload"},{"p":"note","v":"43","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"tick","payloadType":"str","x":110,"y":680,"wires":[["acb14a01f3cc6c9f"]]},{"id":"4cbfdcc889ce5496","type":"beat","z":"82500a7fef352205","name":"","output":"beat","bpm":"","latency":0,"autostart":false,"sharing":"standalone","conductorIP":"127.0.0.1","subBeats":[],"x":230,"y":80,"wires":[["6c2f9e44d5869dfd"]]},{"id":"3336645464682791","type":"supercollider","z":"82500a7fef352205","host":"127.0.0.1","port":"57110","x":530,"y":80,"wires":[]},{"id":"6c2f9e44d5869dfd","type":"synth","z":"82500a7fef352205","name":"","synthtype":"kick","filterTags":{},"volume":50,"octave":0,"root":"","scale":"","degree":"","outBus":0,"synthcontrols":{},"sampleName":"","x":370,"y":80,"wires":[["3336645464682791"]]},{"id":"8ea3bcd62eaf77d0","type":"inject","z":"82500a7fef352205","name":"on","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":90,"y":40,"wires":[["4cbfdcc889ce5496"]]},{"id":"b67bc3cd86c984ef","type":"inject","z":"82500a7fef352205","name":"on","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":90,"y":100,"wires":[["4cbfdcc889ce5496"]]}]

I see that the supercollider node is properly connected (it has a green dot)… But I don't hear anything when I click it. Either way the input notes are just true and false?… Anyway on the node red consul (or maybe the supercollider consult… They are the same)… I get the following messages :

FAILURE IN SERVER: pretty_bell Command not found
FAILURE IN SERVER: pretty_bell Command not found
FAILURE IN SERVER: piano Command not found
FAILURE IN SERVER: piano Command not found
FAILURE IN SERVER: ambi_choir Command not found
FAILURE IN SERVER: ambi_choir Command not found
FAILURE IN SERVER: bass Command not found
FAILURE IN SERVER: bass Command not found
FAILURE IN SERVER: moog Command not found
FAILURE IN SERVER: moog Command not found
FAILURE IN SERVER: synth_violin Command not found
FAILURE IN SERVER: synth_violin Command not found
FAILURE IN SERVER: marimba Command not found
FAILURE IN SERVER: marimba Command not found
FAILURE IN SERVER: dsaw Command not found
FAILURE IN SERVER: dsaw Command not found
FAILURE IN SERVER: pulse Command not found
FAILURE IN SERVER: pulse Command not found
FAILURE IN SERVER: ambi_drone Command not found
FAILURE IN SERVER: ambi_drone Command not found
FAILURE IN SERVER: pretty_bell Command not found
FAILURE IN SERVER: pretty_bell Command not found
FAILURE IN SERVER: piano Command not found
FAILURE IN SERVER: piano Command not found
FAILURE IN SERVER: ambi_choir Command not found
FAILURE IN SERVER: ambi_choir Command not found
FAILURE IN SERVER: bass Command not found
FAILURE IN SERVER: bass Command not found
FAILURE IN SERVER: moog Command not found
FAILURE IN SERVER: moog Command not found
FAILURE IN SERVER: synth_violinE Command not found
FAILURE IN SERVER: synth_violinE Command not found
FAILURE IN SERVER: marimba Command not found
FAILURE IN SERVER: marimba Command not found
FAILURE IN SERVER: dsaw Command not found
FAILURE IN SERVER: dsaw Command not found
FAILURE IN SERVER: pulse Command not found
FAILURE IN SERVER: pulse Command not found
FAILURE IN SERVER: ambi_drone Command not found
FAILURE IN SERVER: ambi_drone Command not found

It looks like something isn't getting loaded into my super collider install.… How did those sense get loaded?.
Anything you can publish is it working flow and be super helpful. Thank you so much for doing this. I really can't thank you enough!
-jc

This flow is very similar to the one you shared, just the content of the inject nodes is different (payload should is "start"/"stop" not true/false.

I have added a debug node: if you could let me know what appears in the debug messages (side panel on right) when you restart the flows that would be helpful. And if you could confirm what version of node-red and node-red-music you have running....

It works for me when I click on "start" with MacOS with node-red v3.0.2 and node-red-music 2.2.0.

I haven't tried it on Bullseye though, which could be the issue. I presume you have followed the instructions on installation on RPi at node-red-contrib-music (node) - Node-RED. Could you also let me know what the output is when you run

~/startsc.sh 

Or whatever it is you use to start supercollider

Ok.. so I started with a new flow

And got this in the debug window:

11/15/2022, 9:27:06 AMnode: debug 6synthtype : msg.payload : string[4]

"kick"

11/15/2022, 9:27:06 AMnode: debug 6synthtype : msg.payload : string[4]

"kick"

11/15/2022, 9:27:19 AMnode: debug 5msg.payload : string[4]

"tick"

11/15/2022, 9:27:19 AMnode: debug 5msg.payload : string[5]

"start"

11/15/2022, 9:27:19 AMnode: debug 6msg.payload : string[4]

"tick"

11/15/2022, 9:27:20 AMnode: debug 5msg.payload : string[4]

"tick"

11/15/2022, 9:27:20 AMnode: debug 6msg.payload : string[4]

"tick"

11/15/2022, 9:27:20 AMnode: debug 5msg.payload : string[4]

"tick"

11/15/2022, 9:27:20 AMnode: debug 6msg.payload : string[4]

"tick"

11/15/2022, 9:27:20 AMnode: debug 5msg.payload : string[4]

"tick"

11/15/2022, 9:27:20 AMnode: debug 6msg.payload : string[4]

"tick"

11/15/2022, 9:27:21 AMnode: debug 5msg.payload : string[4]

"tick"

11/15/2022, 9:27:21 AMnode: debug 6msg.payload : string[4]

"tick"

11/15/2022, 9:27:21 AMnode: debug 5msg.payload : string[4]

"tick"

11/15/2022, 9:27:21 AMnode: debug 6msg.payload : string[4]

"tick"

11/15/2022, 9:27:21 AMnode: debug 5msg.payload : string[4]

"tick"

11/15/2022, 9:27:21 AMnode: debug 6msg.payload : string[4]

"tick"

11/15/2022, 9:27:22 AMnode: debug 5msg.payload : string[4]

"tick"

11/15/2022, 9:27:22 AMnode: debug 6msg.payload : string[4]

"tick"

11/15/2022, 9:27:22 AMnode: debug 5msg.payload : string[4]

"tick"

11/15/2022, 9:27:22 AMnode: debug 6msg.payload : string[4]

"tick"

11/15/2022, 9:27:22 AMnode: debug 5msg.payload : string[4]

"tick"

11/15/2022, 9:27:22 AMnode: debug 6msg.payload : string[4]

"tick"

11/15/2022, 9:27:22 AMnode: debug 5msg.payload : string[4]

"tick"

11/15/2022, 9:27:23 AMnode: debug 6msg.payload : string[4]

"tick"

11/15/2022, 9:27:23 AMnode: debug 5msg.payload : string[4]

"tick"

11/15/2022, 9:27:23 AMnode: debug 6msg.payload : string[4]

"tick"

11/15/2022, 9:27:23 AMnode: debug 5msg.payload : string[4]

"tick"

11/15/2022, 9:27:23 AMnode: debug 6msg.payload : string[4]

"tick"

11/15/2022, 9:27:23 AMnode: debug 5msg.payload : string[4]

"tick"

11/15/2022, 9:27:23 AMnode: debug 6msg.payload : string[4]

"tick"

11/15/2022, 9:27:24 AMnode: debug 5msg.payload : string[4]

"tick"

11/15/2022, 9:27:24 AMnode: debug 6msg.payload : string[4]

"tick"

11/15/2022, 9:27:24 AMnode: debug 5msg.payload : string[4]

"tick"

11/15/2022, 9:27:24 AMnode: debug 6msg.payload : string[4]

"tick"

11/15/2022, 9:27:24 AMnode: debug 5msg.payload : string[4]

"tick"

11/15/2022, 9:27:24 AMnode: debug 6msg.payload : string[4]

"tick"

11/15/2022, 9:27:25 AMnode: debug 5msg.payload : string[4]

"tick"

11/15/2022, 9:27:25 AMnode: debug 6msg.payload : string[4]

"tick"

11/15/2022, 9:27:25 AMnode: debug 5msg.payload : string[4]

"tick"

11/15/2022, 9:27:25 AMnode: debug 6msg.payload : string[4]

"tick"

11/15/2022, 9:27:25 AMnode: debug 5msg.payload : string[4]

"tick"

11/15/2022, 9:27:25 AMnode: debug 6msg.payload : string[4]

"tick"

11/15/2022, 9:27:25 AMnode: debug 5msg.payload : string[4]

"stop"

Here’s what I get when I start the sc/jack flows.. I did follow your instru tions at at node-red-contrib-music (node) - Node-RED at the beginning. But have made some changes..

Here’s Another clue… I can run sonic pie when I first start up… As in I can run a sample club flow in sonic by and hear the music out of the headphone jack. When I run the startsc-rpi.sh I can no longer hear that music.… So I suspect it is something in the way I start the flow. I also wanna call your attention that when I called from my original flow where I was using several cents (e.g. “piano”)… I did get a message that those since were not defined. Somehow I think I might have a miss installed supercollider.

I really appreciate your effort here… Thank you very much!

-jc

pi@raspberrypi:~ $ ./startsc-rpi.sh

Jack main caught signal 15

JackDriver: killed by jack

Server is not running

Server is not running

Cannot write socket fd = 10 err = Broken pipe

CheckRes error

Could not write notification

ClientNotify fails name = system notification = 1 val1 = 0 val2 = 0

jackdmp 1.9.22

Copyright 2001-2005 Paul Davis and others.

Copyright 2004-2016 Grame.

Copyright 2016-2022 Filipe Coelho.

jackdmp comes with ABSOLUTELY NO WARRANTY

This is free software, and you are welcome to redistribute it

under certain conditions; see the file COPYING for details

JACK server starting in realtime mode with priority 10

self-connect-mode is "Don't restrict self connect requests"

JackDriver: client name is 'SuperCollider'

SC_AudioDriver: sample rate = 48000.000000, driver's block size = 1024

SuperCollider 3 server ready.

JackDriver: max output latency 42.7 ms

I should add when I tried the simple flow… I did not get any sound.

Steve

OK… Thanks to you some good progress. I realized that I was using the wrong version of the script to start supercollider. I was using the version for a USB card and I was trying to use the actual hardware audio. Now when I try your simple script I can get drumbeats through the speakers. So we’re not far off.

I still have trouble with my flow though and that it’s not loading the since e.g. “piano”…. Which I see below is the listing of my start script for supercollider

pi@raspberrypi:~ $ ./startsc.sh

jackd: no process found

scsynth: no process found

jackdmp 1.9.22

Copyright 2001-2005 Paul Davis and others.

Copyright 2004-2016 Grame.

Copyright 2016-2022 Filipe Coelho.

jackdmp comes with ABSOLUTELY NO WARRANTY

This is free software, and you are welcome to redistribute it

under certain conditions; see the file COPYING for details

JACK server starting in realtime mode with priority 10

self-connect-mode is "Don't restrict self connect requests"

creating alsa driver ... hw:0|hw:0|2048|3|44100|0|2|nomon|swmeter|-|32bit

ALSA: Cannot open PCM device alsa_pcm for capture. Falling back to playback-only mode

configuring for 44100Hz, period = 2048 frames (46.4 ms), buffer = 3 periods

ALSA: final selected sample format for playback: 16bit little-endian

ALSA: use 3 periods for playback

JackDriver: client name is 'SuperCollider'

SC_AudioDriver: sample rate = 44100.000000, driver's block size = 2048

SuperCollider 3 server ready.

JackDriver: max output latency 139.3 ms

Heres the start of my Node red.. Note the server errors. These server errors do not occur when I’m just using your simple drumbeat sketch… But do appear when I’m trying to run my entire sketch which is included at the end of this note

pi@raspberrypi:~ $ node-red

15 Nov 21:34:23 - [info]

Welcome to Node-RED

OK the startup script looks OK - it kills any existing process (which reports an error if it doesn't exist) and then starts. Now that there's sound coming out that's very promising.

In the past, when nodes have been updated I have sometimes found that I need to re-build the flow. When I run the simple example with the kick and change the instrument to "piano" it works for me, playing a piano note repeatedly. Does that work for you? If so then it's not the supercollider end of things that isn't working. How big is the original flow? Is it feasible to rebuild i.e. go through the muisc nodes in turn, deleting and recreating them?

GOT IT !!!!

Thanks for your help. You were correct that deleting and re-adding the nodes made it work. In the end though it was my error. . I had a sub-flow called “supercollider” . That flow had the synths in it which used to go to an OSC node that went to a UDP node. You told me that the OSC node was no longer required.. so I had incorrectly wired the synths to the UDP node.. instead of instantiating the SUPERCOLLIDER node and wiring that in. Am I correct that the SUPERCOLLIDER node was introduced when you moved the OSC requirement ? I’m wondering because I don’t believe I ever had a SUPERCOLLIDER node in my old working flow

Anyway.. thanks SOOOOO much for your help.and very sorry to have pestered you so much . I’ll send you some pics of the end results. Can I buy you a pint for your time ?

-jc

SOLVED !!! Thanks to help from Steve !
Simple solution. I missed the memo on the updates that were made to node-red-contrib-music that incorporated the functionality of the OSC node into the SUPERCOLIDER node. When I made that change, my old flow works fine. Thanks to Steve for his prompt help.
-jc

1 Like

Great stuff! Would love to see any pictures/videos of the end result ... maybe put them up here so other node-redders can see too...

As usual documentation could always be improved, which is what I tell my students about open source projects and how to get involved!

Thanks for your patience

Steven

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.