VocalEasel/mma/docs/html/tut/node3.html
Matthias Neeracher f54adbeec5 Update to MMA 1.7
2011-07-26 22:49:39 +00:00

481 lines
12 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--Converted with LaTeX2HTML 2008 (1.71)
original version by: Nikos Drakos, CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>A Simple Example</TITLE>
<META NAME="description" CONTENT="A Simple Example">
<META NAME="keywords" CONTENT="mma-tutorial">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META NAME="Generator" CONTENT="LaTeX2HTML v2008">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="mma-tutorial.css">
<LINK REL="next" HREF="node4.html">
<LINK REL="previous" HREF="node2.html">
<LINK REL="up" HREF="mma-tutorial.html">
<LINK REL="next" HREF="node4.html">
</HEAD>
<BODY bgcolor="#ffffff">
<DIV CLASS="navigation"><!--Navigation Panel-->
<A NAME="tex2html64"
HREF="node4.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
<A NAME="tex2html62"
HREF="mma-tutorial.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
<A NAME="tex2html56"
HREF="node2.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html65"
HREF="node4.html">A More Complex Example</A>
<B> Up:</B> <A NAME="tex2html63"
HREF="mma-tutorial.html">Tutorial</A>
<B> Previous:</B> <A NAME="tex2html57"
HREF="node2.html">Installation</A>
<BR>
<BR></DIV>
<!--End of Navigation Panel-->
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
<UL CLASS="ChildLinks">
<LI><A NAME="tex2html66"
HREF="node3.html#SECTION00310000000000000000">Fella Bird, Basic Edition</A>
<LI><A NAME="tex2html67"
HREF="node3.html#SECTION00320000000000000000">Fella Bird, Improved Edition</A>
</UL>
<!--End of Table of Child-Links-->
<HR>
<H1><A NAME="SECTION00300000000000000000">
A Simple Example</A>
</H1>
<P>
<H1><A NAME="SECTION00310000000000000000">
Fella Bird, Basic Edition</A>
</H1>
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="#efefef" Border=3>
<tr><td Align="CENTER" BGColor="White">
<SPAN CLASS="textbf"><BIG CLASS="XLARGE">Sheet Music for a Popular Song</BIG></SPAN> <A NAME="eg:birthday"></A>
</tr> </td>
<tr> <td >
<IMG WIDTH="95%" SRC="mup/fella.png" ALT="Lost Image">
</td> </tr>
</Table>
<P>
<P>
This example piece of music is shown in a &#8220;fake book&#8221; or &#8220;lead sheet&#8221;
style. It shows the melody notes, lyrics and chords.
<P>
As a first try at making a MIDI accompaniment file, we have created the
following file:
<P>
<SPAN CLASS="textbf">//&nbsp;Sample&nbsp;tutorial&nbsp;file
<BR>//&nbsp;Fella&nbsp;Bird,&nbsp;try&nbsp;1
<BR>&nbsp;
<BR>
Tempo&nbsp;120
<BR>
Groove&nbsp;Rhumba
<BR>&nbsp;
<BR>
1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F
<BR>
2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F
<BR>
3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C7
<BR>
4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F
<BR>
5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F
<BR>
6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F
<BR>
7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C7
<BR>
8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F
<BR>
9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gm
<BR>
10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F
<BR>
11&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C7
<BR>
12&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F
<BR>
13&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gm
<BR>
14&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F
<BR>
15&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C7
<BR>
16&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F&nbsp;&nbsp;/&nbsp;&nbsp;/&nbsp;z!
<BR>&nbsp;
<BR></SPAN>
<P>
After the comments in the file, the first line to note is:
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>Tempo 120 </B>
</td></tr>
</Table>
<P>
This sets the tempo, or speed, of the piece to 120 beats per minute. You may
have to guess the tempo--very few pieces (especially in &#8220;fake book&#8221; style)
will include a metronome setting. For slow pieces you might want to start with a
tempo setting of &#8220;80&#8221;; for faster pieces, like swings, try around &#8220;150&#8221;; polkas
and marches, which are really in <SPAN CLASS="textbf">2/2</SPAN> time, may require fast
sounding tempos like &#8220;250&#8221;. Feel free to modify the tempo setting in
the example files--you're not going to break anything.
<P>
Since we are using the standard library which was shipped with
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> ,
we can select one of the predefined grooves:
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>Groove Rhumba </B>
</td></tr>
</Table>
<P>
Note that this command also sets up the &#8220;time signature&#8221; to <SPAN CLASS="textbf">4/4</SPAN>.
Not quite the same as the &#8220;cut&#8221; time indicated, but close enough. And speaking
of &#8220;close enough&#8221;, we're using a rhumba rhythm instead of the merengue indicated
in the score.
<P>
Finally, we have the chord information. The first bar (in the sheet music)
indicates an &#8220;F&#8221; chord. So that's what we tell
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> to use:
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>1 F </B>
</td></tr>
</Table>
<P>
We continue in a similar manner for the rest of the song.
<P>
We've simplifed the song a bit and show only one chord per bar.
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> automatically fills out the bars so that each has four chords.
We could have entered the first bar as:
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>2 F F F F </B>
</td></tr>
</Table>
<P>
or, more simply:
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>2 F / / / </B>
</td></tr>
</Table>
<P>
and had the same result. But, who wants to do all that typing?
<P>
In the final bar, the last beat is a rest.
<P>
The line:
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>16 F / / z! </B>
</td></tr>
</Table>
<P>
causes an &#8220;F&#8221; chord to be used on the first three beats, the fourth
beat is completely silent due the to the &#8220;z!&#8221;. Note the difference
between a &#8220;z&#8221; and &#8220;z!&#8221;--the first silences all but the drum track,
the second silences everything. See the reference manual for more details
on &#8220;z&#8221;.
<P>
Now, let's create our first MIDI file! If you are using the standard
distribution, you should find a file &#8220;fella1.mma&#8221; in the tutorial directory.
Change to this directory and type the command:
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>mma fella1 </B>
</td></tr>
</Table>
<P>
Your computer should run the python script called &#8220;mma&#8221; and process the
file &#8220;fella1.mma&#8221;. The MIDI file &#8220;fella1.mid&#8221; should be created. If this doesn't
happen, please check your python installation, and make sure that you
have installed &#8220;mma&#8221; where your shell can find it. If you are completely stuck,
drop me an email.
<P>
Now, use your favorite MIDI file player to play the song.
<P>
How'd that sound? A piano doing some chords, a jazzy bass line,
and a bit of drumming? Wonderful!
<P>
<H1><A NAME="SECTION00320000000000000000">
Fella Bird, Improved Edition</A>
</H1>
<P>
If you play the MIDI created in the previous section you'll find a number
of things lacking. Certainly:
<P>
<UL>
<LI>It is hard to sing to because there is no aural indication of
when to start,
<P>
</LI>
<LI>The whole piece is the same volume,
<P>
</LI>
<LI>It's a pretty short song, so let's play it twice.
<P>
</LI>
</UL>
<P>
The following example has a number of improvements:
<P>
<SPAN CLASS="textbf"> //&nbsp;Sample&nbsp;tutorial&nbsp;file
<BR>//&nbsp;Fella&nbsp;Bird,&nbsp;try&nbsp;2
<BR>&nbsp;
<BR>
Tempo&nbsp;120
<BR>
Groove&nbsp;Metronome2-4
<BR>&nbsp;
<BR>
z&nbsp;*&nbsp;2
<BR>&nbsp;
<BR>
Groove&nbsp;Rhumba
<BR>
Repeat
<BR>
Volume&nbsp;mp
<BR>
Cresc&nbsp;mf&nbsp;4
<BR>&nbsp;
<BR>
1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F
<BR>
2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F
<BR>
3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C7
<BR>
4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F
<BR>
5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F
<BR>
6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F
<BR>
7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C7
<BR>
8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F
<BR>
9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gm
<BR>
10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F
<BR>
11&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C7
<BR>&nbsp;
<BR>
Decresc&nbsp;p&nbsp;4
<BR>&nbsp;
<BR>
12&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F
<BR>
13&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gm
<BR>
14&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F
<BR>
15&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C7
<BR>&nbsp;
<BR>
RepeatEnding
<BR>&nbsp;
<BR>
16&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F&nbsp;&nbsp;/&nbsp;&nbsp;/&nbsp;z
<BR>&nbsp;
<BR>
RepeatEnd
<BR>&nbsp;
<BR>
17&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;F&nbsp;&nbsp;/&nbsp;&nbsp;/&nbsp;z!
<BR>
cut&nbsp;-1
<BR>&nbsp;
<BR>&nbsp;
<BR></SPAN>
Try running
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> on this file and listen to it. Oh my, much better.
<P>
So, let's look at the changes.
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>Groove Metronome2-4 </B>
</td></tr>
</Table>
<P>
This sets the current &#8220;groove&#8221; to a metronome. To find this groove
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> will automatically process the library file &#8220;metronome&#8221;.
<P>
The metronome groove consists of wood-blocks being struck in a
<SPAN CLASS="textbf">4/4</SPAN> pattern. In order to &#8220;sound&#8221; the metronome, we need
to create an empty bar:
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>&nbsp;&nbsp;&nbsp;z * 2 </B>
</td></tr>
</Table>
<P>
Mind you, we could have specified a chord here and gotten the same
result (the groove has no definitions for any instruments other than
the wood-block, so nothing else will sound). But, it seems to be more
clear to use a &#8220;z&#8221;.
<P>
Okay, we lied. We didn't create an empty bar for the metronome. If
you're sharp you'll notice that the &#8220;z&#8221; is followed by &#8220;* 2&#8221;. This
means to play this bar two times. So, you get 2 bars of metronome.
Cool.
<P>
We've not made any changes to the chords, but a few little changes do
help this simple piece. Remember the dull, single volume? Well, have a
look at the &#8220;volume&#8221; directives we've included in this version. We
start the song off at a moderate volume, and increase it in several
steps. And, at the end we use a &#8220;decresc&#8221; to reduce the volume to
&#8220;quiet&#8221; over the final 4 bars.
<P>
Please refer to the
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> Reference Manual for salient details on the
volume commands.
<P>
One minor change we did make in the chords is in bar 16. Note the
change between this and bar 17. In the first we have a &#8220;z&#8221;, the
second a &#8220;z!&#8221;. The difference between the two is that we want the
precussion tracks to continue though the ending, but not on the final
beat.
<P>
Finally, to ensure a complete cutoff in the final bar we have added a
&#8220;cut&#8221; command. We're sure you'll find these minor changes a great
improvement.
<P>
<P>
<DIV CLASS="navigation"><HR>
<!--Navigation Panel-->
<A NAME="tex2html64"
HREF="node4.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
<A NAME="tex2html62"
HREF="mma-tutorial.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
<A NAME="tex2html56"
HREF="node2.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html65"
HREF="node4.html">A More Complex Example</A>
<B> Up:</B> <A NAME="tex2html63"
HREF="mma-tutorial.html">Tutorial</A>
<B> Previous:</B> <A NAME="tex2html57"
HREF="node2.html">Installation</A></DIV>
<!--End of Navigation Panel-->
<ADDRESS>
bob
2010-11-07
</ADDRESS>
</BODY>
</HTML>