MUFF WIGGLER Forum Index

 FAQ & Terms of UseFAQ & Terms Of Use   Wiggler RadioMW Radio   Muff Wiggler Blog & NewsMW News   Muff Wiggler StoreMW Store 
 SearchSearch   RegisterSign up   Log inLog in 
WIGGLING 'LITE' IN GUEST MODE

RCD with longer divisions
MUFF WIGGLER Forum Index -> Eurorack Modules Goto page 1, 2, 3  Next [all]
Author RCD with longer divisions

bsmith

JP wrote:
4mspedals wrote:
Heh... OK with thedug's help I dove into github... started a repository here:

https://github.com/4ms/Clocker

Maybe we should move this discussion to the DIY forum?


Awesome ! This is going to be an adventure.

As I suspected SCM is much more complex than the RCD by a factor of pw0=8400,pw1=4200,pw2=2800,pw3=2200,pw4=1680,pw5=1400,pw7=1050;


That bit is one of the simpler easier to tinker with things in the scm code - the initial pulse width on the various outs.....


4mspedals

a fuzzy beacon wrote:
This is awesome. Just bought an RCD because of this thread. I want to try programming something more radical with it though nanners

I had a quick look at the code (and there is actually a lot of comments - very helpful thumbs up ) so if I understand correctly RCD (or SCM) can be seen as 2 CV inputs going through ADC, and same ADC converts additional CV inputs in the extensions?


Yeah, there's two CV inputs and a clock input. On the RCD the breakout pins are switches (digital inputs) and on the SCM they're mostly analog inputs (ADC). The ADC is set to read one input at a time by setting the ADMUX register


a scanner darkly

4mspedals wrote:
Yeah, there's two CV inputs and a clock input. On the RCD the breakout pins are switches (digital inputs) and on the SCM they're mostly analog inputs (ADC). The ADC is set to read one input at a time by setting the ADMUX register


RCD and SCM both use ATmega168 chip, right? So it has 8 channels that can be selected by ADMUX plus I saw this in the doc: "The analog input channel is selected by writing to the MUX bits in ADMUX. Any of the ADC input pins, as well as GND and a fixed bandgap voltage reference, can be selected as single ended inputs to the ADC" - that makes 10 inputs in total if I understood it correctly.

3 inputs are used for clock / rotate / reset on RCD and for clock / rotate / slip on SCM, that leaves 7 for extensions - what confused me was that SCM breakout got 8 inputs, but 2 of them are duplicates of SCM (rotate and slip).


4mspedals

Clock IN goes to PD2 which is a digital pin (not controlled by the ADC).

The mega168 has 6 ADC channels on pins PC0-PC5. In the SCM they are
PC5=Shuffle
PC4=Resync
PC3=Skip
PC2=PW
PC1=SLIP
PC0=ROTATE

On the RCD there's only one analog channel, just PC0=ROTATE. The rest are used digitally (on or off).
PC1=Reset and PC2-5 are the breakout switches.

Additionally, PD5 and PD4 go to the breakout header for "Fast x4" and MUTE on the SCM, and more breakout switches on the RCD.


JP

really wishing there was some way to test the code before burning it to the chip and testing. is there such a thing as an atmel emulator? or someway to run the code and test it by passing it fake triggers and seeing a log out for the triggers sent?


a scanner darkly

Thank you for detailed explanation - makes it easier to read the code as well! And sorry if that's too many questions but just want to make sure I understand correctly how it works...

Would it be correct to say that essentially breakouts provide access to PC0-PC5 (which can be treated as either analog or on/off values), so technically I could upload SCM code to RCD and use SCM breakout with it? Or is there a difference in how the breakout connector is wired? The reason I'm asking - I got RCD on the way and now thinking about getting SCM breakout as well as it will give me 2 switches and 6 inputs (5 of them attenuated) to play with.


4mspedals

JP wrote:
really wishing there was some way to test the code before burning it to the chip and testing. is there such a thing as an atmel emulator? or someway to run the code and test it by passing it fake triggers and seeing a log out for the triggers sent?


There is a simulator, but I never saw the point when I can just do it in real-time on my bench. You can burn and re-burn I think 100,000 times per chip! So no harm done in trying out a few dozen/hundred ideas in a day


4mspedals

a fuzzy beacon wrote:
Thank you for detailed explanation - makes it easier to read the code as well! And sorry if that's too many questions but just want to make sure I understand correctly how it works...

Would it be correct to say that essentially breakouts provide access to PC0-PC5 (which can be treated as either analog or on/off values), so technically I could upload SCM code to RCD and use SCM breakout with it? Or is there a difference in how the breakout connector is wired? The reason I'm asking - I got RCD on the way and now thinking about getting SCM breakout as well as it will give me 2 switches and 6 inputs (5 of them attenuated) to play with.


