Sunday 8 April 2012

NaV-1 Arduino Soundgin-Babblebot Synth - Part 2

Adding a MIDI Input

Please go back and read Part 1 of the NaV-1 Soundgin Synth project if you haven't already. If you want to skip ahead and start building the final hardware go HERE.

Now that we have the basic circuit built and have verified that the Arduino can control the Soundgin chip, we are going to add the circuitry for a MIDI Input. This is going to turn this project from a mere noisemaker into an actual playable instrument!



I have already covered the basics of adding MIDI control to an Arduino in This Article. Give it a quick read to get up to speed.

HARDWARE

*NOTE* From this point on you will need to power your Arduino from an external power supply. I am using a 9v DC Lab Supply. At this stage, the circuit is drawing around 50-70mA of current. We need to remove the USB cable when we are running the Synth so it does not conflict with the incoming Midi Data

To Start, look at this schematic for a standard MIDI INPUT circuit below.

MIDI Input circuit
Now add this circuit to the NaV-1 synth.

Schematic

Here is the circuit on a breadboard.

On the BreadBoard

Midi input circuit


** Notice that the Midi components are kept away from the Audio output. If they get too close, you can pick up Midi noise on the Audio line. **


SOFTWARE

*NOTE* - The Midi Library requires Arduino IDE version 0023 or earlier. You will get errors if you try to compile in a later version. Also, you need to make sure no powered Midi devices are connected when you upload the program to the Arduino Board. Removing the wire from "Pin 0-RX" on the Arduino board is a quick way to insure this. Remember to replace the wire and remove the USB cable when you are ready to run the Synth.

First download and install the MIDI Library and run the Midi Test as described Here. The program also uses the SoftwareSerial Library to communicate with the Soundgin chip using pins 2,3, and 4.

The program file can be downloaded HERE. It is in the folder named "NaV1_MIDI_Test". Open the enclosed PDE file in the Arduino IDE (version 0023 or earlier).

The program starts by creating a SoftwareSerial object named "soundgin", starting the Midi Library and setting its callback function, and initializing some Arduino pins.

It then calls the "patch" function which initializes the Soundgin and sets up a basic Saw Wave in Oscillator A. An array called "sgInit" contains this list of commands to accomplish this. Notice that Soundgin commands begin with a "27" as an escape character followed by the command byte. The command "27,1" tells the Soundgin to store a byte in a memory location. Read through the commented code to see the commands.

Once the Soundgin is ready, the program sits and waits for incoming Midi Data. When it receives a valid Midi note command, the function "MyHandleNoteOn" is called by the Midi Library to deal with it.

This function takes the incoming note number and uses a Lookup Table to convert the Midi note data into the correct note number used by the Soundgin "Load & Play a musical note in Oscillator A" command.

There are two Global Variables named "currentNote" and "newNote". When a key is pressed, its note value is stored in currentNote. If a second key is hit before currentNote is released, it is stored in the newNote variable. That way currentNote can be retriggered if newNote is the first to be released. If this is not done, you will find notes mysteriously cutting out while you are playing faster passages.


By this point you should have a pretty cool little synth to play with. Have fun with it!

Next Part: Building the User Interface

Sunday 1 April 2012

How to write AWESOME Lyrics! Top 10 tricks!


Kicking off the Month of April with a Masterpiece!!

Do you want to write AWESOME LYRICS! If you are a songwriter, the following article will be the most important thing you will read in your lifetime! It's like the Rosetta Stone wrapped in bacon! It's just that good! Just follow these 10 sure fire tips and you will be wearing Gold Plated Diapers in no time. Just be sure to give me at least 10% of your royalties...


1 - The Citaaay: Things are always happening in the city. If you aren't in the city you are probably trying to get back to the city. And if you can use an actual city name in your song, all the better! (Keep in mind, nothing rhymes with Tonawanda). No need to mention rural folks in your song unless it involves them moving to the city at some point. Glen Frey's gold records seem to agree...

'Cause you belong to the city
You belong to the night 
living in a river of darkness, beneath the neon light
You were born in the city
Concrete under your feet
It's in your blood, its in your moves
You're a man of the street


2 - Street, Beat, Heat: You can build an entire career with this rhyming gold! Apparently the Street has a Beat that causes you to feel the Heat. Perhaps you should move your Feet? Move your feet to the beat on the street. Feel the heat of the street beat....This stuff writes itself! From the works of Toni Basil..

