Stream audio, float, and midi between plugin instances?

For general discussion related FlowStone
Post Reply
User avatar
guyman
Posts: 207
Joined: Fri Mar 02, 2018 8:27 pm

Stream audio, float, and midi between plugin instances?

Post by guyman »

Hello. I would like to stream audio, float, and midi between multiple plugin instances that are open simultaneously. What options are on the table so far?
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Stream audio, float, and midi between plugin instances?

Post by KG_is_back »

There are several of them. The easiest (and cheatiest) one is to use constants or class variables in Ruby. Ruby interpreter is shared between instances of the same plugin, so when you declare a constant or class variable in one of them, it will be available to all of them.
Constants in Ruby are actually not constant - they are merely guaranteed to stay the same object, but the object itself can change - define a Hash or an array and you can put data into it or remove data from it from any instance:

Code: Select all

#in instance 1.
SHARED_DATA=Hash.new
SHARED_DATA["float"]=0.56 #write 0.56 to position named "float"

#in instance 2.
SHARED_DATA["float"] #=> 0.56



The problem with this is that the plugins are not synced. You have no guarantee which code in which plugin gets executed first. This is particularly a problem, because you can't define a constant twice (you get error). Google "how to define constant in ruby only if not defined yet?" or something similar to find some workarounds. To share audio, you can pass Frame objects. Naturally, there will be latency and syncing them properly will be a pain.

The value can also be a RubyEdit object, which is the specific module returned by keyword "self". The object has methods "input" and "output" that you can call, which is how the ruby modules communicate with flowstone and each other. This can be powerful, because it means you can send MIDI messages that will be properly time-synced (mostly). I have not actually tested this though.

I can create some example schematics if you like...
User avatar
guyman
Posts: 207
Joined: Fri Mar 02, 2018 8:27 pm

Re: Stream audio, float, and midi between plugin instances?

Post by guyman »

Surely, you can if you would like. After further thought I don't know if the purpose I want to utilize the functions for is practical - so it is not taking precedence at this time for me... so don't bother using too much of your time towards it...

thank you for your response !

perhaps someone else who finds this thread will make use of it if you do tho....
User avatar
guyman
Posts: 207
Joined: Fri Mar 02, 2018 8:27 pm

Re: Stream audio, float, and midi between plugin instances?

Post by guyman »

actually scratch that last post... yes if you could... I want to be able to trigger mono or solo buttons across all instances... say for multiband management purposes.... one you solo a band on one instance of the plugin... it solos that band on every instance...
Post Reply