Page 1 of 2

Ruby trigger basics

PostPosted: Tue Mar 12, 2019 3:07 pm
by gvalletto
Hi all. I want to improve the time precision of a complex step modulator made with DSP code and green prims.

Does anybody know how to make Ruby codes to replace these green trigger prims?

Re: Ruby trigger basics

PostPosted: Tue Mar 12, 2019 7:15 pm
by gvalletto
...at least tell me where to find that to learn to make it myself... :)

Re: Ruby trigger basics

PostPosted: Tue Mar 12, 2019 8:19 pm
by tulamide
Here you are. However, it doesn't make sense, since you convert from green to Ruby, then back to green. The unreliable timing of green stays. And the overhead will probably make it more CPU intensive.

Re: Ruby trigger basics

PostPosted: Tue Mar 12, 2019 8:44 pm
by gvalletto
Thanks Tulamide! I understand the reason why it has no sense if I use them in an isolated way (that´s, a Ruby module with just that small code). Perhaps if I add that code in several already existent Ruby modules on my scheme, so to avoid go and back to green, it may make the difference... I will try.

Re: Ruby trigger basics

PostPosted: Tue Mar 12, 2019 10:02 pm
by RJHollins
Thanks Tulamide!

Re: Ruby trigger basics

PostPosted: Wed Mar 13, 2019 10:40 am
by RJHollins
Appreciate the RUBY offer ... but I could not load in the schematic [v:3.06]

Re: Ruby trigger basics

PostPosted: Wed Mar 13, 2019 7:42 pm
by gvalletto
RJHollins wrote:Appreciate the RUBY offer ... but I could not load in the schematic [v:3.06]


Search for the topic "Ruby basic examples". There I put the scheme fixed.

viewtopic.php?f=2&t=15205&p=48563&hilit=Ruby+basic+examples#p48563

Re: Ruby trigger basics

PostPosted: Fri Mar 15, 2019 12:35 pm
by gvalletto
tulamide wrote:Here you are. However, it doesn't make sense, since you convert from green to Ruby, then back to green. The unreliable timing of green stays. And the overhead will probably make it more CPU intensive.


Hi Tulamide. I deleted some of the code of your trigger scheme, and surprise, it still working... what can be the difference? Here I attach the original and the modified version.

Re: Ruby trigger basics

PostPosted: Fri Mar 15, 2019 5:30 pm
by tulamide
When only having a line of code (or several) that will be executed whenever the RubyEdit gets triggered, you can omit the event method definition. I wouldn't advise it though. Read chapter 8 of the user guide, it is a treasure for questions like these!

Re: Ruby trigger basics

PostPosted: Fri Mar 15, 2019 6:59 pm
by gvalletto
Thanks! II read it several times, but I'll read it again ...