Street beat, she goes walkin' down the street
Street beat, she just knocks them off their feet
Street beat, she goes walkin' out the door
Street beat, she don't want him anymore


3 - Night Fightin': Stuff goes down at night. There is a lot of Fightin' in the Night. And what are you fighting for? The Light! Or perhaps Your Rights. A lot of the time you are just Runnin' in the Night. Shadows are something you will find in the night. You should run from them. But you know things usually end up Alright! The great Lionel Ritchie put it best. This always brigs a tear to my eye...

We were running with the night
Playin' with the shadows
Just you and i
Till the morning light


4 - Hearts: Don't use the word "Love" in your song. Replace it with the word "Heart". And always, Always, pronounce it with a weird pseudo British accent so it sounds like "Haaaht". A Heart is a good thing to search for when you're fightin' in the night in the citaay. The great Don Johnson used this to great effect.

Tell me what you feel now
We´ve got a heartbeat
Baby is it real now
We´ve got a heartbeat
Heartbeat!


5 - Dancin': According to the rules of pop song-writing, people are always supposed to be dancing. Dancing is the most important thing in life by far! If you ever see someone not dancing, it is your solemn duty to tell them to "get up and DANCE!!" I'm tired....From some band I've never heard of...

No, No Body Stop. Everybody Move
Get Up And Dance Get Up And Dance
Move Your Body B-b-body
No, Nobody Stop. Everybody Move
Get Up And Dance Get Up And Dance
Move Your Body B-b-body


6 - Huntin' Animals: When it comes to love, every man is a Hunter. And his prey? Fine lookin' Ladies! That's why Leopard print spandex was invented. Ladies love being treated like a wounded Gazelle. Use this to your advantage! The great Don Dokken knew what time it was when he wrote..

I'm a Hunter
Searchin' for Love
On this lonely street again


7 - Cry, Goodbye: Sometimes you may need to write a sad song. You only need to know these simple phrases. When we part you break my Heart. I will Cry when you say Goodbye.
I'll be Sad if you treat me Bad. Boyzone knows what the ladies like...

I'm never gonna say goodbye
'Cos I never wanna see you cry
I swore to you my love would remain
And I swear it all over again
I'm never gonna treat you bad
'Cos I never wanna see you sad


8 - Sexy Body: Correctly pronounced as "Bodaaay". I want your body. Move your Body. This is basically a euphemism for genitalia. End of story. From the great Freddie Mercury...

Give me body give me-
Body - body - give me
Your body don't talk
Baby don't talk


9 - Baby, Lady: Every artist needs at least one Baby-Lady song in the ole' repitoir. If you put your song writing pen to paper and the first word to come out isn't "Baby" or "Lady", YOU ARE DOING IT WRONG!!  Justin Bieber mastered this trick while he was still in utero. Ahhh, the student has become the master...

I'm your b-baby lady,
I wanna hold you like a Snuggie.
You're my baby, lady.
And I'm your lady, baby.
It's time to roll,
Let's go to the park.


10 - Hot Heat:  Global warming has insured that Things are no longer cool. Cool is for Arthur Fonzerelli and other old dudes from the 50's. Things are Hot!! Make sure to pronounce the extra silent "T" in HOTT! Where there is Heat, there is usually Fire. What else burns like Fire? Desire! And that fire has only one place to go...Higher! Rick James wrote the following while wearing a gladiator outfit in his velvet lined hot-tub...

And you tuned on my fire, baby
And you burn me up within your flame
Took me a little higher
Made me live again


There you go! Everything you need to know to become a master song writer! To show you how it's done, I touched my diamond encrusted song-writing quill to paper and the following gold spilled forth...Watch and learn! You're Welcome!
If you think you can do better, write your "masterpiece" in the comments below..


Fightin' for a Heart in the Night (in the city)


Verse
Runnin',
in the street at night
lookin' for a heart
Ready to fight


Feel the heat on the street
move my feet to the beat of the citaay


Im a hunter of love
and my fire's getting higher for you


Chorus
You got to stand up and dance in the light
You got to run from heat of the fight
When your lookin' for a heart
in the night


Hey, North Dakota!


(Sax solo!)