electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
go to the radio page Live at electro-music.com radio 1 Please visit the chat
poster
 Forum index » Clavia Nord Modular » G2 FAQ
n-inputs/n-outputs randomizer setup
Post new topic   Reply to topic Moderators: Nord Modular Editors
Page 1 of 1 [22 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
audible



Joined: Jun 03, 2007
Posts: 9
Location: BCN08036
G2 patch files: 1

PostPosted: Sun Jun 03, 2007 4:59 pm    Post subject: n-inputs/n-outputs randomizer setup
Subject description: Big noob, please help
Reply with quote  Mark this post and the followings unread

I'm sort of new to modular thinking... Steep learning curve, but I'm eager to improve. Can anybody tell me which modules I need to achieve this?

I'd like to have a setup with n inputs (control signals) connected to n outputs. At the clicking of a switch, the outputs would interchange at random.

Maybe a diagram shall clarify it...

Thanks!


randomizer_n.JPG
 Description:
 Filesize:  6.62 KB
 Viewed:  42859 Time(s)

randomizer_n.JPG


Back to top
View user's profile Send private message
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24075
Location: The Netherlands, Enschede
Audio files: 277
G2 patch files: 320

PostPosted: Sun Jun 03, 2007 5:12 pm    Post subject: Reply with quote  Mark this post and the followings unread

welcome audible.

I can't patch right now ... hope to think on it later ... when nothing happens here please remind me in a few days.

It should take a couple of multiplexers and demultiplexers and some adding of constants to a random signal and a modulo circuit, or something like that. Might get out of control for large N ... in terms of resource usage ...

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24075
Location: The Netherlands, Enschede
Audio files: 277
G2 patch files: 320

PostPosted: Mon Jun 04, 2007 1:25 pm    Post subject: Reply with quote  Mark this post and the followings unread

Not so easy Very Happy

I can make a random shifter like thing ... everything I come up with for more complicated permutations gets way out of control for module usage.

Anyway, here is the shifter, and that's pretty expensive already.


rs-002.pch2
 Description:
control signal shifter

Download
 Filename:  rs-002.pch2
 Filesize:  2.98 KB
 Downloaded:  2356 Time(s)


_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
ian-s



Joined: Apr 01, 2004
Posts: 2669
Location: Auckland, New Zealand
Audio files: 42
G2 patch files: 626

PostPosted: Mon Jun 04, 2007 3:04 pm    Post subject: Reply with quote  Mark this post and the followings unread

Do the connections need to be 1:1 exclusive?
Back to top
View user's profile Send private message
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24075
Location: The Netherlands, Enschede
Audio files: 277
G2 patch files: 320

PostPosted: Mon Jun 04, 2007 3:08 pm    Post subject: Reply with quote  Mark this post and the followings unread

g2ian wrote:
Do the connections need to be 1:1 exclusive?


That's what I assumed, I broke my head on exclusion stuff Very Happy

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
iPassenger



Joined: Jan 27, 2007
Posts: 1067
Location: Sheffield, UK
Audio files: 5
G2 patch files: 78

PostPosted: Tue Jun 05, 2007 12:56 am    Post subject: Reply with quote  Mark this post and the followings unread

It does seem that the exclusivity is the problem (it forces the need for increased control over the random element), unless you can find a way that doesn't use MUXs at all?

Seems a lot more difficult than you might imagine.

_________________
iP (Ross)
- http://ipassenger.bandcamp.com
- http://soundcloud.com/ipassenger
Back to top
View user's profile Send private message Visit poster's website
Antimon



Joined: Jan 18, 2005
Posts: 4145
Location: Sweden
Audio files: 371
G2 patch files: 100

PostPosted: Tue Jun 05, 2007 8:14 am    Post subject: Reply with quote  Mark this post and the followings unread

Try this. it's a lot of little 2-2 switches. It needs a sample/hold in there, but you get the idea. For better scrambling, add more columns (have to catch the bus, if you need more info, ask).

/Stefan


sbt_shufflepatch.pch2
 Description:

Download
 Filename:  sbt_shufflepatch.pch2
 Filesize:  4.82 KB
 Downloaded:  1950 Time(s)


_________________
Antimon's Window
@soundcloud @Flattr home - you can't explain music
Back to top
View user's profile Send private message Visit poster's website
Antimon



Joined: Jan 18, 2005
Posts: 4145
Location: Sweden
Audio files: 371
G2 patch files: 100

PostPosted: Tue Jun 05, 2007 11:34 am    Post subject: Reply with quote  Mark this post and the followings unread

OK, I updated the patch to shuffle 8 inputs, and attached a little sketch showing the principle. Note that although in the new patch (the old was a little buggy) e.g. input 1 may be routed to any output, there is a greater chance that it will be routed to output 1 or 2, since there are more paths to those outputs than the others. Maybe the switching can be tweaked so the spread is more even?

As can be seen in the sketch, only three columns are needed for six inputs, and two columns for four inputs. Also note that I only used the muxes here to show the values visually, when using this replace the constant modules with input, and the muxes with output.

Still a little bit cheaper than Jan's version on the cycle side, I think, although bigger and consuming more memory. Another downside is that I don't know how to reshuffle without having a short moment where all inputs are routed directly to the outputs (random triggers only stay up as long as there is a live value at the Clk input).

This is fun! Very Happy

/Stefan


Bild 21.jpg
 Description:
Switch illustrations: 8 to 8, 6 to 6 and 4 to 4
 Filesize:  64.07 KB
 Viewed:  839 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

Bild 21.jpg



sbt_shufflepatch_8.pch2
 Description:
8 to 8 shuffle

Download
 Filename:  sbt_shufflepatch_8.pch2
 Filesize:  4.67 KB
 Downloaded:  2045 Time(s)


_________________
Antimon's Window
@soundcloud @Flattr home - you can't explain music

Last edited by Antimon on Wed Aug 22, 2007 11:08 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24075
Location: The Netherlands, Enschede
Audio files: 277
G2 patch files: 320

PostPosted: Tue Jun 05, 2007 2:18 pm    Post subject: Reply with quote  Mark this post and the followings unread

Antimon wrote:
This is fun! Very Happy


Maddening Twisted Evil

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
3phase



Joined: Jul 27, 2004
Posts: 1183
Location: Berlin
Audio files: 13
G2 patch files: 141

PostPosted: Tue Jun 05, 2007 3:36 pm    Post subject: Reply with quote  Mark this post and the followings unread

a primitiv solution for only 3 input and no propper random...
bit its the cheap and dirty way when oly 3 inputs are enough


rando rout 3.pch2
 Description:

Download
 Filename:  rando rout 3.pch2
 Filesize:  2.06 KB
 Downloaded:  1676 Time(s)

Back to top
View user's profile Send private message Send e-mail Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24075
Location: The Netherlands, Enschede
Audio files: 277
G2 patch files: 320

PostPosted: Sat Jun 09, 2007 7:24 am    Post subject: Reply with quote  Mark this post and the followings unread

A bit late, but looking at some notes still laying on my desk I came to realize that this actually is equivalent to a basic programming exercise ... how to place eight queens on a chess board in such a way that they can't capture each other.

Usually this is solved using (recursive) backtracking, i.e try something and when it fails roll back and try something else, repeat until completed or failed.

There is a straightforward solution as well, pick any crossing you'd like to start with and then move 2 steps either horizontal or vertical followed by one step vertical or horizontal, in chess terms: the way the knight moves.

Not that this brings a solution in the form an actual patch any closer, but thought it to be interesting nevertheless.

Alse see http://en.wikipedia.org/wiki/Eight_queens_puzzle

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
Falk



Joined: Mar 07, 2006
Posts: 75
Location: Sweden
G2 patch files: 29

PostPosted: Sat Jun 09, 2007 10:49 am    Post subject: Better version
Subject description: Lower CPU and memory usage for permutation of 8 signals
Reply with quote  Mark this post and the followings unread

Hello audible and everyone.

I took Antimons patch and optimized it a bit.

I knew that computer science degree would come in handy some day Very Happy

/Falk


falk_shuffle8.pch2
 Description:
A random permutation of 8 signals

Download
 Filename:  falk_shuffle8.pch2
 Filesize:  3.42 KB
 Downloaded:  1361 Time(s)

Back to top
View user's profile Send private message
Antimon



Joined: Jan 18, 2005
Posts: 4145
Location: Sweden
Audio files: 371
G2 patch files: 100

PostPosted: Sun Jun 10, 2007 9:41 am    Post subject: Re: Better version
Subject description: Lower CPU and memory usage for permutation of 8 signals
Reply with quote  Mark this post and the followings unread

Falk wrote:
Hello audible and everyone.

I took Antimons patch and optimized it a bit.

I knew that computer science degree would come in handy some day Very Happy

/Falk


Clever! Very Happy I keep forgetting about the usefulness of the inverter.

Value Switch 2-1: D'oh! I should try to learn about all of the modules.

Thanks.

/Stefan

_________________
Antimon's Window
@soundcloud @Flattr home - you can't explain music
Back to top
View user's profile Send private message Visit poster's website
audible



Joined: Jun 03, 2007
Posts: 9
Location: BCN08036
G2 patch files: 1

PostPosted: Sun Jun 10, 2007 2:34 pm    Post subject: Reply with quote  Mark this post and the followings unread

Thanks for all the answers, I thought this would be easier...

Though a couple of the previous patches seem to work with what I was planning, I fail to fully understand any of them... As stated above, I'm a noob but I hope someone else might find all this useful and worth of study.

It's great to provide a good source of head-scratching to you all...
Back to top
View user's profile Send private message
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24075
Location: The Netherlands, Enschede
Audio files: 277
G2 patch files: 320

PostPosted: Sun Jun 10, 2007 2:38 pm    Post subject: Reply with quote  Mark this post and the followings unread

audible wrote:
It's great to provide a good source of head-scratching to you all...


Laughing got any more of those ?

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
Falk



Joined: Mar 07, 2006
Posts: 75
Location: Sweden
G2 patch files: 29

PostPosted: Wed Jun 13, 2007 12:44 pm    Post subject: New try, and this a puzzler Reply with quote  Mark this post and the followings unread

Blue Hell wrote:
audible wrote:
It's great to provide a good source of head-scratching to you all...


Laughing got any more of those ?


You can always ponder the use of the NOR gate in this patch.

It is an 8-in/8-out shuffle that can be also be repatched to work as 7/7 down to 3/3 (old patch can only be 2/2, 4/4, 8/8, 16/16 etc)

It is a 0.5% cheeper in CPU and does not rise in CPU usage if audio rate inputs are used (unlike old patch where CPU goes up).

The Injector feeds the shift registers with 8 values that will each select a different input on the Mux8-1 Out N modules. The order is then incrementally scrambled by the clocked random module (Mix source).

Con: Can not be expanded above 8/8
Con: Before you press the sample button, all outputs come from input 1
Con: You can't really clock the sample button faster than 31.25 Hz (if I got the math right) and still expect a really random shuffle. Laughing

Enjoy
/Falk


falk_shuffle_8_v2.pch2
 Description:
8-in/8-out shuffle based on shift registers

Download
 Filename:  falk_shuffle_8_v2.pch2
 Filesize:  1.99 KB
 Downloaded:  1426 Time(s)

Back to top
View user's profile Send private message
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24075
Location: The Netherlands, Enschede
Audio files: 277
G2 patch files: 320

PostPosted: Wed Jun 13, 2007 2:02 pm    Post subject: Re: New try, and this a puzzler Reply with quote  Mark this post and the followings unread

Falk wrote:
You can always ponder the use of the NOR gate in this patch.


I'm afraid I could use a little help Very Happy

It seems to work, and it seems to work by using a counter who's value is shifted around, and so the values will be unique, and then my breathing stops and my head spins and I have to start all over again.

The NOR makes for an oscillator that can be started and stopped at will, but how does it interact ...

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
Falk



Joined: Mar 07, 2006
Posts: 75
Location: Sweden
G2 patch files: 29

PostPosted: Thu Jun 14, 2007 3:54 am    Post subject: Re: New try, and this a puzzler Reply with quote  Mark this post and the followings unread

Blue Hell wrote:

I'm afraid I could use a little help Very Happy

It seems to work, and it seems to work by using a counter who's value is shifted around, and so the values will be unique, and then my breathing stops and my head spins and I have to start all over again.

The NOR makes for an oscillator that can be started and stopped at will, but how does it interact ...


Hello Blue.

For things to work correctly with all this shifting, feedback and S&H I needed 3 rising flanks in one clock cycle.

Clock, inverted clock and the deep magic, the NOR gate with feedback.

Are you traveling on the path of enlightenment yet?

/Falk

PS. Once I get home from work I'll post a more verbose explanation. DS
Back to top
View user's profile Send private message
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24075
Location: The Netherlands, Enschede
Audio files: 277
G2 patch files: 320

PostPosted: Thu Jun 14, 2007 5:36 am    Post subject: Re: New try, and this a puzzler Reply with quote  Mark this post and the followings unread

Falk wrote:
Are you traveling on the path of enlightenment yet?


Only in the sense that I can see where the number 3 comes from, not what it is good for thinking

It would maybe help when I wouldn't be supposed to be working Laughing

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
Falk



Joined: Mar 07, 2006
Posts: 75
Location: Sweden
G2 patch files: 29

PostPosted: Thu Jun 14, 2007 11:51 am    Post subject: Re: New try, and this a puzzler Reply with quote  Mark this post and the followings unread

Blue Hell wrote:
Falk wrote:
Are you traveling on the path of enlightenment yet?


Only in the sense that I can see where the number 3 comes from, not what it is good for thinking

It would maybe help when I wouldn't be supposed to be working Laughing


Hello Blue.

I have added a manually clocked version that shows what is in the shift registers without having to sample it. As is, it doesn't perform any mixing operations.

Once you understand how the injector and the shuffle works, move the connector from the Seed input of the Mix Source and insert it into the empty socket on the AND gate.

Add a new module and remove it again to ensure that the patch is recompiled and then see how the random signal affects the shift registers.

Now, the NOR gate. As I said, this patch needs three rising flanks during each clock cycle. They need to be in a specific order and they must not be simultaneous.

First the injector and the shift registers needs to be clocked. Then the Mix Source needs to be clocked. Thirdly the S&H 1-2 and S&H 3-8 needs to be triggered.

Because we do not know how the Clavia patch compiler splits the signal/logic workload in 4 pieces it is possible that piece 1 use an output from piece 2, piece 2 change its output and piece 3 use the 'same' output from piece 2 but now piece 1 and 3 have different opinions on what that value is even though it looks like the same wire on screen.

The magic of the NOR gate is that when the input is high/true the output is low/false. When the input goes low, the output starts to oscillate at 12 kHz. This is due to the feedback from the output to the other input. Because of the feedback, it doesn't start until the next 24 kHz clock cycle.

Thus, 3 rising flanks from one clock, the clock itself, the inverted clock and the NOR gate that produces a 12 kHz clock burst one 24 kHz clock cycle after the inverted clock.

The S&H modules doesn't care if they are triggered multiple times as long as the pulse train stops before the input changes its value.

That wasn't so hard was it? Wink

Oh, I have also managed to remove 2 modules from the Injector Twisted Evil

The picure hopefully helps to visualize the mixing of the shift registers.

/Falk


Shuffle&Mix.PNG
 Description:
An illustration of how the random mixing works
 Filesize:  2.77 KB
 Viewed:  42577 Time(s)

Shuffle&Mix.PNG



DemoShuffleMix8.pch2
 Description:
A manually clocked Shift&Mix 8-in/8-out shuffle with shift registers

Download
 Filename:  DemoShuffleMix8.pch2
 Filesize:  1.71 KB
 Downloaded:  1423 Time(s)

Back to top
View user's profile Send private message
Falk



Joined: Mar 07, 2006
Posts: 75
Location: Sweden
G2 patch files: 29

PostPosted: Fri Jun 15, 2007 12:42 pm    Post subject: Just showing off.......
Subject description: Even more optimized
Reply with quote  Mark this post and the followings unread

My computer science background is really showing off tonight..... Embarassed

I managed to get rid of one of the shift registers and the injector is finishes in 7 steps, not 8.

20% CPU and 30.5% memory compared to 20.8% CPU and 36.7% memory of the previous version (the earlier sbt_shufflepatch_8_falk.pch2 used 21.3% CPU and 39.1% memory).


falk_shuffle_8_v3.pch2
 Description:

Download
 Filename:  falk_shuffle_8_v3.pch2
 Filesize:  1.83 KB
 Downloaded:  1399 Time(s)

Back to top
View user's profile Send private message
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24075
Location: The Netherlands, Enschede
Audio files: 277
G2 patch files: 320

PostPosted: Sat Jun 16, 2007 6:33 am    Post subject: Reply with quote  Mark this post and the followings unread

Sorry for not having found time yet to go on with/into this - got some time consuming other things.

I saw this was posted as a building block - it seemed appropriate to link it from here : http://electro-music.com/forum/post-124787.html

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: Nord Modular Editors
Page 1 of 1 [22 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » Clavia Nord Modular » G2 FAQ
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use