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

Ruby Script Midi Out Problem (For Random Output)

Post any examples or modules that you want to share here

Ruby Script Midi Out Problem (For Random Output)

Postby DSP-Robotron » Wed Aug 19, 2020 3:14 am

I'm trying to switch oscillators based on ruby random function and it's working but the sounds are ignoring the envelopes or something. I end up with sounds being switched but the notes are sustaining for way too long and creating an overlapping mess and also overloading the CPU. Can anybody solve this bug or at least explain why the gate is not working for the ADSR ? Thanks.

out = rand(0..2)
output out, @in

That's the code so far. Randomize numbers between 0 and 2 and then send the midi input to the output that has that number. Simple. Right ? I guess not. Because it's not doing it 100% properly or something.
Attachments
Wavestate Synth 0002.fsm
(47.24 KiB) Downloaded 92 times
Last edited by DSP-Robotron on Wed Aug 19, 2020 6:58 am, edited 1 time in total.
DSP-Robotron
 
Posts: 58
Joined: Tue Aug 18, 2020 3:39 am

Re: Ruby Script Midi Out Problem (For Random Output)

Postby DSP-Robotron » Wed Aug 19, 2020 3:38 am

This one works a bit better but it's only masking the problem.
Attachments
Wavestate Synth 0004.fsm
(47.18 KiB) Downloaded 91 times
DSP-Robotron
 
Posts: 58
Joined: Tue Aug 18, 2020 3:39 am

Re: Ruby Script Midi Out Problem (For Random Output)

Postby martinvicanek » Wed Aug 19, 2020 7:57 am

Try an ASIO driver instead of DS Out.
User avatar
martinvicanek
 
Posts: 1122
Joined: Sat Jun 22, 2013 8:28 pm

Re: Ruby Script Midi Out Problem (For Random Output)

Postby DSP-Robotron » Wed Aug 19, 2020 8:43 am

Here is a more advanced version of it if you guys want it but it still needs way more tone generators.
At least 8 samples or tones per Arpeggiator.
Now it has 2 of those.
It's still very buggy somehow because the CPU load is 10 times higher than what is supposed to be.
Attachments
Wavestate Synth 0005.fsm
(125 KiB) Downloaded 89 times
DSP-Robotron
 
Posts: 58
Joined: Tue Aug 18, 2020 3:39 am

Re: Ruby Script Midi Out Problem (For Random Output)

Postby tulamide » Wed Aug 19, 2020 1:58 pm

I'm surprised that nobody answered you already!

When a note is played, two midi massages will be sent. One at the start (a Note On message) and one, when the note has to end (a Note Off message).

You currently re-route any incoming message to a random output, which means that the Note Off that belongs to the Note On you re-routed to output 2 may be sent to output 3. Sometimes, that's the nature of randomness, the Note Off message arrives at the correct output. The result being that it sometimes works and sometimes not.

What you have to do is keeping track of every Note On message and the output, you sent it to. Then, when a matching Note Off arrives, look up where it needs to be send, and send it there, bypassing the randomization.

Note On and Note Off are not the only midi messages that are grouped. You also have to be careful with pitchbend messages, polyphonic aftertouch, channel pressure and system exclusives.
If you feel like gifting: https://paypal.me/tulamide
tulamide
 
Posts: 2384
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Ruby Script Midi Out Problem (For Random Output)

Postby DSP-Robotron » Wed Aug 19, 2020 2:15 pm

That's a very good point but how can I make sure the signals go to the correct target ?
Isn't it possible to just send notes off messages to everything/everywhere at the end of every arpeggio cycle ?
That would guarantee a good reset of each cycle.
DSP-Robotron
 
Posts: 58
Joined: Tue Aug 18, 2020 3:39 am

Re: Ruby Script Midi Out Problem (For Random Output)

Postby martinvicanek » Wed Aug 19, 2020 2:29 pm

As Tulamide says (and Spogg in another thread), the Note Off messages may go to the wrong output. A quick dirty hack would be to route Note Off messages generaly to all outputs - it would do no harm except for the extra processing load. But then still the other problems in Tulamide's response would remain. To do it right you would need some bookkeeping...

If all you want is a random timbre for each new note, you could do the assignment in the poly section thus avoiding extra instances of MIDI/Voices prims, ADSR modules, etc. You would also not waste GUI real estate. ;)
User avatar
martinvicanek
 
Posts: 1122
Joined: Sat Jun 22, 2013 8:28 pm

Re: Ruby Script Midi Out Problem (For Random Output)

Postby DSP-Robotron » Wed Aug 19, 2020 2:50 pm

I have no idea how the poly section works yet. The polyphony was set at 32 when I only need 1 or 3. Maybe some simplified example file would work better. I only need sample switching at each step in the most efficient way because the CPU load is pretty high already and the sustaining notes keep accumulating until it crashes.
DSP-Robotron
 
Posts: 58
Joined: Tue Aug 18, 2020 3:39 am

Re: Ruby Script Midi Out Problem (For Random Output)

Postby DSP-Robotron » Wed Aug 19, 2020 5:23 pm

This version seems to work better but is not using the samplers.
Attachments
3x OSC 3x Arp Basic Synth v003.fsm
(108.72 KiB) Downloaded 82 times
DSP-Robotron
 
Posts: 58
Joined: Tue Aug 18, 2020 3:39 am

Re: Ruby Script Midi Out Problem (For Random Output)

Postby DSP-Robotron » Thu Aug 20, 2020 12:59 am

Solved. I think.
I had to modify the Arp code but this version seems to work better.
Does anybody know how to make the Open button visible on the Wave Player ?
It's not allowing to load samples from the front panel.
Attachments
3x OSC 3x Arp Basic Synth v006.fsm
(122.9 KiB) Downloaded 87 times
DSP-Robotron
 
Posts: 58
Joined: Tue Aug 18, 2020 3:39 am

Next

Return to User Examples

Who is online

Users browsing this forum: Majestic-12 [Bot] and 21 guests

cron