Essentially, yes, but the breakout header also has pins for +12V, GND, and PD4 and PD5 as I described above. Also one pin is a reference voltage for the switch of the Slip or Reset jack. In the SCM it's set at 2.5V (50% slippage), and in the RCD it's set at 0V

We snip the unused header pins off the breakout header for the RCD, so you'll have to solder those back to convert RCD->SCM. Also we jumpered/omitted the reference voltage resistors (470k's). Check out the RCD kit build guide manual, it details the differences between the two with photos:
http://www.4mspedals.com/clocker/kit/scmrcd_build_guide.pdf


(edit: corrected it to PD4 and PD5)


Monobass

Ooh I forgot about that tracking gate sequencer! Yes please!


bsmith

4mspedals wrote:
JP wrote:
really wishing there was some way to test the code before burning it to the chip and testing. is there such a thing as an atmel emulator? or someway to run the code and test it by passing it fake triggers and seeing a log out for the triggers sent?


There is a simulator, but I never saw the point when I can just do it in real-time on my bench. You can burn and re-burn I think 100,000 times per chip! So no harm done in trying out a few dozen/hundred ideas in a day


When I'm horsing around I don't even stop the clock going into it when sending changes. It kind of spazzes and goes hugghguhguugug for a sec then carries on with the changes when it's done after several seconds.


a scanner darkly

4mspedals wrote:
Essentially, yes, but the breakout header also has pins for +12V, GND, and PD4 and PD5 as I described above. Also one pin is a reference voltage for the switch of the Slip or Reset jack. In the SCM it's set at 2.5V (50% slippage), and in the RCD it's set at 0V

We snip the unused header pins off the breakout header for the RCD, so you'll have to solder those back to convert RCD->SCM. Also we jumpered/omitted the reference voltage resistors (470k's). Check out the RCD kit build guide manual, it details the differences between the two with photos:
http://www.4mspedals.com/clocker/kit/scmrcd_build_guide.pdf


(edit: corrected it to PD4 and PD5)


Ahh ok. Will probably get SCM and breakout as well at some point but want to experiment with programming RCD first. Want to try producing some delayed gates with it first (so like 8 tap gate delay thingy) which should be fairly straightforward. Even simply using it as an ADC converter should be interesting, running an LFO into one of the inputs and using gates as 8 bit binary representation of CV value, and then try and trigger TipTop drums with it.


JP

bsmith wrote:

When I'm horsing around I don't even stop the clock going into it when sending changes. It kind of spazzes and goes hugghguhguugug for a sec then carries on with the changes when it's done after several seconds.


You have it plugged into the synth whilst programming it? Crazy talk.


bsmith

it needs to be powered up anyway....


4mspedals

JP wrote:
bsmith wrote:

When I'm horsing around I don't even stop the clock going into it when sending changes. It kind of spazzes and goes hugghguhguugug for a sec then carries on with the changes when it's done after several seconds.


You have it plugged into the synth whilst programming it? Crazy talk.


Yeah I do the same... it make a delightful sound while programming


JP

a fuzzy beacon wrote:
Want to try producing some delayed gates with it first (so like 8 tap gate delay thingy) which should be fairly straightforward.


This is probably not what you mean, but this was what sprung into my head. So I'm adding it the the general brain storm pool of "crazy rcd ideas".

Gravity based trigger outs.

