Copyright (c) Hyperion Entertainment and contributors.

Difference between revisions of "AmiWest Lesson 5"

From AmigaOS Documentation Wiki
Jump to navigation Jump to search
(Created page with "Lyle Hazelwood is developing this lesson.")
 
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  +
= AmiWest Lesson 5: MIDI =
Lyle Hazelwood is developing this lesson.
 
  +
  +
MIDI (Musical Instrument DIgital Interface) was first created as a serial link that allowed a musical keyboard to control synthesizers.
  +
  +
In the AmigaOS, we have CAMD library to makes interconnection of MIDI applications easy.
  +
  +
This lesson will be to take an existing CAMD application and dress it up with proper BOOPSI graphics elements.
  +
  +
==Preparation==
  +
  +
Before beginning this lesson, you will need:
  +
A working installation of GCC on your Amiga.
  +
camd.library, available from OS4Depot[http://os4depot.net/share/driver/misc/camd.lha]
  +
The camd developers files, which the install script should offer to install when camd is installed.
  +
Some program to play a MIDI file. My favorite is CAMDPlay, available at OS4Depot[http://os4depot.net/share/audio/play/camdplay.lha]
  +
A midi file of your favorite song. most MIDI files end in ".mid". There are hundreds of places to find them, Google is your friend.
  +
The application we will be dressing up is "MidiActive". Source and executable are available at OS4Depot[http://os4depot.net/share/driver/misc/camdtools.lha]
  +
  +
If you'd like to hear the music, you'll also need either a MIDI synthesizer, or a software synth like SoftSyn[http://os4depot.net/share/audio/play/softsyn.lha]
  +
Softsyn will need a compatible "instrument definition" file. I use This one[http://www.sf2midi.com/soundfonts/download/yamaha-xg-sound-set-re-map-sf2-3993.html/?act=mirror]
  +
  +
That's a lot of "stuff" to set up. I'll have a flash drive on hand to help anyone who has trouble during the lesson.
  +
  +
==Checking it out==
  +
One drawback to playing music on a software synth is that you cannot see channel activity. The "MidiActive" app opens a window that will show instrument names and note on/off activity so that you can see what is playing.
  +
Play a MIDI file (to an external synth or to SoftSyn), then run MidiActive and set the MIDI link to the same CAMD link as your synth. You should see 16 "tracks", each will show the instrument name when each instrument is selected.
  +
Each "track" will also flash a little red square in one of three modes: OFF when no notes are playing, a small red square when a single note is playing, or a larger square for multiple notes.
  +
  +
==Improving the application==
  +
The red squares are a bit plain. Maybe even ugly. The goal of this lesson is to replace the squares with more modern graphics.
  +
The source for MidiActive includes a file named "images.h". Inside that file you'll find the three squares that we are now using.
  +
  +
You should be able to search all the project code to find where those images are being drawn, the code to figure out when to draw is already complete.
  +
Better graphics? Those are up to you. Any of the methods that have been discussed already are fair game. If you have AISS[http://os4depot.net/share/graphics/aiss/aiss.lha] installed, you'll have hundreds, maybe thousands of graphics to choose from.
  +
Remember that the "image" will require one OFF state plus TWO on states, one for a "little" sound, and the other for a "lot" of sound. You can change images, colors, whatever you think might look good.
  +
  +
==wrap-up==
  +
I am happy to show a bit of CAMD code. By the end of this lesson your Amiga will have all it needs to play MIDI files, and you'll be able to see the playback activity with graphics that you created yourself.
  +
If you have an interest in music on the Amiga, I encourage you to look over all the tools in the camdtools archive. Each one comes with complete source code that you can build upon.

Latest revision as of 23:25, 19 October 2012

AmiWest Lesson 5: MIDI

MIDI (Musical Instrument DIgital Interface) was first created as a serial link that allowed a musical keyboard to control synthesizers.

In the AmigaOS, we have CAMD library to makes interconnection of MIDI applications easy.

This lesson will be to take an existing CAMD application and dress it up with proper BOOPSI graphics elements.

Preparation

Before beginning this lesson, you will need: A working installation of GCC on your Amiga. camd.library, available from OS4Depot[1] The camd developers files, which the install script should offer to install when camd is installed. Some program to play a MIDI file. My favorite is CAMDPlay, available at OS4Depot[2] A midi file of your favorite song. most MIDI files end in ".mid". There are hundreds of places to find them, Google is your friend. The application we will be dressing up is "MidiActive". Source and executable are available at OS4Depot[3]

If you'd like to hear the music, you'll also need either a MIDI synthesizer, or a software synth like SoftSyn[4] Softsyn will need a compatible "instrument definition" file. I use This one[5]

That's a lot of "stuff" to set up. I'll have a flash drive on hand to help anyone who has trouble during the lesson.

Checking it out

One drawback to playing music on a software synth is that you cannot see channel activity. The "MidiActive" app opens a window that will show instrument names and note on/off activity so that you can see what is playing. Play a MIDI file (to an external synth or to SoftSyn), then run MidiActive and set the MIDI link to the same CAMD link as your synth. You should see 16 "tracks", each will show the instrument name when each instrument is selected. Each "track" will also flash a little red square in one of three modes: OFF when no notes are playing, a small red square when a single note is playing, or a larger square for multiple notes.

Improving the application

The red squares are a bit plain. Maybe even ugly. The goal of this lesson is to replace the squares with more modern graphics. The source for MidiActive includes a file named "images.h". Inside that file you'll find the three squares that we are now using.

You should be able to search all the project code to find where those images are being drawn, the code to figure out when to draw is already complete. Better graphics? Those are up to you. Any of the methods that have been discussed already are fair game. If you have AISS[6] installed, you'll have hundreds, maybe thousands of graphics to choose from. Remember that the "image" will require one OFF state plus TWO on states, one for a "little" sound, and the other for a "lot" of sound. You can change images, colors, whatever you think might look good.

wrap-up

I am happy to show a bit of CAMD code. By the end of this lesson your Amiga will have all it needs to play MIDI files, and you'll be able to see the playback activity with graphics that you created yourself. If you have an interest in music on the Amiga, I encourage you to look over all the tools in the camdtools archive. Each one comes with complete source code that you can build upon.