Re: Simple Arp
Posted: Mon Apr 19, 2021 1:15 am
Thanks so much again for the fix, Josevo!
Just tested. Works great inside flowstone but not in my DAW
Just tested. Works great inside flowstone but not in my DAW
DSP Robotics and FlowStone Graphical Programming Software Support and Forums
http://www.dsprobotics.com/support/
Exo wrote:Here is the simple arp module that I was previously selling...
There has been a report of stuck notes, but right now I couldn't fix it. So this is open sourced do what you like with it
djbrynte wrote:Are u serious Josevo did u fix it? damn ur inzane man!
def init()
...
...
...
# Declare a variable e.g. @step = 0
@step = 0 # required later by seeded random ARP
end
elsif(@mode==4) #Random
# Add the following lines (for looping 8 steps) just before calls to rand():
if (@step == 8)# Last step of sequence?
#srand(seed) resets/restarts the random generator to the sequence
srand(973) # of seed 973 (seed can be seen as a sequence reference)
@step = 0 # and restart step counter
end
@step+=1
# ----- That's all
@pos =(rand()*@notes.length).to_i
@rangeCount = (rand()*@range).to_i
end
josevo wrote:Thank you, kortezzzz!
Seeded Random ARP concept (explained briefly):
The "random mode" of this Arpeggiator was working more or less like those of conventional commercial instruments, which was good but not enough interesting from the creative point of vue, because of the lack of the possibility of repetition.
So, I found interesting to combine the rand() function with the srand(seed), which resets the next rand() to the start of a new sequence, referenced by the seed value.
- Code: Select all
# HOW TO implement a "seed routine" to an existing random ARP:
def init()
...
...
...
# Declare a variable e.g. @step = 0
@step = 0 # required later by seeded random ARP
end
In this case, srand() is called at the end of the steps of each loop. The following code is executed once per note about to be played.
- Code: Select all
elsif(@mode==4) #Random
# Add the following lines (for looping 8 steps) just before calls to rand():
if (@step == 8)# Last step of sequence?
#srand(seed) resets/restarts the random generator to the sequence
srand(973) # of seed 973 (seed can be seen as a sequence reference)
@step = 0 # and restart step counter
end
@step+=1
# ----- That's all
@pos =(rand()*@notes.length).to_i
@rangeCount = (rand()*@range).to_i
end
You can find more comments in the example. It is simplified for a better understanding and mouldability.
kortezzzz wrote:Beautiful Josevo
Thank you so much for the explanation, the examples and your fantastic job with Ruby teaching. Keep it coming
josevo wrote:By the way, RUBY is not my mother language, so I write it with a strong C and Pascal accent