Syllabus & Assignments
Notes & Journals
More Intro Pages
Serial Communication is when data gets transmitted one bit after another. It used to be that Parallel communication was much faster, which is why computers had "parallel ports” to do data-dense operations like printing. Serial communication is dependent on processor speed, and, since processor speeds have increased so dramatically, serial communication styles like USB have been able to take over those same jobs.
Synchronous Serial basically means that there is one clock controlling the interaction. A “master” circuit beats out a measure over out a clock pin. Each bit gets shifted on either the rising or falling edge of that clock stroke. This is frequently referred to as shifting the data bits.
An example of this would be shift registers.
An example of this kind of protocol is SPI (Serial Peripheral Interface) also referred to by the brand name “Microwire.” The pins defined are usually MISO (Master In Slave Out), MOSI (Master Out Slave In) and SCK (Serial Clock)
Asynchronous communication is what we’ve been doing with the Serial.begin() function, etc. Asynchronous serial communication means that each item has its own internal speed (we have a 20 Mhz clock Crystal on the Arduino Board, the average Mac is, well, faster) but they have an agreed upon data-rate at which they are talking. We’ve been setting it at 9600 bps (bits per second). This value is frequently referred to by the not quite technically precise term baud rate.
An example of asyncronous serial communication is SCI (Serial Communications Interface)
When trying to make that initial connection between devices you need to track the
Some physical layer electrical specifications
More info and sources:
TTL <-> RS232
Focus on Midi
Midi is both a physical connection type and an established language used by musicians to electronics. The lab will give you a basic overview of how to turn on and off a single note, but you can take an entire class on mastering the whole language.
If you don't know how to get midi into your computer already, you should just get a midi-controller out of the equipment room and a set of speakers or headphones and play around.
Just so you have some pointers to get started, when you send a MIDI command you are always going to send at least 2 bytes.
The first byte contains the specific action to perform and is called the status byte. It will contain information about what you want to do (start or stop a note) and which of the 15 channels you want to do it on. It is that channel aspect that makes MIDI a multidrop protocol. Status bytes alway contain a value 128 or above.
So, for example, 0x80, 0x81, 0x82...0x8F will turn notes off on the various channels; 0x90, 0x91, 0x92...0x9F will turn notes on; 0xC0, 0xC1, 0xC2...0xCF will execute a program change, i.e. change the instrument based on what is loaded on your specific synthesizer. There is a nice chart on page 308 of the book and on the blueink.com link below.
Once you know what action you want to do you have to specify certain parameters like you already do in some functions in Processing and Arduino. The MIDI Note On command takes the note value (chart is in decimal) and velocity of strike. This isn't quite volume. It is what the intrument would sound like struck at higher velocity, which could be louder, but could have other distortion as well depending on the how that instument is programed. These parameters or data bytes, are always 127 or less. Check out the lab for an example of sending this command. You'll notice that you can send a Note On command with a "zero velocity" to a note playing on a particular channel to stop it instead of sending a stop command.
Not in the lab but a nice extra: to change channel 1 to steel-string acoustic you would send 0xC0 0x1A (192 26 in Decimal) to create a marimba accompaniment on channel 2 it would be 0xC1 0xD (193 13). There is an instrument list on wikipedia here: http://en.wikipedia.org/wiki/General_MIDI
One more thing to remind you about from chapter 12 is the very useful 0x7B databyte that when sent after the stop command (0xB0 - 0xBF) will just halt everything on that channel. So 0xB0 0x7B stops everything on channel 1 (pg. 309)
Some Example Code w/ Program Change (based on lab code)