Page 6 of 8

Re: Simple Arp

PostPosted: Mon Apr 19, 2021 1:15 am
by kortezzzz
Thanks so much again for the fix, Josevo!
Just tested. Works great inside flowstone but not in my DAW :?

Re: Simple Arp

PostPosted: Mon Apr 19, 2021 7:10 pm
by josevo
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 :)


I'm sorry I didn't read the first post from Exo but the most recent comments.

Regarding the original file, here is the first debugged version, problem was the midi switch (multiplex prim), the @started variable was not updated.

And some more lines of Ruby were added.

Re: Simple Arp

PostPosted: Mon Apr 26, 2021 12:46 pm
by djbrynte
Are u serious Josevo did u fix it? damn ur inzane man!

Re: Simple Arp

PostPosted: Mon Apr 26, 2021 2:31 pm
by josevo
djbrynte wrote:Are u serious Josevo did u fix it? damn ur inzane man!


I'm not sure I solved the original problem because I still don't have a detailed report of the original issue. I just solved the issue I was having here, when changing combo values while playing.

I'm just trying to help so, If you are experimenting problems, please, report a detailed description of it and when it occurs (e.g. after changing chords, pressing some key, changing preset, ...) I can't do more.

Re: Simple Arp

PostPosted: Tue Apr 27, 2021 6:00 am
by kortezzzz
Josevo,
Your last upload works solidly, but it just lacks the seeded arpeggio feature. By the way, I would love to read a short explanation about how those seeded arpeggios work. How do you calculate them in the Ruby code? This is one of most interesting random features I've ever saw in a sequencer.

Thank you, once again.

Re: Simple Arp

PostPosted: Thu Apr 29, 2021 8:33 pm
by josevo
Thank you, kortezzzz!

Seeded Random ARP concept and how to implement it: (Second update)

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 the sequence referenced by the seed value. What makes it even more interesting is the fact that, this way, the seed can represent millions of sequences without requiring memory, and it's easy to implement.

HOW TO "seed" the actual random ARP. Just add the following:

Code: Select all
def init()
   ...
   ...
   ...
   # Declare a variable e.g. @step = 0
    @step = 0 # required later by seeded random ARP
end


Locate the random calls and add the following code (change 973 to other values, it's the key/seed that references each rand sequence. BTW, if you put nothing, the sequence will seem to be random as the original because the system will chose it. ):

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.

Re: Simple Arp

PostPosted: Fri Apr 30, 2021 10:08 am
by kortezzzz
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.


Beautiful Josevo 8-)
Thank you so much for the explanation, the examples and your fantastic job with Ruby teaching. Keep it coming ;)

Re: Simple Arp

PostPosted: Fri Apr 30, 2021 10:32 am
by josevo
kortezzzz wrote:Beautiful Josevo 8-)
Thank you so much for the explanation, the examples and your fantastic job with Ruby teaching. Keep it coming ;)


You're welcome!

By the way, RUBY is not my mother language, so I write it with a strong C and Pascal accent :lol:

Re: Simple Arp

PostPosted: Sat May 01, 2021 6:34 am
by kortezzzz
josevo wrote:By the way, RUBY is not my mother language, so I write it with a strong C and Pascal accent :lol:


That's very interesting. Are you using any other languages to develop plugins or audio software?

Re: Simple Arp

PostPosted: Sat May 01, 2021 11:03 pm
by josevo
I used C++ and Delphi pascal for decades, not for audio related projects though.

Nevertheless, I gave a little try to an VST synth using WDL-OL libraries some time ago, following Martin Finke's blog, but I finally came to the conclusion that there wasn't a considerable difference (compared to FS) in terms of latency and sound quality, to continue using archaic and tedious ways of programming.

Now, to be honest, I don't own a business and I'm not selling VST pluggins; at least, right now. I'm just learning how to use this beast called flowstone because it's the most productive development environment I've ever had the chance to use in my life. It's so "straight-forward" that I didn't even need the documentation to create a complete synthesizer with it, for the first time.

By the way, regarding the syncronization, I made this VST using flowstone without ruby frame for sync, and it works with no important issues here.

TESTARP.zip
(2.11 MiB) Downloaded 801 times

It's got 2 arp/seq modes, arp notes indexes (as common arpeggiators) and chord mode for the sequencer, which studies the scales following scale mode rules (lidian, mixolidian, ...) as you can see in the figure:
screenshot.jpg
screenshot.jpg (110.96 KiB) Viewed 15960 times


Although it's not finished yet (because I have more works in progress), I hope you will enjoy the instrument and catch the idea. :idea: ;)