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
Help: Ruby 4 x Sample & Hold Value
18 posts
• Page 1 of 2 • 1, 2
Help: Ruby 4 x Sample & Hold Value
Well... this Value thing in ruby makes me crazy...
I need ur help guys:
What i need are 4 sampled values... sounds easy but:
i can't get it to work
maybe it should be done all in one ruby part?!
and maybe i'm missing here something
So just simply click the dice 4 times and try to recall the sampled values with the knob
I need ur help guys:
What i need are 4 sampled values... sounds easy but:
i can't get it to work
maybe it should be done all in one ruby part?!
and maybe i'm missing here something
So just simply click the dice 4 times and try to recall the sampled values with the knob
- Attachments
-
- Walters dice 4 x Value Sample.fsm
- (please ignore the simple dice part)
- (264.29 KiB) Downloaded 783 times
-
Walter Sommerfeld - Posts: 249
- Joined: Wed Jul 14, 2010 6:00 pm
- Location: HH - Made in Germany
Re: Help: Ruby 4 x Sample & Hold Value
semplify all with this?
- Code: Select all
watch 'number', number = [ [*1..6].sample, [*1..6].sample, [*1..6].sample, [*1..6].sample ]
number[@select] # the var @select is an ruby int input named select
- Tronic
- Posts: 539
- Joined: Wed Dec 21, 2011 12:59 pm
Re: Help: Ruby 4 x Sample & Hold Value
Hi Tronic,
thanks but:
i only need a value selector that is working (see the not changing output label when u rotate the knob)
...ignore the dice part
thanks but:
i only need a value selector that is working (see the not changing output label when u rotate the knob)
...ignore the dice part
-
Walter Sommerfeld - Posts: 249
- Joined: Wed Jul 14, 2010 6:00 pm
- Location: HH - Made in Germany
Re: Help: Ruby 4 x Sample & Hold Value
Yes the ruby connector not have the same concept of the green < - >, so you have retrigger it with the ruby.
However the my example is the simply version of your schematics, it act in the same manner, just use an knob to get the value of results.
However the my example is the simply version of your schematics, it act in the same manner, just use an knob to get the value of results.
- Code: Select all
def event i
if i=="dice" # get trig from dice button?
output 0, a=[*1..6].sample
output 1, b=[*1..6].sample
output 2, c=[*1..6].sample
output 3, d=[*1..6].sample
@number = [a,b,c,d]
end
output 4, @number[@select] #@select is knob input value
end
- Tronic
- Posts: 539
- Joined: Wed Dec 21, 2011 12:59 pm
Re: Help: Ruby 4 x Sample & Hold Value
I need 4 sampled values selectable from the same value source!
Not four selectable random numbers.
The dice is only a simple 'generator' to get 4 values for the selector!...
Please have a closer look - Thanks again
Walter
Not four selectable random numbers.
The dice is only a simple 'generator' to get 4 values for the selector!...
Please have a closer look - Thanks again
Walter
-
Walter Sommerfeld - Posts: 249
- Joined: Wed Jul 14, 2010 6:00 pm
- Location: HH - Made in Germany
Re: Help: Ruby 4 x Sample & Hold Value
Walter Sommerfeld wrote:I need 4 sampled values selectable from the same value source!
Not four selectable random numbers.
The dice is only a simple 'generator' to get 4 values for the selector!...
Please have a closer look - Thanks again
Walter
Something like this?
EDIT: No, can't be what you're looking for, I just saw that Tronic already offered bqasically the same, meaning a selection is done by the knob from a pool of several values.
- Attachments
-
- selection.fsm
- (4.46 KiB) Downloaded 765 times
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
Re: Help: Ruby 4 x Sample & Hold Value
YUP tulamide,
but thanks anyway...
U guys put me on the right track...
but i guessed it ends up with a selector made inside a ruby mod by using variables to mimic the S&H...
My intention
After ur hints and sleep over it i think i got it (on paper)...
Will report later...
but thanks anyway...
U guys put me on the right track...
but i guessed it ends up with a selector made inside a ruby mod by using variables to mimic the S&H...
My intention
here is needed because i have a very complex Midi Controller project where i need to S&H 4 banks of values so i don't have to calculate them every time again and again!a selection is done by the knob from a pool of several values
After ur hints and sleep over it i think i got it (on paper)...
Will report later...
-
Walter Sommerfeld - Posts: 249
- Joined: Wed Jul 14, 2010 6:00 pm
- Location: HH - Made in Germany
Re: Help: Ruby 4 x Sample & Hold Value
Here my working if/elsif version!
If some of u like to make a simpler version with in 'case' etc. - you're welcome...
keep on doing!
Walter
If some of u like to make a simpler version with in 'case' etc. - you're welcome...
keep on doing!
Walter
-
Walter Sommerfeld - Posts: 249
- Joined: Wed Jul 14, 2010 6:00 pm
- Location: HH - Made in Germany
Re: Help: Ruby 4 x Sample & Hold Value
this is my simplification
- Code: Select all
def init
@SH = []
end
def event i, v
if @on and (i=='go') and (@selection<=@max)
@SH[@selection] = @input_value
end
output @selection, @SH[@selection]
output 'done_v', nil
output 'done', nil
end
- Tronic
- Posts: 539
- Joined: Wed Dec 21, 2011 12:59 pm
Re: Help: Ruby 4 x Sample & Hold Value
works fine... but:
where my version triggers one time after hit go - yours produces 3!
cheers,
Walter
where my version triggers one time after hit go - yours produces 3!
cheers,
Walter
-
Walter Sommerfeld - Posts: 249
- Joined: Wed Jul 14, 2010 6:00 pm
- Location: HH - Made in Germany
18 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 141 guests