Auduino and onwards…

My SparkFun components arrived… taking 9 days from order in the US… but since I thought I’d build Dave Mee an Auduino as a thank you for lending me his Arduino kit I bought some additional 4.7k linear rotary pots, knobs and an audio jack socket from Maplin for an equitable £9.95 in the interim. They’re chunkier – but chassis fitting.

Auduino_workbench_500px-2010-06-26-07-32.jpg

So I had a good day at Fablab Manchester on Friday…

  • albeit a slightly late start due to feverishly reworking my Illustrator templates for the Color Kinetics iColor Flex SLX mounting frame I’m making using their laser cutter. Since a first test cut a couple of weeks ago and experimentation with various glues I’ve refined the template to account for the .1mm of material lost by the laser and designed a ‘push fit’ no glue required design – which with a bit of a squeeze – actually a rubber mallet – and a somewhat surprising acrylic ‘creak’ seems to have done the job. Now I need to mount the iColor_Flex_SLX domes in it and attached the back. My Super DMX Shield should be in the post from Daniel Hirschmann… so I’m hoping to start playing with this very shortly – yeaahhh. I also need to document this project for Fablab too.
  • Following the Soldering Basics tutorial on SparkFun and using the decent soldering iron, magnifier/light and third-arm tool I managed to successfully add permanent cables to my new 2” .5W 8Ohm speaker and solder up the audio jack socket to it’s breakout board, the wiichuck adaptor (though upside down I realised later) and the WingShield Industries ScrewShield – learning not to tighten the third-arm tool too tightly and to look more carefully at the assembly instructions in the process…
  • After a bit of head-scratching I managed to get the audio jack socket to work with the Auduino – not using the ‘tip’ and ‘ring’ connections as I expected but the ‘tip shunt’ and ‘ring shunt’ instead – the Wikidpedia TRS Connector entry helped…

Once back home I started to look through, test and add my own comments into the various Auduino sketches… working out the core code and added functionality. The ‘vanilla’ auduino_v5.pde sketch runs fine… so I then tried using Olav’s Auduino with Nunchuck input code auduino_v5_nunchuck.pde – and got it working eventually, but only after a bit of a backwards trawl through Tod E. Kurt a.k.a. Todbot’s downloadable zip file of his “little Nunchuck library for Arduino and demo” at “WiiChuck” Wii Nunchuck Adapter Available. Soldering the Wiichuck adaptor upside down didn’t help…

As an aside – while browsing Tod’s generally interesting blog I noted some particularly relevant posts – the Bionic Arduino – Introduction to Microcontrollers with Arduino“a set of four 3-hour classes in November 2007 hosted by Machine Project and taught by Tod E. Kurt” with downloadable PDFs and example files and Boarduino, Wii Nunchucks, and Servos“The Boarduino is an Arduino work-alike kit from Adafruit.com that’s smaller, cheaper, and you can build it yourself.”

By integrating functionality from other Auduino sketches and restructuring the code a little – while looking at the Arduino Reference and examples – I’ve been building a single ‘Uber” Auduino sketch. I’ve now managed to:

  • print all the data from the Wii nunchuck to the Serial Monitor;
  • switch between mapping modes using a physical switch – though I’ve since used Z & C button presses on the Wii nunchuck instead – and then to a single push button stepping cyclically through the different modes with a flashing LED indicator – which I’ll need to roll out to my 2×2 buttons with RGB LEDs once I’ve soldered it up;
  • tried to use a physical switch to swap between Wii nunchuck and standard pot input – but this doesn’t work at all – and I suspect won’t without creating more analogue inputs on the Arduino… using a Shift Register or Analog/Digital MUX Breakout
  • though I did implement this for MIDI in – using the Tel Bonic mod and the previously mentioned SpikensielLabsSerial-MIDI Convertor v2D – which allows midi without extra cabling (other than usual USB) – and works well with my Akai LPK25 – and ‘todally rocks’ using it’s built in arpeggiator.

I also thought I’d look at extending the current chromatic and pentatonic mappings…
Being a little hazy on my music theory I thought I’d start by going to a trusted example – such as Stretta’s Polygome64 – which includes a mapping for the Diatonic scale and selection of the Tonic (key note) and filtering between the seven diatonic modes – Ionian (major), Dorian (minor w/raised 6th), Phrygian (minor w/minor 2nd), Lydian (major w/augmented 4th) – Mixolydian (major w.minor 7th), Aeolian (minor) and Locrian (diminished)…
So with the help of Wikipedia I’ve been brushing up on my music theory – but since the Auduino doesn’t quite need the same complexity I’ve only been working out the scales for the Diatonicmajor (Ionian) and minor (Aeolian) and Pentatonic – major and minor starting at C-2.
The Auduino Google Group discussions includes a Creating Scales post in which Auduino developer Peter Knight outlines a formula for calculating mappings from MIDI note:

value = (65536 / 31250) * 440 * 2^((note-69)/12)
Those constants are: ?65536: The counter for phase angle is 16 bits wide, so 65536 is one ?full waveform cycle. ?31250: Sample rate of the output in Hz. ?440: Frequency of A above middle C. Most instruments standardise on ?this being exactly 440Hz: “A440” tuning. ?69: MIDI note of A above middle C. ?12: Semitones in an octave ?2: An octave note is a doubling of frequency.

By plugging this into an Excel spreadsheet I’ve been able to create a table of Auduino values from MIDI notes 0 – C-2 to 127 – G8 which I’ve since coded back into the sketch as additional scales.

Comments are closed.