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

Int Array Help

For general discussion related FlowStone

Int Array Help

Postby TrojakEW » Sun Apr 26, 2015 5:56 pm

Hello guys. Can somebody help me with small problem? I need to swap values in integer arrays. I know ho to easilly do this in ruby but i need solution with green primitives since i dont want to use ruby at all.

I need this for module/effect ordering. So for example I have array with six integers 0,1,2,3,4,5 and i need to swap two choosen values. For example 0 with 3. I have tried to do it by myself but no good working soluton.
User avatar
TrojakEW
 
Posts: 111
Joined: Sat Dec 25, 2010 10:12 am
Location: Slovakia

Re: Int Array Help

Postby Exo » Sun Apr 26, 2015 7:10 pm

Inside the Developer toolkit in the Array section is a "Sort integer array" module, have a look at that it uses swapping to sort the array. Maybe you can learn from or modify it for your needs.
Flowstone Guru. Blog and download site for Flowstone.
Best VST Plugins. Initial Audio.
Exo
 
Posts: 426
Joined: Wed Aug 04, 2010 8:58 pm
Location: UK

Re: Int Array Help

Postby Youlean » Sun Apr 26, 2015 11:36 pm

Here you go...
Attachments
Swap.fsm
(433 Bytes) Downloaded 775 times
Youlean
 
Posts: 176
Joined: Mon Jun 09, 2014 2:49 pm

Re: Int Array Help

Postby TrojakEW » Mon Apr 27, 2015 7:21 am

Thanks you guys. I will check booth and see what is best for me.
User avatar
TrojakEW
 
Posts: 111
Joined: Sat Dec 25, 2010 10:12 am
Location: Slovakia

Re: Int Array Help

Postby TrojakEW » Tue Apr 28, 2015 9:07 pm

Well I found the same problem in booth version and in my own attempt too while swaping the array. Problem is when I want to use array from output again for another swap. Look in attached file - I used Yoleen example. Try to change index few time and you will see the problem. It will add same value to two indexes after 2 or more changes. How to fix that?
Attachments
Swap_loop.fsm
(488 Bytes) Downloaded 778 times
User avatar
TrojakEW
 
Posts: 111
Joined: Sat Dec 25, 2010 10:12 am
Location: Slovakia

Re: Int Array Help

Postby martinvicanek » Wed Apr 29, 2015 8:55 am

Hmm, perhaps a trigger order issue? Here is an alternative using code instead of green.
Attachments
SwapIntArray.fsm
(766 Bytes) Downloaded 810 times
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: Int Array Help

Postby Nubeat7 » Wed Apr 29, 2015 12:11 pm

here is a green version which should work correct
Attachments
Swap_array_elements_green.fsm
(578 Bytes) Downloaded 775 times
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: Int Array Help

Postby Youlean » Wed Apr 29, 2015 10:30 pm

This should work correctly now in loop.
Attachments
Swap V2.fsm
(486 Bytes) Downloaded 778 times
Youlean
 
Posts: 176
Joined: Mon Jun 09, 2014 2:49 pm

Re: Int Array Help

Postby TrojakEW » Thu Apr 30, 2015 10:26 am

Thanks. Going to test them today.
User avatar
TrojakEW
 
Posts: 111
Joined: Sat Dec 25, 2010 10:12 am
Location: Slovakia

Re: Int Array Help

Postby MyCo » Thu Apr 30, 2015 11:41 am

My version is quite similar to Nubeat7's...
Attachments
Swap (MyCo).fsm
(1.24 KiB) Downloaded 757 times
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Next

Return to General

Who is online

Users browsing this forum: No registered users and 89 guests