So trigger in, causes 8 outs (hell for starters lets just do trigger in causes out 1 to fire.

The out timing is based on those gravity calculations.

bang.......bang.....bang...bang..bang.bangbangbang

Once you have 1 out, it should be easy to make it all the outs fire, then tweak the math at each out so that gravity goes from moon to sun. That way you'd have 8 in sync starting points, and tailing off trigger repeats.

Clock in again, restarts the process.


a scanner darkly

Yeah that's exactly where I'm going with that one (and yes, just having a fixed delay at first or just a copy of clock in to out1 would be a great start smile)

I'm thinking, start with 8 triggers delayed by some arbitrary constant value first. Then use one of the CV inputs to control delay offset for each consecutive delay out, so at -5V each delay is twice as short as the previous one and at +5V it's twice as long. So then you vary the gravity effect with CV to be anything in between. Now imagine applying LFO to it nanners


JP

See this is why RCD is my new most favorite module EVER!

It's seems so simple, yet the possible output could be amazing.


mangobob

Here are some ideas I had for the RCD unused jumpers.. there are 2 free pins right?

Boot the module in Tracking Gate Sequencer (A-161 style) mode.. like another extra hidden module. I suppose you could also buy an extra unit or do a chip swap but this would be convenient.

Disable/enable internal divide by 6 to easily get your RCD synced to 24 ppqn clock sources (ie unrotated out1 = /6, out2 = /12, out3 = /18 etc). Breakout a dinsync cable to the Clock In and Reset jacks to sync up x0x boxes and have musical divisions. Seems like it would work in theory although the clock signal and RCD would still be running if you hit stop but should reset/sync upon starts?


JP

I love coding in a language I have zero experience.

Now I'm assuming the simple stuff should be well simple, after all C is supposed to be foundational.

So excusing my overly verbose and lazy code would something like this "work" if for my hello world, I just want a sequential step for each clock in?


Code:

   while(1){
      if (CLOCK_IN){
         clock_down=0;
         if (!clock_up){
            clock_up=1;//rising edge only                  
            ON(CLOCK_LED_PORT,CLOCK_LED_pin);

                if (i == 0) ON(OUT_PORT1, 0);
                if (i == 1) ON(OUT_PORT1, 1);
                if (i == 2) ON(OUT_PORT1, 2);
                if (i == 3) ON(OUT_PORT1, 3);
                if (i == 4) ON(OUT_PORT1, 4);
                if (i == 5) ON(OUT_PORT1, 5);
                if (i == 6) ON(OUT_PORT2, 7);
                if (i == 7){
                    ON(OUT_PORT2, 6);
                    //reset back to the beginning
                    i = 0;
                }else{
                    i++;
                }
         }
      }else{

         clock_up=0;
         if (!clock_down){
            clock_down=1;//rising edge only   
            OFF(CLOCK_LED_PORT,CLOCK_LED_pin);
                ALLOFF(OUT_PORT1,OUT_MASK1);
                ALLOFF(OUT_PORT2,OUT_MASK2);
         }
      }
   }   //endless loop


I was particularly intrigued by the port numbering and reference, 5 port 1's then 2 port 2's with a 7 and a 6?

programmer should arrive soon, then I can just test this.


4mspedals

JP wrote:

I was particularly intrigued by the port numbering and reference, 5 port 1's then 2 port 2's with a 7 and a 6?

programmer should arrive soon, then I can just test this.


Yes, it seems out of order, but that's how the PCB is wired. You have it correct: output jack /7 is ON(OUT_PORT2,7) and jack /8 is ON(OUT_PORT2,6). Then jacks /1 through /6 are ON(OUT_PORT1,0 to 5)

Looks like your code should work... on the rising edge it'll turn on the IN LED and also turn on one of the jacks (based on the value of i). Make i is initialized to 0 before the main loop. Then on the falling edge it'll turn everything off. So you'll have sequential trigger outputs.

PS I just added the Tracking Gate Sequencer code to the github:
https://github.com/4ms/Clocker/blob/master/TGS/clocker.c


JP

4mspedals wrote:
PS I just added the Tracking Gate Sequencer code to the github:
https://github.com/4ms/Clocker/blob/master/TGS/clocker.c


Oh I do like the utility function

Code:

inline void set_step(uint8_t step){

   if (step<=5) {
      ALLOFF(OUT_PORT2,OUT_MASK2);
      OUT_PORT1 |= (OUT_MASK1) & ~(1<<step);    //turn off all unmasked pins except the one we want to keep on
      ON(OUT_PORT1,step);         //make sure the one we want is on
   } else if (step==6){
      ALLOFF(OUT_PORT1,OUT_MASK1);
      OFF(OUT_PORT2,6);    //turn off #6 which is step==7
      ON(OUT_PORT2,7);   //make sure #7 is on (step==6)
   } else if (step==7){
      ALLOFF(OUT_PORT1,OUT_MASK1);
      OFF(OUT_PORT2,7);    //turn off #7 which is step==6
      ON(OUT_PORT2,6);   //make sure #6 is on (step==7)
   }

}


Am i correct that LED's on is the same as gate/trigger out? The two are connected yes?

So if this is a super simple clock based iteration, could you maybe post a barebones example of something that might be clock triggered for start, but after that the progression is independent to the clock, so say for example the tracking gate sequencer that tracks 8 outs per clock, so clock in, out, 1, 2, 3, 4, 5, 6, 7, 8, clock in, etc.


JP

3rd RCD kit just arrived. Am I better, from a flexibility when tinkering standpoint, wiring it as an RCD or an SCM?


ianross

I don't know what this thread is really about but i'm going to buy an RCD soon so if it can be boiled down to how it would affect creative RCD users do share : )


JP

I started a suggestion thread over here https://www.muffwiggler.com/forum/viewtopic.php?t=54221

Figured keep this one for technical discussion


a scanner darkly

Have you tried any simulators yet? Found this one:

http://www.oshonsoft.com/avr.html

I'll be away from my computer this weekend though so won't be able to try it until next week. Getting my RCD and programmer next week too so I might just try it on RCD.

MUFF WIGGLER Forum Index -> Eurorack Modules Goto page 1, 2, 3  Next [all]
Page 1 of 3
Powered by phpBB © phpBB Group