VocalEasel/mma/docs/html/ref/node24.html

1102 lines
31 KiB
HTML
Raw Normal View History

2006-11-10 08:07:56 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with LaTeX2HTML 2002-2-1 (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>
2007-04-29 06:47:40 +00:00
<TITLE>Paths, Files and Libraries</TITLE>
<META NAME="description" CONTENT="Paths, Files and Libraries">
2006-11-10 08:07:56 +00:00
<META NAME="keywords" CONTENT="mma">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="mma.css">
<LINK REL="next" HREF="node25.html">
<LINK REL="previous" HREF="node23.html">
<LINK REL="up" HREF="mma.html">
<LINK REL="next" HREF="node25.html">
</HEAD>
<BODY bgcolor="#ffffff">
<!--Navigation Panel-->
2007-04-29 06:47:40 +00:00
<A NAME="tex2html708"
2006-11-10 08:07:56 +00:00
HREF="node25.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
2007-04-29 06:47:40 +00:00
<A NAME="tex2html706"
2006-11-10 08:07:56 +00:00
HREF="mma.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
2007-04-29 06:47:40 +00:00
<A NAME="tex2html700"
2006-11-10 08:07:56 +00:00
HREF="node23.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<BR>
2007-04-29 06:47:40 +00:00
<B> Next:</B> <A NAME="tex2html709"
HREF="node25.html">Creating Effects</A>
<B> Up:</B> <A NAME="tex2html707"
2006-11-10 08:07:56 +00:00
HREF="mma.html">Reference Manual</A>
2007-04-29 06:47:40 +00:00
<B> Previous:</B> <A NAME="tex2html701"
HREF="node23.html">Documentation Strings</A>
2006-11-10 08:07:56 +00:00
<BR>
<BR>
<!--End of Navigation Panel-->
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
<UL>
2007-04-29 06:47:40 +00:00
<LI><A NAME="tex2html710"
HREF="node24.html#SECTION002410000000000000000">File Extensions</A>
2006-11-10 08:07:56 +00:00
<LI><A NAME="tex2html711"
2007-04-29 06:47:40 +00:00
HREF="node24.html#SECTION002420000000000000000">Tilde Expansion</A>
2006-11-10 08:07:56 +00:00
<LI><A NAME="tex2html712"
2007-04-29 06:47:40 +00:00
HREF="node24.html#SECTION002430000000000000000">Eof</A>
<LI><A NAME="tex2html713"
HREF="node24.html#SECTION002440000000000000000">LibPath</A>
<LI><A NAME="tex2html714"
HREF="node24.html#SECTION002450000000000000000">AutoLibPath</A>
<LI><A NAME="tex2html715"
HREF="node24.html#SECTION002460000000000000000">OutPath</A>
<LI><A NAME="tex2html716"
HREF="node24.html#SECTION002470000000000000000">Include</A>
<LI><A NAME="tex2html717"
HREF="node24.html#SECTION002480000000000000000">IncPath</A>
<LI><A NAME="tex2html718"
HREF="node24.html#SECTION002490000000000000000">Use</A>
<LI><A NAME="tex2html719"
HREF="node24.html#SECTION0024100000000000000000">MmaStart</A>
<LI><A NAME="tex2html720"
HREF="node24.html#SECTION0024110000000000000000">MmaEnd</A>
<LI><A NAME="tex2html721"
HREF="node24.html#SECTION0024120000000000000000">RC Files</A>
<LI><A NAME="tex2html722"
HREF="node24.html#SECTION0024130000000000000000">Library Files</A>
<UL>
<LI><A NAME="tex2html723"
HREF="node24.html#SECTION0024131000000000000000">Maintaining and Using Libraries</A>
</UL>
<BR>
<LI><A NAME="tex2html724"
HREF="node24.html#SECTION0024140000000000000000">Paths on Windows Platforms</A>
2006-11-10 08:07:56 +00:00
</UL>
<!--End of Table of Child-Links-->
<HR>
<H1><A NAME="SECTION002400000000000000000"></A>
2007-04-29 06:47:40 +00:00
<A NAME="sec-paths"></A>
<BR>
Paths, Files and Libraries
</H1>
<P>
This chapter covers
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> filenames, extensions and a variety of
commands and/or directives which effect the way in which files are
read and processed.
<P>
But, first a few comments on the location of the
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> Python modules.
<P>
The Python language (which was used to write
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> ) has a very useful
feature: it can include other files and refer to functions and data
defined in these files. A large number of these files or modules are
included in every Python distribution. The program
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> consists of a
short ``main'' program and several ``module'' files. Without these
additional modules
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> will not work.
<P>
The only sticky problem in a program intended for a wider audience is
where to place these modules. Hopefully, it is a ``good thing'' that
they should be in one of three locations:
<P>
<UL>
<LI><TT><B>/usr/local/share/mma/MMA</B></TT>
<P>
</LI>
<LI><TT><B>/usr/share/mma/MMA</B></TT>
<P>
</LI>
<LI><TT><B>./MMA</B></TT>
<P>
</LI>
</UL>
<P>
If, when initializing itself,
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> cannot find one of the above
directories, it will terminate with an error message.
<P>
If you are using
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> on a Windows platform please see the comments about
the default paths <A HREF="#window-paths">(here)</A>.
<P>
<H1><A NAME="SECTION002410000000000000000"></A> <A NAME="file-extensions"></A>
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
File Extensions
</H1>
<P>
For most files the use of a the filename extension ``.mma'' is
optional. However, it is suggested that most files (with the exceptions
listed below) have the extension present. It makes it much easier to
identify
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> song and library files and to do selective processing
on these files.
<P>
In processing an input song file
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> can encounter several different
types of input files. For all files, the initial search is done by
adding the filename extension ``.mma'' to filename (unless it is
already present), then a search for the file as given is done.
<P>
For files included with the U<SMALL>SE</SMALL> directive, the directory set
with <SMALL>SET</SMALL>L<SMALL>IB</SMALL>P<SMALL>ATH</SMALL> is first checked, followed by the current
directory.
<P>
For files included with the I<SMALL>NCLUDE</SMALL> directive, the directory
set with <SMALL>SET</SMALL>I<SMALL>NC</SMALL>P<SMALL>ATH</SMALL> is first checked, followed by the current
directory.
<P>
Following is a summary of the different files supported:
<P>
<DL>
<DT><STRONG>Song Files</STRONG></DT>
<DD>The input file specified on the command line should
always be named with the ``.mma'' extension. When
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> searches for
the file it will automatically add the extension if the file name
specified does not exist and doesn't have the extension.
<P>
</DD>
<DT><STRONG>Library Files</STRONG></DT>
<DD>Library files <I>really should</I> all be named
with the extension.
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> will find non-extension names when used in
a U<SMALL>SE</SMALL> or I<SMALL>NCLUDE</SMALL> directive. However, it will not
process these files when creating indexes with the ``-g'' command
line option--these index files are used by the G<SMALL>ROOVE</SMALL>
commands to automatically find and include libraries.
<P>
</DD>
<DT><STRONG>RC Files</STRONG></DT>
<DD>As noted in the RC-File discussion
<A HREF="#sec-rc">(here)</A>
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> will
automatically include a variety of ``RC'' files. You can use the
extension on these files, but common usage suggests that these files
are probably better without.
<P>
</DD>
<DT><STRONG>MMAstart and MMAend</STRONG></DT>
<DD>
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> will automatically include a file at
the beginning or end of processing (<A HREF="#sec-mmaend">start/end
details</A>). Typically these files are
named MMA<SMALL>START</SMALL> and MMA<SMALL>END</SMALL>. Common usage is to
<I>not</I> use the extension if the file is in the current
directory; use the file if it is in an ``includes'' directory.
<P>
</DD>
</DL>
<P>
One further point to remember is that filenames specified on the
command line are subject to wild-card expansion via the shell you are
using.
<P>
<H1><A NAME="SECTION002420000000000000000">
Tilde Expansion</A>
</H1>
<P>
On Unix-like systems all filenames may be prefaced with tilde or a
tilde with a username. All file operations in
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> honor this
convention. This includes the setting of library and include paths.
<P>
The result of this operation is system dependent. See the entry for
<I>os.path.expanduser</I> in the Python library reference.
<P>
<H1><A NAME="SECTION002430000000000000000">
Eof</A>
</H1>
<P>
Normally, a file is processed until its end. However, you can
short-circuit this behavior with the E<SMALL>OF</SMALL> directive. If
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> finds a line starting with E<SMALL>OF</SMALL> no further processing will be
done on that file ... it's just as if the real end of file was
encountered. Anything on the same line, after the E<SMALL>OF</SMALL> is also
discarded.
<P>
You may find this handy if you want to test process only a part of a
file, or if you making large edits to a library file. It is often used
to quit when using the L<SMALL>ABEL</SMALL> and G<SMALL>OTO</SMALL> directives to
simulate constructs like <I>D.C. al Coda</I>, etc.
<P>
<H1><A NAME="SECTION002440000000000000000"></A> <A NAME="libpath"></A>
<BR>
LibPath
</H1>
<P>
The search for library files can be set with the LibPath variable. To
set L<SMALL>IB</SMALL>P<SMALL>ATH</SMALL>:
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>SetLibPath PATH </B>
</td></tr>
</Table>
<P>
You can have only one path in the S<SMALL>ET</SMALL>L<SMALL>IB</SMALL>P<SMALL>ATH</SMALL> directive.
<P>
When
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> starts up it sets the library path to the first valid
directory in the list:
<P>
<UL>
<LI><TT><B>/usr/local/share/mma/lib</B></TT>
<P>
</LI>
<LI><TT><B>/usr/share/mma/lib</B></TT>
<P>
</LI>
<LI><TT><B>./lib</B></TT>
<P>
</LI>
</UL>
<P>
The last choice lets you run
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> directly from the distribution
directory.
<P>
You are free to change this to any other location in a
<A HREF="#sec-rc">RCFile</A>.
<P>
L<SMALL>IB</SMALL>P<SMALL>ATH</SMALL> is used by the routine which auto-loads grooves from
the library, and the U<SMALL>SE</SMALL> directive. The -g command line option
is used to maintain the library <A HREF="node2.html#g-option">database</A>).
<P>
The current setting can be accessed via the macro $_LibPath.
<P>
<H1><A NAME="SECTION002450000000000000000">
AutoLibPath</A>
2006-11-10 08:07:56 +00:00
</H1>
<P>
2007-04-29 06:47:40 +00:00
The sub-directory containing the current library files to automatically
load is determined by the current setting of A<SMALL>UTO</SMALL>L<SMALL>IB</SMALL>P<SMALL>ATH</SMALL>.
Please see the library file discussion <A HREF="#lib-files">here</A> for details.
<P>
You can change the automatic include directory by resetting this
variable. It must be a sub-directory of L<SMALL>IB</SMALL>P<SMALL>ATH</SMALL> for it to work.
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
The command to reset the variable is:
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>SetAutoLibPath mydir </B>
2006-11-10 08:07:56 +00:00
2007-04-29 06:47:40 +00:00
</td></tr>
</Table>
<P>
The current setting can be accessed via the macro $_AutoLibPath. By
default the setting is ``stdlib''.
<P>
Any existing G<SMALL>ROOVE</SMALL> definitions are deleted from memory when
this command is issued (this it to avoid name conflicts between libraries).
<P>
<H1><A NAME="SECTION002460000000000000000"></A> <A NAME="setoutpath"></A>
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
OutPath
</H1>
<P>
MIDI file generation is to an automatically generated filename
(<A HREF="node2.html#sec-running">more details</A>). If the
O<SMALL>UT</SMALL>P<SMALL>ATH</SMALL> variable is set, that value will be prepended to the
output filename. To set the value:
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>SetOutPath PATH </B>
</td></tr>
</Table>
<P>
Just make sure that ``PATH'' is a simple path name with <I>no</I>
spaces in it. The variable is case sensitive (assuming that your
operating system supports case sensitive filenames). This is a common
directive in a RC file (<A HREF="#sec-rc">more details</A>). By default, it has no value.
<P>
You can disable the O<SMALL>UT</SMALL>P<SMALL>ATH</SMALL> variable quite simply: just issue
the command without an argument.
<P>
If the name set by this command begins with a ``.'', ``/'' or
`` &#92;'' it is prepended to the complete filename specified on
the command line. For example, if you have the input filename
<TT><B>test.mma</B></TT> and the output path is
<TT><B>~/mids</B></TT>
--the output file will be <TT><B>/home/bob/mids/test.mid</B></TT>.
<P>
If the name doesn't start with the special characters noted in the
preceding paragraph the contents of the path will be inserted before
the filename portion of the input filename. Again, an example: the
input filename is <TT><B>mma/rock/crying</B></TT> and the output path is
``midi''--the output file will be <TT><B>mma/rock/midi/crying.mid</B></TT>.
<P>
The current setting can be accessed via the macro $_OutPath.
<P>
Note that this option is ignored if you use the <A HREF="node2.html#f-option">-f
command line option</A> or
if an absolute name for the input file (one starting with a ``/'' or
a ``~'') is used.
<P>
<H1><A NAME="SECTION002470000000000000000">
Include</A>
</H1>
<P>
Other files with sequence, pattern or music data can be included at
any point in your input file. There is no limit to the level of
includes.
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>Include Filename </B>
</td></tr>
</Table>
<P>
A search for the file is done in the I<SMALL>NC</SMALL>P<SMALL>ATH</SMALL> directory (see
below) and the current directory. The ``.mma'' filename extension is
optional (if a filename exists both with and without the ``.mma''
extension, the file with the extension will be used).
<P>
The use of this command should be quite rare in user files; however,
it is used extensively in library files to include standard
patterns.
<P>
<H1><A NAME="SECTION002480000000000000000"></A> <A NAME="incpath"></A>
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
IncPath
</H1>
<P>
The search for include files can be set with the I<SMALL>NC</SMALL>P<SMALL>ATH</SMALL>
variable. To set I<SMALL>NC</SMALL>P<SMALL>ATH</SMALL>:
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>SetIncPath PATH </B>
</td></tr>
</Table>
<P>
You can have only one path in the S<SMALL>ET</SMALL>I<SMALL>NC</SMALL>P<SMALL>ATH</SMALL> directive.
<P>
When
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> initializes it sets the include path to first found directory in:
<P>
<UL>
<LI><TT><B>/usr/local/share/mma/includes</B></TT>
</LI>
<LI><TT><B>/usr/share/mma/includes</B></TT>
</LI>
<LI><TT><B>./includes</B></TT>
<P>
</LI>
</UL>
<P>
The last location lets you run
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> from the distribution directory.
<P>
If this value is not appropriate for your system, you are free to
change it in a RC File.
<P>
The current setting can be accessed via the macro $_IncPath.
<P>
<H1><A NAME="SECTION002490000000000000000"></A> <A NAME="lib-use"></A>
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
Use
</H1>
<P>
Similar to I<SMALL>NCLUDE</SMALL>, but a bit more useful. The U<SMALL>SE</SMALL>
command is used to include library files and their predefined grooves.
<P>
Compared to I<SMALL>NCLUDE</SMALL>, U<SMALL>SE</SMALL> has important features:
<P>
<UL>
<LI>The search for the file is done in the paths specified by the LibPath variable,
<P>
</LI>
<LI>The current state of the program is saved before the library
file is read and restored when the operation is complete.
<P>
</LI>
</UL>
<P>
Let's examine each feature in a bit more detail.
<P>
When a U<SMALL>SE</SMALL> directive is issued, eg:
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>use stdlib/swing </B>
</td></tr>
</Table>
<P>
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> first attempts to locate the file ``stdlib/swing'' in the
directory specified by L<SMALL>IB</SMALL>P<SMALL>ATH</SMALL> or the current directory. As
mentioned above,
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> automatically added the ``.mma'' extension to
the file and checks for the non-extension filename if that can't be
found.
<P>
If things aren't working out quite right, check to see if the filename
is correct. Problems you can encounter include:
<P>
<UL>
<LI>Search order: you might be expecting the file in the current
directory to be used, but the same filename exists in the
L<SMALL>IB</SMALL>P<SMALL>ATH</SMALL>, in which case that file is used.
<P>
</LI>
<LI>Not using extensions: Remember that files <I>with</I> the
extension added are first checked.
<P>
</LI>
<LI>Case: The filename is <I>case sensitive</I>. The files ``Swing''
and ``swing'' are not the same. Since most things in
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> are case
insensitive, this can be an easy mistake to make.
<P>
</LI>
<LI>The file is in a sub directory of the L<SMALL>IB</SMALL>P<SMALL>ATH</SMALL>. In a
standard distribution the actual library files are in
<TT><B>/usr/local/share/mma/lib/stdlib</B></TT>, but the libpath is set to
<TT><B>/usr/local/share/mma/lib</B></TT>. In this case you must name the file
to be used as <TT><B>stdlib/rhumba</B></TT> <I>not</I> <TT><B>rhumba</B></TT>.
<P>
</LI>
</UL>
<P>
As mentioned above, the current state of the compiler is saved during
a U<SMALL>SE</SMALL>.
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> accomplishes this by issuing a slightly modified
D<SMALL>EF</SMALL>G<SMALL>ROOVE</SMALL> and G<SMALL>ROOVE</SMALL> command before and after the
reading of the file. Please note that I<SMALL>NCLUDE</SMALL> doesn't do this.
But, don't let this feature fool you--since the effects of defining
grooves are cumulative you <I>really should</I> have S<SMALL>EQ</SMALL>C<SMALL>LEAR</SMALL>
statements at the top of all your library files. If you don't you'll
end up with unwanted tracks in the grooves you are defining.
<P>
<I>In most cases you will not need to use the U<SMALL>SE</SMALL> directive
in your music files.</I> If you have properly installed
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> and keep
the database up-to-date by using the command:
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>$ mma -g </B>
2006-11-10 08:07:56 +00:00
2007-04-29 06:47:40 +00:00
</td></tr>
</Table>
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
grooves from library files will be automatically found and loaded.
Internally, the U<SMALL>SE</SMALL> directive is used, so existing states are
saved.
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
If you are developing new or alternate library files you will find the
U<SMALL>SE</SMALL> directive handy.
2006-11-10 08:07:56 +00:00
2007-04-29 06:47:40 +00:00
<P>
<H1><A NAME="SECTION0024100000000000000000"></A> <A NAME="MMAstart"></A>
<BR>
MmaStart
2006-11-10 08:07:56 +00:00
</H1>
<P>
2007-04-29 06:47:40 +00:00
If you wish to process a certain file or files before your main input
file, set the M<SMALL>MA</SMALL>S<SMALL>TART</SMALL> filename in an RCFile. For example, you
might have a number of files in a directory which you wish to use
certain P<SMALL>AN</SMALL> settings. In that directory, you just need to have
a file <TT><B>mmarc</B></TT> which contains the following command:
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>MmaStart setpan </B>
2006-11-10 08:07:56 +00:00
2007-04-29 06:47:40 +00:00
</td></tr>
</Table>
<P>
The actual file <TT><B>setpan</B></TT> has the following directives:
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>Bass Pan 0
<BR>
Bass1 Pan 0
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
Bass2 Pan 0
<BR>
Walk Pan 0
<BR>
Walk1 Pan 0
<BR>
Walk2 Pan 0 </B>
2006-11-10 08:07:56 +00:00
2007-04-29 06:47:40 +00:00
</td></tr>
</Table>
<P>
So, before each file in that directory is processed, the P<SMALL>AN</SMALL>
for the bass and walking bass voices are set to the left channel.
<P>
If the file specified by a M<SMALL>MA</SMALL>S<SMALL>TART</SMALL> directive does not exist a
warning message will be printed (this is not an error).
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
Also useful is the ability to include a generic file with all the MIDI
files you create. For example, you might like to have a MIDI reset at the
start of your files--simple, just include the following in your <TT><B>mmarc</B></TT> file:
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>MMAstart reset </B>
2006-11-10 08:07:56 +00:00
2007-04-29 06:47:40 +00:00
</td></tr>
</Table>
<P>
This includes the file <TT><B>reset.mma</B></TT> located in the ``includes''
directory (<A HREF="#incpath">IncludePath</A>).
<P>
Multiple MMA<SMALL>START</SMALL> directives are permitted. The files are
processed in the order declared. You can have multiple filenames on a
MMA<SMALL>START</SMALL> line.
<P>
One caution with MMA<SMALL>START</SMALL> files: the file is processed after
the RC file, just before the actual song file.
<P>
<H1><A NAME="SECTION0024110000000000000000"></A> <A NAME="sec-mmaend"></A>
<BR>
MmaEnd
</H1>
<P>
Just the opposite of M<SMALL>MA</SMALL>S<SMALL>TART</SMALL>, this command specifies a file to
be included at the end of a main input file. See the comments above
for more details.
<P>
To continue this example, in your <TT><B>mmarc</B></TT> file you would have:
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>MmaEnd nopan </B>
2006-11-10 08:07:56 +00:00
2007-04-29 06:47:40 +00:00
</td></tr>
</Table>
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
and in the file <TT><B>nopan</B></TT> have:
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>Bass Pan 64
<BR>
Bass1 Pan 64
<BR>
Bass2 Pan 64
<BR>
Walk Pan 64
<BR>
Walk1 Pan 64
<BR>
Walk2 Pan 64 </B>
</td></tr>
</Table>
<P>
If the file specified by a M<SMALL>MA</SMALL>E<SMALL>ND</SMALL> directive does not exist a
warning message will be printed (this is not an error).
<P>
Multiple MMA<SMALL>END</SMALL> directives are permitted and processed in the
order declared. You can have multiple filenames on a MMA<SMALL>END</SMALL> line.
<P>
<H1><A NAME="SECTION0024120000000000000000"></A>
<A NAME="sec-rc"></A>
<BR>
RC Files
2006-11-10 08:07:56 +00:00
</H1>
<P>
2007-04-29 06:47:40 +00:00
When
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> starts it checks for initialization files. Only the first
found file is processed. The following locations/files are checked (in order):
<P>
<OL>
<LI><TT><B>mmarc</B></TT> -- this is a normal file in the current directory.
<P>
</LI>
<LI><TT><B>~/.mmarc</B></TT> -- this is an ``invisible'' file in the users
home directory.
<P>
</LI>
<LI><TT><B>/usr/local/etc/mmarc</B></TT>
<P>
</LI>
<LI><TT><B>/etc/mmarc</B></TT>
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
</LI>
</OL>
2006-11-10 08:07:56 +00:00
2007-04-29 06:47:40 +00:00
<P>
<B> <I>Only the first</I></B> found file will be processed. This means you can
override a ``global'' RC file with a user specific one. If you just
want to override some specific commands you might want to:
<P>
<OL>
<LI>Create the file <TT><B>mmarc</B></TT> in a directory with
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> files,
<P>
</LI>
<LI>As the first line in that file have the command:
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>include <TT><B>~/.mmarc</B></TT> </B>
2006-11-10 08:07:56 +00:00
2007-04-29 06:47:40 +00:00
</td></tr>
</Table>
<P>
to force the inclusion of your global stuff,
<P>
</LI>
<LI>Now, place your directory specific commands in your custom RC file.
</LI>
</OL>
<P>
By default, no RC files are installed. You may want to create an empty
<TT><B>~/.mmarc</B></TT> file to eliminate a warning message.
<P>
An alternate method for using a different RC file is to specify the
name of the file on the command line by using the <I>-i</I> option
<A HREF="node2.html#i-option">(here)</A>. Using this option
you can have several RC files in a directory and complile your songs
differently depending on the RC file you specify.
<P>
The RC file is processed as a
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> input file. As such, it can
contain anything a normal input file can, including music commands.
However, you should limit the contents of RC files to things
like:
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>SetOutPath
<BR>
SetLibPath
<BR>
MMAStart
<BR>
MMAEnd </B>
</td></tr>
</Table>
<P>
A useful setup is to have your source files in one directory and MIDI
files saved into a different directory. Having the file <TT><B>mmarc</B></TT>
in the directory with the source files permits setting O<SMALL>UT</SMALL>P<SMALL>ATH</SMALL>
to the MIDI path.
<P>
<H1><A NAME="SECTION0024130000000000000000"></A> <A NAME="lib-files"></A>
<BR>
Library Files
</H1>
<P>
Included in this distribution are a number of predefined patterns,
sequences and grooves. They are in different files in the ``lib''
directory.
<P>
The library files should be self-documenting. A list of standard file
and the grooves they define is included in the separate document,
supplied in this distribution as ``<TT><B>mma-lib.ps</B></TT>''.
<P>
<H2><A NAME="SECTION0024131000000000000000"></A> <A NAME="library-maint"></A>
<BR>
Maintaining and Using Libraries
</H2>
<P>
The basic
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> distribution comes with a set of pattern files which
are installed in the <TT><B>mma/lib/stdlib</B></TT> directory. Each one of
these files has a number of G<SMALL>ROOVE</SMALL>s defined in them. For
example, the file <TT><B>mma/lib/stdlib/rhumba.mma</B></TT> contains the
grooves <I>Rhumba</I>, <I>RhumbaEnd</I> and many more.
<P>
If you are writing G<SMALL>ROOVE</SMALL>s with the intention of adding them to
the standard library you should ensure that none of the names you
choose duplicate existing names already used.
<P>
If you are creating a set of alternate grooves to duplicate the
existing library you might do the following:
<P>
<OL>
<LI>Create a directory with your name or other short id in the
<TT><B>mma/lib/</B></TT> hierarchy. For example, if your name is ``Bob van
der Poel'' you might create the directory <TT><B>mma/lib/bvdp</B></TT>.
<P>
</LI>
<LI>Place all your files (or modified files) in that directory.
<P>
</LI>
<LI>Now, when your song wants to use a groove, you have two choices:
<P>
<OL>
<LI>Include the file with the U<SMALL>SE</SMALL> directive. For example,
if you have created the file <TT><B>rock.mma</B></TT> and want to use the
<SMALL>GROOVE</SMALL> <I>rock8</I> you would:
<P>
<OL>
<LI>place the directive U<SMALL>SE BVDP/ROCK</SMALL> near the top of the
song file. Note: it might not be apparent from the typeface here, but the
filename here is all <I>lowercase</I>. In Unix/Linux case is important, so
please make sure of the case of the filenames in commands like U<SMALL>SE</SMALL>.
<P>
</LI>
<LI>enable the groove with the directive G<SMALL>ROOVE ROCK8</SMALL> (and here the
case is not important since
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> thinks that upper and lower case are the same).
<P>
</LI>
</OL>
<P>
</LI>
<LI>Force
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> to use <I>your</I> groove directory by resetting
the auto-lib directory (again, the case for the path is important):
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>SetAutoLibPath bvdp </B>
</td></tr>
</Table>
<P>
You will have to update the
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> database with the -g or -G
command line options for this to work. If you elect this route,
please note that the files in the standard library will not be
available, but you can use both with something like this:
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
<B>Groove Metronome2-4
<BR>
z * 2
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
SetAutoLibPath bvdp
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
Groove BossaNova // the bossa from lib/bvdp, not stdlib!
2006-11-10 08:07:56 +00:00
<BR>
2007-04-29 06:47:40 +00:00
chords... </B>
2006-11-10 08:07:56 +00:00
2007-04-29 06:47:40 +00:00
</td></tr>
</Table>
<P>
The nice thing about this method is that you can have multiple
sets of library files <I>all using the same G<SMALL>ROOVE</SMALL>
names</I>. To create a different version you just need to change
the S<SMALL>ET</SMALL>A<SMALL>UTO</SMALL>L<SMALL>IB</SMALL>P<SMALL>ATH</SMALL> variable in your song file ...or,
for a collection of songs put the variable in your <SMALL>MMARC</SMALL>
file.
<P>
</LI>
</OL>
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
</LI>
</OL>
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
For those who ``really need to know'', here are the steps that
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> takes when it encounters a G<SMALL>ROOVE</SMALL> command:
<P>
<OL>
<LI>if the named groove has been loaded/created already
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> just
switches to the internal version of that groove.
<P>
</LI>
<LI>if the groove can't be found in memory, a search of the groove
database (created with the -g command line option) is done. If no
database is in memory it is loaded from the directory pointed to by
the L<SMALL>IB</SMALL>P<SMALL>ATH</SMALL> and A<SMALL>UTO</SMALL>L<SMALL>IB</SMALL>P<SMALL>ATH</SMALL> variables. This database
is then searched for the needed G<SMALL>ROOVE</SMALL>. The database contains
the filenames associated with each G<SMALL>ROOVE</SMALL> and that file is
then read with the U<SMALL>SE</SMALL> code.
<P>
</LI>
</OL>
<P>
The database is a file <TT><B>.mmaDB</B></TT> stored in each sub directory of
L<SMALL>IB</SMALL>P<SMALL>ATH</SMALL>. This is a ``hidden'' file (due to the leading ``.'' in
the filename). You cannot change the name of this file. If there are
sub-directories the entries for them will be stored in the database
file for the main tree.
<P>
By using a <SMALL>USE</SMALL> directive or by resetting A<SMALL>UTO</SMALL>L<SMALL>IB</SMALL>D<SMALL>IR</SMALL> you
force the loading of your set of grooves.
<P>
<H1><A NAME="SECTION0024140000000000000000"></A>
<A NAME="window-paths"></A>
<BR>
Paths on Windows Platforms
</H1>
<P>
To make
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> as platform independent as possible a number of additional paths have been
defined. When starting up, in addition to the standard Linux paths discussed above, the
following are also checked:
<P>
<UL>
<LI>Modules can be in <TT><B>c:
<BR>
mma</B></TT>,
</LI>
<LI>Include files can be in <TT><B>c:
<BR>
mma
<BR>
includes</B></TT>,
</LI>
<LI>Library files can be in <TT><B>c:
<BR>
mma
<BR>
lib</B></TT>.
<P>
</LI>
</UL>
2006-11-10 08:07:56 +00:00
<P>
<HR>
<!--Navigation Panel-->
2007-04-29 06:47:40 +00:00
<A NAME="tex2html708"
2006-11-10 08:07:56 +00:00
HREF="node25.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
2007-04-29 06:47:40 +00:00
<A NAME="tex2html706"
2006-11-10 08:07:56 +00:00
HREF="mma.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
2007-04-29 06:47:40 +00:00
<A NAME="tex2html700"
2006-11-10 08:07:56 +00:00
HREF="node23.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<BR>
2007-04-29 06:47:40 +00:00
<B> Next:</B> <A NAME="tex2html709"
HREF="node25.html">Creating Effects</A>
<B> Up:</B> <A NAME="tex2html707"
2006-11-10 08:07:56 +00:00
HREF="mma.html">Reference Manual</A>
2007-04-29 06:47:40 +00:00
<B> Previous:</B> <A NAME="tex2html701"
HREF="node23.html">Documentation Strings</A>
2006-11-10 08:07:56 +00:00
<!--End of Navigation Panel-->
<ADDRESS>
2007-04-29 06:47:40 +00:00
bob
2007-03-07
2006-11-10 08:07:56 +00:00
</ADDRESS>
</BODY>
</HTML>