Arduino, Atmega328, Grids, Edges, whats going on here?


Okay… So Atmega328 is a microcontroller. The one used on the Arduino, and the one used on Grids and Edges. This raises a somewhat obvious question, but I can’t find a clear answer anywhere… Can these modules translate to Arduino? What about Branches, with the Atmega88?
What’s the difference here?
I see the Arduino uses a 16mhz crystal and these modules use 20mhz, I’m sure that’s relevant, at least to Edges right? (Audio)
I guess I was hoping I could plug bits of the code into Arduino and learn relevant musical coding skills.
Please enlighten me, and take it easy on me, I just wanna learn!


To start with, Edges uses an AVR XMega, which is a different family of chips.

You can run Grids’ or Branches’ code on an Arduino board with a few changes to account for the different clock frequency.


If you like the Mutable Instruments aesthetic and want to learn about musical coding skills using ATMegas, I would recommend looking at the Shruthi, Anushri and Ambika: which all use ATMega microcontrollers I learned a lot (and am still learning!) from building these synths and reading through their code.


Oh geez, Edges is a differently thing entirely then, I misread the tiny schematic text!
So in the master folder for Grids, is there any one particular folder that contains the most magic?I’m sure I’ll have to go through all of them. But for example, if I wanted to learn… How you clock everything, the tempo knob, the clock input… It’s gotta be more complex than “Blink Without Delay.” But like it would be a useful thing to know how to apply elsewhere.
I believe you started with Arduino so I also wondered if you knew of some wealth of electronic music Arduino learning resource, as it’s also safe to say I may just be in over my head digging through your work.


I will also look at the diy synths you mentioned barnaby. I feel I grasp the hardware and building fairly well, but the magic inside the digital part is above and beyond me, but very inspiring in its capabilities.


I don’t do things Arduino style, so if you want to learn how to do things with Arduino boards… Learn using Arduino resources :slight_smile:


I guess I didn’t exactly understand there was an “Arduino style.” I just have an Arduino and saw it was the same microcontroller and thought all was aligned and that was all there was to it.
I now understand Arduino uses its own language, and that is translated to c by the arduino ide. I imagine you just write in c.
I apologize for my ignorance, I realize I’m trying to learn too much too fast.


That’s not quite true.

Arduino code is generally written in C or C++, just like @pichenettes uses.

Arduino provide a number of libraries (also largely written in C/C++) to make things like accessing the hardware easier, and these libraries have to be addressed in specific ways. That’s what @pichenettes means by “Arduino style”.

The Arduino IDE compiles your code (and any libraries that it depends on) into machine code that is specific to the target micro-controller.

@pichenettes doesn’t use the Arduino IDE or any of the Arduino libraries.

In some cases, he’s written equivalent libraries himself, and used them across several products.


Ahhhhh! Thanks for taking the time to break that down for me :pray:


I would say, learn with the Arduino resources first. They are generally quite easy to understand and there is a ton of help online. That will teach you a lot about the general principles of coding and the structures typically used. Once you feel comfortable with that, you can safely explore pichenettes code without the feeling of getting lost. Because his code is quite deep and complex to a beginner’s eye, especially with all the template magic.