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

Drum Patterns Randomizer

For general discussion related FlowStone

Drum Patterns Randomizer

Postby aefa » Wed Dec 21, 2022 9:21 am

Hello everyone!
First off, I want to thank the community for all the help they provide at any given time.
After so many years of trial and error I've finished something that is useful to me and (though not perfect nor unique) I hope it would be useful to someone else.
I said earlier "many years" because every approach I would take led to a new challenge that needed more learning :D but, by the Grace of Heaven, I manage to build it (almost) from scratch in two days!! (self-standing ovation)

This is a simple midi vst to be used with a VSTi that supports pattern triggers, like Groove Agent or BFD.
It randomized the pattern variations with a single trigger to simulate a live player (BFD has this function but didn't work the way I wanted)

Would have been ideal to build the midi patterns in the vst instead of relying on other vsti but I can't wrap my head around that midilib for ruby :oops:

Any critic and/or improvement in functionality or visually would be welcome! :D
Attachments
AFR.fsm
(100.5 KiB) Downloaded 352 times
aefa
 
Posts: 48
Joined: Wed Mar 26, 2014 12:52 pm

Re: Drum Patterns Randomizer

Postby aefa » Wed Dec 21, 2022 5:10 pm

Hi! There is a bug that makes the note stick after a fill. Doesn't happen all the time but it happens. I'll repost when I figure it out (or someone does before me) ;)
aefa
 
Posts: 48
Joined: Wed Mar 26, 2014 12:52 pm

Re: Drum Patterns Randomizer

Postby aefa » Thu Dec 22, 2022 9:19 am

Tested With BFD3 in FL Studio! So far so good...
What I'm not too happy with, is the fact that picking random from an array (in ruby) usually brings up the same values :?: Very noticeable with the fills.
Attachments
AFR_r1.fsm
(102.07 KiB) Downloaded 369 times
aefa
 
Posts: 48
Joined: Wed Mar 26, 2014 12:52 pm

Re: Drum Patterns Randomizer

Postby martinvicanek » Sat Dec 24, 2022 11:13 am

Unfortunately I know neither Groove Agent nor BFD, so I do not quite understand what exactly your device is supposed to do. Forgive my ignorance. :oops: I can see the work that has gone into building it, and it looks well organized and pretty. :)

It may be a stupid comment, but can't you create a new random sequence every time you need one instead of reading it from a (precomputed?) array? You could optionally use a time based seed, so there would never be any repetitions.
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: Drum Patterns Randomizer

Postby tulamide » Sat Dec 24, 2022 4:19 pm

Thanks Martin, for bringing my attention to this.

aefa, I looked at the Ruby part of your schematic.

1. MIDI Note Status 144
This is not just Note On. There is a mechanism called running status, in which midi messages are interpreted as belonging to the last status sent. This requires that a note off has to be sent to the last status. In case of 144 (normally Note On), this is an issue. So it was decided officially by the MIDI association, that 144 with a velocity of 0 is to be interpreted as 128 witch a velocity of 64. In other words, 144 + vel 0 = Note Off
You have to catch this exception (by checking if velocity is not 0, and executing the note off bits of your code, if it is), before running the rest of your code.

2. Midi message to array
Not really needed. The Midi class contains all methods to access all parts of a midi message. Instead of @inMidi = v.to_array and the following handling of the array, you can just call v.status, v.channel, v.data1 and v.data2

3. Event handling
Very severe issue! You don't check, which input caused the event method to run. But you access v. That means, if an incoming nPoolA caused the event method to trigger, v will not be a midi message, but an array. You then convert v.to_a, which leaves the array untouched and then perform midi interpretation on an array that has unrelated numbers (in case of nPoolA key numbers). Results are unpredictable. Worst case would be a crash of the other plugin or even the DAW. Best case would be just ignored messages.

4. Shuffling
While using shuffle is a legitimate tool for randomness, you implemented it a bit cumbersome. I won't comment on your question about same values showing up. This is most likely caused by point 3 of my list. Shuffle does shuffle everytime it is called. Of course, if there are only 2 elements in the array, the chance of the same order re-appearing is very high. And that's the case for any random algorithm in the world.
Another way, that might be a little faster in execution is not to shuffle the whole array, but to sample it. Arrays have the method sample, so myArray.sample will pick a random value from the array, without the work done by re-arranging a complete array. Instead of
return @notes.find_index(nP.shuffle.first)
try this
return @notes.find_index(nP.sample)

I hope this helps you.
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Drum Patterns Randomizer

Postby aefa » Mon Dec 26, 2022 6:35 am

martinvicanek wrote:Unfortunately I know neither Groove Agent nor BFD, so I do not quite understand what exactly your device is supposed to do. Forgive my ignorance. :oops: I can see the work that has gone into building it, and it looks well organized and pretty. :)

It may be a stupid comment, but can't you create a new random sequence every time you need one instead of reading it from a (precomputed?) array? You could optionally use a time based seed, so there would never be any repetitions.


There are never stupid comments! (I'm defending myself ;) ) Idealy, I would have like to make it so I can make a pool of midi sequences, either manually or importing them from file, into parts (A,B,C,F) but I suck at programming! :oops: That is why I have to rely on vsti that implement triggered grooves. For example Addictive Drums has grooves but doesn't support triggering. My idea is to avoid making a variations of a pattern and hardcode them in the project. By randomizing the patterns it sounds more fluid (to my ears) and different every time (like a live performer)
aefa
 
Posts: 48
Joined: Wed Mar 26, 2014 12:52 pm

Re: Drum Patterns Randomizer

Postby aefa » Mon Dec 26, 2022 6:46 am

tulamide! Thank you very much for your assessment! I don't understand half of the issues you pointed but I'll definitely go through your points and try and sort it out. Indeed I see these problems happen specially when triggering the fill because that is the one that tends to stay on after the trigger. I've been trying to recreate all this using mostly primitives because my ruby mastery amounts to googling what I need to do at the moment :? I'll keep updating my progress (if any)
aefa
 
Posts: 48
Joined: Wed Mar 26, 2014 12:52 pm

Re: Drum Patterns Randomizer

Postby aefa » Mon Dec 26, 2022 6:51 am

The music I make is Latin and Caribbean, which rely heavily on percussion. When the percs have hardcoded patterns it sounds monotone and boring. I don't know if the forum allows for video posting so I could upload a visual of how I intend to use this.
aefa
 
Posts: 48
Joined: Wed Mar 26, 2014 12:52 pm

Re: Drum Patterns Randomizer

Postby Spogg » Mon Dec 26, 2022 8:29 am

aefa wrote: ... I don't know if the forum allows for video posting so I could upload a visual of how I intend to use this.


You could upload the video to YouTube and make it private then share the link here…
User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: Drum Patterns Randomizer

Postby aefa » Mon Dec 26, 2022 9:48 am

Spogg wrote:You could upload the video to YouTube and make it private then share the link here…

Thank you Spogg. I'll do that!
aefa
 
Posts: 48
Joined: Wed Mar 26, 2014 12:52 pm


Return to General

Who is online

Users browsing this forum: No registered users and 109 guests