Soulsby Synths Forum

Everything else => Everything else => Topic started by: charliesays on January 05, 2015, 05:29:01 PM

Title: Arduino basics
Post by: charliesays on January 05, 2015, 05:29:01 PM
General question on hacking - looks like there's quite a lot of resources for learning Arduino coding, any advice or pointers on getting started where it would be relevant to the Atmegatron? I've never used C or Arduino before but had some experience with SQL etc...
Thanks!
Title: Re: Arduino basics
Post by: paulsoulsby on January 06, 2015, 02:32:15 PM
There's probably 2 approaches if you don't know any C.
1)  Work from the ground up. 
Buy an Arduino Uno kit (e.g.http://store.arduino.cc/product/A000010 (http://store.arduino.cc/product/A000010) ) and then start to work through the examples, starting with Blink http://arduino.cc/en/Tutorial/HomePage (http://arduino.cc/en/Tutorial/HomePage).
As you get more and more use to Arduino and C, more and more of the Atmegatron projects will make sense.
This page is vital for understanding the basic C functions: ]http://arduino.cc/en/Reference/HomePage] (http://arduino.cc/en/Reference/HomePage).

2)  Reverse engineer the current Atmegatron projects. 
Start with simple things, e.g.  goto Waveforms tab and replace a waveform with your own.  They must be 32 samples long and only contain numbers from -128 to 127.
Then have a go at writing your own functions.  If you look at a simple function like Amplitude_Process (in Ampltiude tab), you'll see that the basic structure is:
Cycle through all 32 samples
Get the sample using: Wave_Get_Process(i)
manipulate sample
Return it using: Wave_Let_Process(i)
Then add your new function to Wave_Process() in Waveforms tab
If it has a parameter controlled by a control, do this in the Hardware tab.  Hardware_Let_Ctrl() for the knobs and Hardware_Adjust_Value() for the function/value dials.

You could try doing both methods 1 and 2 together as well!
Once you're confident with the programmer you'll probably want to move on to using Atmel Studio 6, rather than the Arduino software, as this makes navigating the code much easier.
Paul
Title: Re: Arduino basics
Post by: charliesays on January 06, 2015, 06:45:06 PM
Great, thanks for the advice, that's really helpful!