Page 1 of 1

Combining poly streams in parallel

Posted: Sun Feb 22, 2015 12:13 pm
by Perfect Human Interface
Repurposing thread.

I want to run data from a mono to poly component on it's own poly voice while also adding additional voices on top of it with MIDI notes. The problem is when I wire the mono to poly and the MIDI to poly in together, the values add together rather than existing independently. Is there some way I can get this to work? The data from the mono to poly changes over time, so I can't simply send a value through a MIDI event.

I know v. 3.0.5 brought accessible ID's for each poly stream, though I'm still on 3.0.4. Still, can that be used to filter for a specific ID and then have a certain behavior applied to that voice of the poly stream?

_______Original post:___________________________________
Is there any way to open a poly stream without sending actual MIDI notes?

For my latest project I had the crazy idea of making it function as an effect while also optionally being playable with MIDI notes. I can wire it up in blue, and I can wire it in poly, but not sure yet how I can make it switch between, or do both. I have a mono to poly module that someone made, which is pretty neat, but as you know it won't do anything unless there's an existing poly stream open, and the only way I know how to do that is via MIDI to Poly.

If there was some way I could open a single poly "voice" continuously and run converted mono stuff through it while also being able to "play" the other voices via MIDI notes at will, that would be amazing.

Re: Poly without MIDI?

Posted: Sun Feb 22, 2015 5:10 pm
by KG_is_back
Is it possible? well, yes and no... Voices may only be initialized by midi-to-poly component. However, midi doesn't have to go from external source. Midi signal may also be send from "midi event" prim or from Ruby.

also check this post: http://dsprobotics.com/support/viewtopic.php?f=2&t=2828

Re: Poly without MIDI?

Posted: Sun Feb 22, 2015 10:14 pm
by Perfect Human Interface
Oh, I should have searched! Thanks

Re: Combining poly streams in parallel

Posted: Mon Feb 23, 2015 8:16 am
by Perfect Human Interface
I've updated the original post with a different question. Thanks in advance

Re: Combining poly streams in parallel

Posted: Mon Feb 23, 2015 8:04 pm
by KG_is_back
So basically what you need is this?:

One (or more) channel is initiated internally (via midi event or ruby) and you what those voices to use the mono to poly input.

additional voices (initiated by midi input) should ignore the mono to poly input (and use some different processing or something).

The way you can do it is, to use such note pitch or velocity for the first channel, that will surely be never used by midi input. For example this code outputs "default" pitch when input pitch is 0 (which is very unlikely to be used by midi in from keyboard) and also switches between two "modulation sources".

Code: Select all

streamin pitch; //the pitch fom midi to poly component
streamin defaultPitch; //connect some default value to this
streamin mod1;
streamin mod2;
streamout outPitch;
streamout outMod;

float default,notDefault;

default=pitch==0;
notDefault=pitch!=0;
//note: for pitch variable "&notDefault" is unnecessary since it is already 0 when notDefault is false;
outPitch=pitch&notDefault + defaultPitch&default;

outMod=mod1&notDefault + mod2&default;


Re: Combining poly streams in parallel

Posted: Tue Feb 24, 2015 12:12 am
by Perfect Human Interface
Ah, great, I've got it now! I didn't need the "defaultPitch" input on your code block, just to check for pitch == 0 and then output one (frequency in Hz) signal or the other, then use MIDI Event to send note pitch 0 into the MIDI to Poly. Now I can send notes and another independent frequency value through poly on separate voices simultaneously (awesome!). I just wasn't wrapping my head around the poly logic; instead of trying to wire the signals together (which adds the values) I needed to run it through logic and have each stream figure out their response to that logic independently, then output "one or the other" (which actually outputs both, since again they're independent streams).

Huge thanks KG!

I modified the code to this:

Code: Select all

streamin pitch; //the pitch fom midi to poly component
streamin input1;
streamin input2;
streamout output;

output=input1&(pitch==0) + input2&(pitch!=0);