[FOUND BUG] Ruby Code dosent work if VST GUI closed in host

For general discussion related FlowStone
Dave_Scream
Posts: 8
Joined: Mon Oct 07, 2013 6:49 pm

[FOUND BUG] Ruby Code dosent work if VST GUI closed in host

Post by Dave_Scream »

Hello.
I maked my first VST that randomly generate midi notes. Random generator maked with Ruby code element.

The problem is when I close VST GUI in my host (FL Studio) - all notes are stopped and no output from VST.

When I open VST GUI back - I can hear very big amount of notes sended from VST. Its like this notes collected inside VST and when I open gui they are out in one moment.

Why VST dont work if I close GUI?

VST build with Flowstone 3.0.3 standalone version. SSE optimizations.
I tryed to switch off "Smart disable" function in FL Studio. and many many other checkboxes in VST Wrapper but no luck :(
I tryed to check or uncheck Purgeable bit, but no luck too Image

why VST or Ruby code element (wich generate notes) may stop work if VST GUI Closed? If I run code in FL Studio SynthMaker - it work okay even if I close Synth Maker GUI. But I need VST version because I want use Midi out through Wrapper, not real midi device.
Attachments
myrandomizer_5.fsm
FSM module
(168.36 KiB) Downloaded 1166 times
Last edited by Dave_Scream on Tue Oct 08, 2013 8:38 pm, edited 2 times in total.
Dave_Scream
Posts: 8
Joined: Mon Oct 07, 2013 6:49 pm

Re: Compiled VST dont work if I close VST GUI in host

Post by Dave_Scream »

I maked some research and found that just midi_in -> midi_out link work good even if VST GUI Closed.

but Ruby code element dosent work if VST GUI closed. So whole problem is in Ruby code element.

Look at this screenshot please (more than 400px width, so only link)
http://cs616617.vk.me/v616617838/656/EL_lyAcQfHQ.jpg

this simple Ruby code dosent send midi notes if VST Gui closed.
Dave_Scream
Posts: 8
Joined: Mon Oct 07, 2013 6:49 pm

Re: Ruby Code dosent work if VST GUI closed in host

Post by Dave_Scream »

this scheme have the same issue because Ticker builded with Ruby component.
Image
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: Ruby Code dosent work if VST GUI closed in host

Post by Nubeat7 »

looks like it is a triggerthread problem because when i`m right the midi triggers are in an own thread , so not in the gui thread and i think this is the reason for this issue, but you can send midi notes directly out of the ruby module, then it works correct..
Attachments
myrandomizer_5_fix.fsm
(164.63 KiB) Downloaded 1101 times
Dave_Scream
Posts: 8
Joined: Mon Oct 07, 2013 6:49 pm

Re: Ruby Code dosent work if VST GUI closed in host

Post by Dave_Scream »

Nubeat7 wrote:looks like it is a triggerthread problem because when i`m right the midi triggers are in an own thread , so not in the gui thread and i think this is the reason for this issue, but you can send midi notes directly out of the ruby module, then it works correct..

Its working) thank you. I didnt knew that I can send midi with Ruby component. Its much more simplier than use other components.

I think when Ruby appeared in Flowstone it can replace the most part of scheme and increase readability.

Can you please explain where you know that Ruby can make Midi.new event? and parameters list? I didnt find anythink in manuals. Maybe I can make in Ruby some other FlowStone objects? where to see classes and their methods, properties, constructor (new) parameters?
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: Ruby Code dosent work if VST GUI closed in host

Post by Nubeat7 »

you can find a discription for ruby and midi in the userguide chapter 8 site 206, with a rightclick on a ruby connector you see which kind of data you can send or recieve, over the 'V' connector you also can define your own datatypes if needed its also documented in the userguide, chapter 8 site 142..
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Ruby Code dosent work if VST GUI closed in host

Post by trogluddite »

How weird - I tried it inside Reaper - exactly the same problem.

@Nubeat - well spotted, thanks for pointing out how to avoid the problem.
I'll mention it to Malc, anyway, next time I'm in touch with him - always good to try and stamp out threading problems!
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Re: Ruby Code dosent work if VST GUI closed in host

Post by RJHollins »

Is this issue related to having to use the 'MIDI De-Threader' primitive?

I had an issue come up before with a VST that worked in FS, but not as a VST. MyCO had explained and 'fixed' my schematic. [just don't recall the exact details].

Anyway ... great find NuBeat :) ... glad TROG saw this too :)
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: [FOUND BUG] Ruby Code dosent work if VST GUI closed in h

Post by trogluddite »

RJHollins wrote:Is this issue related to having to use the 'MIDI De-Threader' primitive?

Not exactly the same, I don't think, but very closely related...
Previously (all the way back to SM), there was a problem with green timers and MIDI - timed events weren't able to trigger a MIDI event.
There was also another one before in FS, now fixed, where MIDI that was created inside a Ruby primitive could not be turned into green strings for showing the output events.
Seems that all of these have the same cause - different bits of FS running in 'parallel' with independent timing on different threads. It's one of the hardest problems to deal with when writing many big applications; the threads have to talk to each other just right, otherwise the communication can get garbled.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Re: [FOUND BUG] Ruby Code dosent work if VST GUI closed in h

Post by RJHollins »

hmmm ... think I just got bit by this :roll:

I have a situation where a knob is sending MIDI values, but I needed to 're-scale' a couple of knob positions to link correctly with another plugs values.

To this, I was using TROGs 'Transfer Curve' module.

Well, I thought I could replace this with RUBY ... and I did. Basically it was a CASE...SELECT routine that isolated several values and provided 'altered' output values. It was working great in FS.

When I exported to VST, got some unexpected result. :o

The plug-in I was controlling showed the correct value ... but as soon as I clicked to view MY controller ... it sent new values to the other plug. :shock: I could still change/control the plug, but these 2 out of 5 'RUBY' controls would not work correctly [saved session in REAPER].

I even tried to put in a 're-transmit' button to resend controller data to all connected plugins ... but this didn't work on the RUBY'd modules.

I had to go back and wire in the TROG module from before.

Still confused as to what is going wrong. Gonna look at NuBeats' post to see how this might relate.
:?
Post Reply