Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

what triggers the ruby code boxes to refresh?

For general discussion related FlowStone

what triggers the ruby code boxes to refresh?

Postby MichaelBenjamin » Tue Jun 16, 2020 9:43 pm

.
Last edited by MichaelBenjamin on Mon Sep 21, 2020 10:51 am, edited 1 time in total.
MichaelBenjamin
 
Posts: 275
Joined: Tue Jul 13, 2010 1:32 pm

Re: what triggers the ruby code boxes to refresh?

Postby tulamide » Tue Jun 16, 2020 10:15 pm

MichaelBenjamin wrote:for green, it is a trigger, for the codebox it is each sample.
but what triggers the ruby code boxes to refresh?

What do you mean by that?
The code boxes are constantly interpreted, at around 100 Hz.
Inputs are event-driven. No change - no trigger.
Or do you mean a redraw? That's triggered by a MGUI.
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: what triggers the ruby code boxes to refresh?

Postby nix » Tue Jun 16, 2020 10:24 pm

you can trigger Ruby with a tick if you'd like
User avatar
nix
 
Posts: 817
Joined: Tue Jul 13, 2010 10:51 am

Re: what triggers the ruby code boxes to refresh?

Postby MichaelBenjamin » Tue Jun 16, 2020 10:54 pm

.
Last edited by MichaelBenjamin on Mon Sep 21, 2020 10:51 am, edited 1 time in total.
MichaelBenjamin
 
Posts: 275
Joined: Tue Jul 13, 2010 1:32 pm

Re: what triggers the ruby code boxes to refresh?

Postby nix » Tue Jun 16, 2020 11:02 pm

no, you can trigger a Ruby codebox with itself also
User avatar
nix
 
Posts: 817
Joined: Tue Jul 13, 2010 10:51 am

Re: what triggers the ruby code boxes to refresh?

Postby MichaelBenjamin » Wed Jun 17, 2020 12:58 am

.
Last edited by MichaelBenjamin on Mon Sep 21, 2020 10:51 am, edited 1 time in total.
MichaelBenjamin
 
Posts: 275
Joined: Tue Jul 13, 2010 1:32 pm

Re: what triggers the ruby code boxes to refresh?

Postby nix » Wed Jun 17, 2020 2:04 am

it's a usable precision for slightly humanised timing,
do u want to join the Alpha Michael?
-I could then share with you my attempt at a solid sequencer
Ruby is close enough to sound fine, even at like 480 bpm
Last edited by nix on Wed Jun 17, 2020 2:51 pm, edited 1 time in total.
User avatar
nix
 
Posts: 817
Joined: Tue Jul 13, 2010 10:51 am

Re: what triggers the ruby code boxes to refresh?

Postby trogluddite » Wed Jun 17, 2020 2:27 pm

A complete answer to this needs to take into account the nature of the code inside the Ruby box.

Type 1: What I call "bare code" (no method definitions)

There is just one or more lines of code which act upon the input values and send one or more output values. This behaves as follows...

- All of the code is executed when an input receives a trigger.
- All of the code is executed when the code is edited (literally every key-stroke!)
- The code may schedule any input to change value at a later time (when the code will again be executed).
- The code may schedule any output to change value at a later time (no code is executed).

These should NOT be executed at startup (the RubyEdit's output values are saved with the schematic, just like most other primitives). However, there seems to be a bug which does cause startup execution sometimes, which can lead to very annoying Ruby errors (more info here).

Type 2: You write a series of method definitions

These normally include a method called "event", which is used to handle incoming green triggers. These behave as follows...

- At startup, the code is parsed to define the methods, then the methods "init" and "loadState" are executed.
- When code is edited, the code is parsed to define the methods, then the "init" method is executed.
- When a green trigger arrives, the "event" method is called.
- The code may schedule any method to be executed at a later time.
- The code may schedule any input to change value at a later time (which will call "event", if present).
- The code may schedule any output to change value at a later time.

In at least some v3.0.x versions, the detection of the kind of code is very crude - it just looks for the string "def" anywhere in the code. This can occasionally lead to bugs where "bare code" is erroneously taken to be a set of method definitions - e.g. if you used the word "default" in a comment or to name a temporary local variable.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: what triggers the ruby code boxes to refresh?

Postby MichaelBenjamin » Fri Jun 19, 2020 12:11 am

.
Last edited by MichaelBenjamin on Mon Sep 21, 2020 10:52 am, edited 1 time in total.
MichaelBenjamin
 
Posts: 275
Joined: Tue Jul 13, 2010 1:32 pm

Re: what triggers the ruby code boxes to refresh?

Postby nix » Fri Jun 19, 2020 6:48 am

greets!
glad you're still on board, I catch you from time to time here
I sent a pm about the Alpha, nothing like some practical experience,
you can try Ruby if you'd like to compagnon
User avatar
nix
 
Posts: 817
Joined: Tue Jul 13, 2010 10:51 am

Next

Return to General

Who is online

Users browsing this forum: Google [Bot] and 56 guests