| View previous topic :: View next topic |
| Author |
RCD with longer divisions |
bsmith Super Deluxe Wiggler
Joined: 07 Jan 2010 Last Visit: 21 May 2013
   Posts: 2342 Location: Dallas
|
Posted: Tue Feb 28, 2012 2:59 pm Post subject: |
 |
|
|
| 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..... _________________ Soundcloud | Twitter | epicurean.com |
|
| Back to top |
|
 |
4mspedals Wiggling with Experience
Joined: 21 Jul 2009 Last Visit: 20 May 2013
   Posts: 383 Location: Portland, OR
|
Posted: Wed Feb 29, 2012 12:26 pm Post subject: |
 |
|
|
| 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
I had a quick look at the code (and there is actually a lot of comments - very helpful ) 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 |
|
| Back to top |
|
 |
a scanner darkly a fuzzy beacon
Joined: 16 Nov 2011 Last Visit: 21 May 2013
 Posts: 798 Location: Vancouver • Seattle
|
Posted: Wed Feb 29, 2012 1:06 pm Post subject: |
 |
|
|
| 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). _________________ music • dj mixes • eurorack video tutorials • bug |
|
| Back to top |
|
 |
4mspedals Wiggling with Experience
Joined: 21 Jul 2009 Last Visit: 20 May 2013
   Posts: 383 Location: Portland, OR
|
Posted: Wed Feb 29, 2012 1:20 pm Post subject: |
 |
|
|
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. |
|
| Back to top |
|
 |
JP Super Deluxe Wiggler
Joined: 07 Jan 2010 Last Visit: 29 Jan 2013
   Posts: 1084 Location: NJ
|
Posted: Wed Feb 29, 2012 1:45 pm Post subject: |
 |
|
|
| 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? |
|
| Back to top |
|
 |
a scanner darkly a fuzzy beacon
Joined: 16 Nov 2011 Last Visit: 21 May 2013
 Posts: 798 Location: Vancouver • Seattle
|
Posted: Wed Feb 29, 2012 1:46 pm Post subject: |
 |
|
|
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. _________________ music • dj mixes • eurorack video tutorials • bug |
|
| Back to top |
|
 |
4mspedals Wiggling with Experience
Joined: 21 Jul 2009 Last Visit: 20 May 2013
   Posts: 383 Location: Portland, OR
|
Posted: Wed Feb 29, 2012 1:55 pm Post subject: |
 |
|
|
| 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 |
|
| Back to top |
|
 |
4mspedals Wiggling with Experience
Joined: 21 Jul 2009 Last Visit: 20 May 2013
   Posts: 383 Location: Portland, OR
|
Posted: Wed Feb 29, 2012 1:59 pm Post subject: |
 |
|
|
| 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) |
|
| Back to top |
|
 |
Monobass thonk.co.uk
Joined: 29 May 2009 Last Visit: 21 May 2013
   Posts: 6516 Location: Brighton, UK
| |
| Back to top |
|
 |
bsmith Super Deluxe Wiggler
Joined: 07 Jan 2010 Last Visit: 21 May 2013
   Posts: 2342 Location: Dallas
|
Posted: Wed Feb 29, 2012 5:19 pm Post subject: |
 |
|
|
| 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. _________________ Soundcloud | Twitter | epicurean.com |
|
| Back to top |
|
 |
a scanner darkly a fuzzy beacon
Joined: 16 Nov 2011 Last Visit: 21 May 2013
 Posts: 798 Location: Vancouver • Seattle
|
Posted: Wed Feb 29, 2012 5:24 pm Post subject: |
 |
|
|
| 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. _________________ music • dj mixes • eurorack video tutorials • bug |
|
| Back to top |
|
 |
JP Super Deluxe Wiggler
Joined: 07 Jan 2010 Last Visit: 29 Jan 2013
   Posts: 1084 Location: NJ
|
Posted: Wed Feb 29, 2012 5:45 pm Post subject: |
 |
|
|
| 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. |
|
| Back to top |
|
 |
bsmith Super Deluxe Wiggler
Joined: 07 Jan 2010 Last Visit: 21 May 2013
   Posts: 2342 Location: Dallas
| |
| Back to top |
|
 |
4mspedals Wiggling with Experience
Joined: 21 Jul 2009 Last Visit: 20 May 2013
   Posts: 383 Location: Portland, OR
|
Posted: Wed Feb 29, 2012 5:47 pm Post subject: |
 |
|
|
| 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 |
|
| Back to top |
|
 |
JP Super Deluxe Wiggler
Joined: 07 Jan 2010 Last Visit: 29 Jan 2013
   Posts: 1084 Location: NJ
|
Posted: Wed Feb 29, 2012 5:50 pm Post subject: |
 |
|
|
| 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. |
|
| Back to top |
|
 |
a scanner darkly a fuzzy beacon
Joined: 16 Nov 2011 Last Visit: 21 May 2013
 Posts: 798 Location: Vancouver • Seattle
|
Posted: Wed Feb 29, 2012 6:02 pm Post subject: |
 |
|
|
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 )
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  _________________ music • dj mixes • eurorack video tutorials • bug |
|
| Back to top |
|
 |
JP Super Deluxe Wiggler
Joined: 07 Jan 2010 Last Visit: 29 Jan 2013
   Posts: 1084 Location: NJ
|
Posted: Wed Feb 29, 2012 6:13 pm Post subject: |
 |
|
|
See this is why RCD is my new most favorite module EVER!
It's seems so simple, yet the possible output could be amazing. |
|
| Back to top |
|
 |
mangobob Wiggling with Experience
Joined: 23 Jan 2011 Last Visit: 21 May 2013
  Posts: 256
|
Posted: Wed Feb 29, 2012 8:31 pm Post subject: |
 |
|
|
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? |
|
| Back to top |
|
 |
JP Super Deluxe Wiggler
Joined: 07 Jan 2010 Last Visit: 29 Jan 2013
   Posts: 1084 Location: NJ
|
Posted: Wed Feb 29, 2012 11:58 pm Post subject: |
 |
|
|
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. |
|
| Back to top |
|
 |
4mspedals Wiggling with Experience
Joined: 21 Jul 2009 Last Visit: 20 May 2013
   Posts: 383 Location: Portland, OR
|
Posted: Thu Mar 01, 2012 12:34 pm Post subject: |
 |
|
|
| 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 |
|
| Back to top |
|
 |
|