Rate Limit questions and Midi question

#1

Hi friends.. I'm in need of a quick solution. I'm trying to change the tempo of MIDI music programmatically . The idea is to queue up all the midi notes from a fast playing input midi node and then rate limit them to slow them down. I'm trying to use the 'rate limit' option in the delay node.. but that only goes down to 1 message per second. I need to be able to go down into the milliseconds. Is there a a way to rate limit down into the milliseconds. For extra credit .. i'd like to control the rate programmatically like from a slider.. any ideas ?

while i'm at it .. does anyone have an example of generating polyphonic Midi from Node-red using node-red-contrib midi ? .. I see the opcode is supported.. but cant figure out how to make that work..

thanks

john cohn

0 Likes

#2

Hi John,

You can configure the rate limit to be 10 msgs per second (for example) to achieve a faster rate. But it isn't dynamically configurable. I'm not immediately aware of a contrib node that does variable rate limiting.

Nick

0 Likes

#3

Hi Nick !.. I've tried that.. but it doesn't seem to distribute them smoothly.. which is important for music tempo.. I'll try again. .. Is it possible for me to fork a version of the delay node that does what I want , rename it .. and put it in contrib ? If so.. where are those sources ? Thanks !
-jc

0 Likes

#4

Hi John - the core nodes are here - https://github.com/node-red/node-red/tree/master/nodes/core/core
It will try to release them to time - but don't forget linux is not a real time OS and there are other processes running that may put off those timings... and this would be worse at higher frequencies that you may need - and of course the human ear/brain is a wonderful sensor and can tell if something is not quite right to a very high resolution.
Good luck !

0 Likes

#5

[edit] IGNORE THIS: If you set it for 10msgs/sec - the 1st 10 msgs will just zip thru without delay but all the ones after that will be delayed by 0.1 sec (within the timing limits of Linux like what @dceejay said)

You could maybe workaround by prefixing 10 dummy midi msgs to your stream?[/EDIT]

0 Likes

#6

???? I hope it doesn’t do that. Please share a flow that shows that.

0 Likes

#7

Unfortunately, I've just damaged my neopixel ring :frowning:

But this is the thread that highlights the issue - IIRC - it only happens when you 1st re-deploy and send your 1st sequence of messages - it works OK afterwards

Simon

0 Likes

#8

But that wont normally happen. The timeout is a single fixed number that is created from those values. The only way that can happen is if you are using the “per different topic” option.

0 Likes

#9

I can't reproduce the effect I was (literally :slight_smile: ) seeing - so I withdraw my comment

If I see it again - I'll re-raise it on original thread

Sorry for the thread deviation

0 Likes