VocalEasel/mma/docs/html/ref/node12.html

327 lines
9.4 KiB
HTML
Raw Normal View History

2009-05-17 22:34:44 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2006-11-10 08:07:56 +00:00
<!--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>
2009-05-17 22:34:44 +00:00
<TITLE>Randomizing</TITLE>
<META NAME="description" CONTENT="Randomizing">
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="node13.html">
<LINK REL="previous" HREF="node11.html">
<LINK REL="up" HREF="mma.html">
<LINK REL="next" HREF="node13.html">
</HEAD>
<BODY bgcolor="#ffffff">
2009-05-17 22:34:44 +00:00
<DIV CLASS="navigation"><!--Navigation Panel-->
<A NAME="tex2html517"
2006-11-10 08:07:56 +00:00
HREF="node13.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
2009-05-17 22:34:44 +00:00
<A NAME="tex2html515"
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>
2009-05-17 22:34:44 +00:00
<A NAME="tex2html509"
2006-11-10 08:07:56 +00:00
HREF="node11.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<BR>
2009-05-17 22:34:44 +00:00
<B> Next:</B> <A NAME="tex2html518"
HREF="node13.html">Chord Voicing</A>
<B> Up:</B> <A NAME="tex2html516"
2006-11-10 08:07:56 +00:00
HREF="mma.html">Reference Manual</A>
2009-05-17 22:34:44 +00:00
<B> Previous:</B> <A NAME="tex2html510"
2007-04-29 06:47:40 +00:00
HREF="node11.html">Automatic Melodies: Aria Tracks</A>
2006-11-10 08:07:56 +00:00
<BR>
2009-05-17 22:34:44 +00:00
<BR></DIV>
2006-11-10 08:07:56 +00:00
<!--End of Navigation Panel-->
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
2009-05-17 22:34:44 +00:00
<UL CLASS="ChildLinks">
<LI><A NAME="tex2html519"
HREF="node12.html#SECTION001210000000000000000">RndSeed</A>
<LI><A NAME="tex2html520"
HREF="node12.html#SECTION001220000000000000000">RSkip</A>
<LI><A NAME="tex2html521"
HREF="node12.html#SECTION001230000000000000000">RTime</A>
<LI><A NAME="tex2html522"
HREF="node12.html#SECTION001240000000000000000">Other Randomizing Commands</A>
2006-11-10 08:07:56 +00:00
</UL>
<!--End of Table of Child-Links-->
<HR>
<H1><A NAME="SECTION001200000000000000000"></A>
2009-05-17 22:34:44 +00:00
<A NAME="sec-randomizing"></A>
2006-11-10 08:07:56 +00:00
<BR>
2009-05-17 22:34:44 +00:00
Randomizing
2006-11-10 08:07:56 +00:00
</H1>
<P>
2009-05-17 22:34:44 +00:00
One criticism of computer generated music is that all to often it's
too predictable or mechanical sounding. Again, in
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> we're not
trying to replace real, flesh and blood musicians, but applying some
randomization to the way in which tracks are generated can help bridge
the human--mechanical gap.
2007-04-29 06:47:40 +00:00
<P>
<H1><A NAME="SECTION001210000000000000000">
2009-05-17 22:34:44 +00:00
RndSeed</A>
2007-04-29 06:47:40 +00:00
</H1>
<P>
2009-05-17 22:34:44 +00:00
All of the random functions (R<SMALL>TIME</SMALL>, R<SMALL>SKIP</SMALL>, etc.) in
2007-04-29 06:47:40 +00:00
2009-05-17 22:34:44 +00:00
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> depend on the <SPAN CLASS="textit">Python random</SPAN> module. Each time
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> generates a track the values generated by the random functions will be
different. In most cases this is a ``good thing''; however, you may
want
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> to use the same sequence of random values<A NAME="tex2html45"
HREF="#foot4870"><SUP><SPAN CLASS="arabic">12</SPAN>.<SPAN CLASS="arabic">1</SPAN></SUP></A> each time it generates a
track. Simple: just use:
2007-04-29 06:47:40 +00:00
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
2009-05-17 22:34:44 +00:00
<B>RndSeed 123.56 </B>
2007-04-29 06:47:40 +00:00
</td></tr>
</Table>
<P>
2009-05-17 22:34:44 +00:00
at the top of your song file. You can use any value you want: it
really doesn't make any difference, but different values will generate
different sequences.
2007-04-29 06:47:40 +00:00
<P>
2009-05-17 22:34:44 +00:00
You can also use this with no value, in which case Python uses its own
value (see the Python manual for details). Essentially, using no value
undoes the effect which permits the mixing of random and not-so-random
sections in the same song.
2007-04-29 06:47:40 +00:00
<P>
2009-05-17 22:34:44 +00:00
One interesting use of R<SMALL>ND</SMALL>S<SMALL>EED</SMALL> could be to ensure that a
repeated section is identical: simply start the section with something
like:
2007-04-29 06:47:40 +00:00
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
2009-05-17 22:34:44 +00:00
<B>Repeat
2007-04-29 06:47:40 +00:00
<BR>
2009-05-17 22:34:44 +00:00
RndSeed 8
<BR> ...chords </B>
2007-04-29 06:47:40 +00:00
</td></tr>
</Table>
<P>
2009-05-17 22:34:44 +00:00
It is highly recommended that you <SPAN CLASS="textit">do not</SPAN> use this command in
library files.
2007-04-29 06:47:40 +00:00
<P>
2009-05-17 22:34:44 +00:00
<H1><A NAME="SECTION001220000000000000000"></A> <A NAME="rskip"></A>
2007-04-29 06:47:40 +00:00
<BR>
2009-05-17 22:34:44 +00:00
RSkip
</H1>
2007-04-29 06:47:40 +00:00
<P>
2009-05-17 22:34:44 +00:00
To aid in creating syncopated sounding patterns, you can use the
RS<SMALL>KIP</SMALL> directive to randomly silence or skip notes. The command
takes a value in the range 0 to 99. The ``0'' argument disables
skipping. For example:
2007-04-29 06:47:40 +00:00
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
2009-05-17 22:34:44 +00:00
<B>Begin Drum
<BR>&nbsp;&nbsp;&nbsp;&nbsp;Define D1 1 0 90
<BR>&nbsp;&nbsp;&nbsp;&nbsp;Define D8 D1 * 8
<BR>&nbsp;&nbsp;&nbsp;&nbsp;Sequence D8
<BR>&nbsp;&nbsp;&nbsp;&nbsp;Tone OpenHiHat
<BR>&nbsp;&nbsp;&nbsp;&nbsp;RSkip 40
2007-04-29 06:47:40 +00:00
<BR>
2009-05-17 22:34:44 +00:00
End </B>
2007-04-29 06:47:40 +00:00
</td></tr>
</Table>
<P>
2009-05-17 22:34:44 +00:00
In this case a drum pattern has been defined to hit short
``OpenHiHat'' notes 8 per bar. The RS<SMALL>KIP</SMALL> argument of ``40''
causes the note to be NOT sounded (randomly) only 40% of the time.
2007-04-29 06:47:40 +00:00
<P>
2009-05-17 22:34:44 +00:00
Using a value of ``10'' will cause notes to be skipped 10% of the
time (they are played 90% of the time), ``90'' means to skip the
notes 90% of the time, etc.
2007-04-29 06:47:40 +00:00
<P>
2009-05-17 22:34:44 +00:00
You can specify a different RS<SMALL>KIP</SMALL> for each bar in a sequence.
2007-04-29 06:47:40 +00:00
Repeated values can be represented with a ``/'':
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
2009-05-17 22:34:44 +00:00
<B>Scale RSkip 40 90 / 40 </B>
2007-04-29 06:47:40 +00:00
</td></tr>
</Table>
<P>
2009-05-17 22:34:44 +00:00
If you use the RS<SMALL>KIP</SMALL> in a chord track, the entire chord
<SPAN CLASS="textit">will not</SPAN> be silenced. The option will be applied to the
individual notes of each chord. This may or may not be what you are
after. You cannot use this option to generate entire chords randomly.
For this effect you need to create several chord patterns and select
them with S<SMALL>EQ</SMALL>R<SMALL>ND</SMALL>.
2007-04-29 06:47:40 +00:00
<P>
2009-05-17 22:34:44 +00:00
<H1><A NAME="SECTION001230000000000000000"></A> <A NAME="rtime"></A>
2007-04-29 06:47:40 +00:00
<BR>
2009-05-17 22:34:44 +00:00
RTime
</H1>
2007-04-29 06:47:40 +00:00
<P>
2009-05-17 22:34:44 +00:00
One of the biggest problem with computer generated drum and rhythm
tracks is that, unlike real musicians, the beats are precise and ``on
the beat''. The RT<SMALL>IME</SMALL> directive attempts to solve this.
2006-11-10 08:07:56 +00:00
<P>
2009-05-17 22:34:44 +00:00
The command can be applied to all tracks.
2007-04-29 06:47:40 +00:00
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
2009-05-17 22:34:44 +00:00
<B>Drum-4 Rtime 4 </B>
2007-04-29 06:47:40 +00:00
</td></tr>
</Table>
2006-11-10 08:07:56 +00:00
<P>
2009-05-17 22:34:44 +00:00
The value passed to the RT<SMALL>IME</SMALL> directive is the number of MIDI ticks
with which to vary the start time of the notes. For example, if you
specify ``5'' the start times will vary from -5 to +5 ticks) on each
note for the specified track. There are 192 MIDI ticks in each quarter
note.
2006-11-10 08:07:56 +00:00
<P>
2009-05-17 22:34:44 +00:00
Any value from 0 to 100 can be used; however values in the range 0 to
10 are most commonly used. Exercise caution in using large values!
2006-11-10 08:07:56 +00:00
<P>
2009-05-17 22:34:44 +00:00
You can specify a different RT<SMALL>IME</SMALL> for each bar in a sequence.
Repeated values can be represented with a ``/'':
2007-04-29 06:47:40 +00:00
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
2009-05-17 22:34:44 +00:00
<B>Chord RTime 4 10 / 4 </B>
2007-04-29 06:47:40 +00:00
</td></tr>
</Table>
<P>
2009-05-17 22:34:44 +00:00
R<SMALL>TIME</SMALL> is guaranteed never to start a note before the start of a
bar.
2007-04-29 06:47:40 +00:00
<P>
2009-05-17 22:34:44 +00:00
<H1><A NAME="SECTION001240000000000000000">
Other Randomizing Commands</A>
2007-04-29 06:47:40 +00:00
</H1>
<P>
2009-05-17 22:34:44 +00:00
In addition to the above, the following commands should be examined:
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
<UL>
2009-05-17 22:34:44 +00:00
<LI><A HREF="node11.html#chap-aria">Aria</A> tracks
have a ``r'' option for the movement direction.
2006-11-10 08:07:56 +00:00
<P>
2007-04-29 06:47:40 +00:00
</LI>
2009-05-17 22:34:44 +00:00
<LI>The track <A HREF="node23.html#scale-direction">Direction</A> command has a ``random'' option for playing scales,
arpeggios, and other tracks.
2007-04-29 06:47:40 +00:00
<P>
</LI>
2009-05-17 22:34:44 +00:00
<LI><A HREF="node17.html#rvolume">R<SMALL>VOLUME</SMALL></A> makes random adjustments to the volume of each note.
2007-04-29 06:47:40 +00:00
<P>
</LI>
2009-05-17 22:34:44 +00:00
<LI>The <A HREF="node13.html#voice-rmove">V<SMALL>OICING</SMALL></A> command has an RM<SMALL>OVE</SMALL> option.
2007-04-29 06:47:40 +00:00
<P>
</LI>
2009-05-17 22:34:44 +00:00
<LI><A HREF="node19.html#rndset">R<SMALL>ND</SMALL>S<SMALL>ET</SMALL></A>
lets you set a variable to a random value.
2007-04-29 06:47:40 +00:00
<P>
</LI>
2009-05-17 22:34:44 +00:00
<LI><A HREF="node5.html#seqrnd">SeqRnd</A>
enables randomization of sequences; this randomization can be
fine-tuned with the <A HREF="node5.html#seqrndweight">SeqRndWeight</A> command.
2007-04-29 06:47:40 +00:00
<P>
</LI>
</UL>
<P>
<BR><HR><H4>Footnotes</H4>
<DL>
2009-05-17 22:34:44 +00:00
<DT><A NAME="foot4870">... values</A><A
HREF="node12.html#tex2html45"><SUP><SPAN CLASS="arabic">12</SPAN>.<SPAN CLASS="arabic">1</SPAN></SUP></A></DT>
<DD>Yes,
this is a contradiction of terms.
2007-04-29 06:47:40 +00:00
</DD>
2009-05-17 22:34:44 +00:00
</DL>
<DIV CLASS="navigation"><HR>
2006-11-10 08:07:56 +00:00
<!--Navigation Panel-->
2009-05-17 22:34:44 +00:00
<A NAME="tex2html517"
2006-11-10 08:07:56 +00:00
HREF="node13.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
2009-05-17 22:34:44 +00:00
<A NAME="tex2html515"
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>
2009-05-17 22:34:44 +00:00
<A NAME="tex2html509"
2006-11-10 08:07:56 +00:00
HREF="node11.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<BR>
2009-05-17 22:34:44 +00:00
<B> Next:</B> <A NAME="tex2html518"
HREF="node13.html">Chord Voicing</A>
<B> Up:</B> <A NAME="tex2html516"
2006-11-10 08:07:56 +00:00
HREF="mma.html">Reference Manual</A>
2009-05-17 22:34:44 +00:00
<B> Previous:</B> <A NAME="tex2html510"
HREF="node11.html">Automatic Melodies: Aria Tracks</A></DIV>
2006-11-10 08:07:56 +00:00
<!--End of Navigation Panel-->
<ADDRESS>
2007-04-29 06:47:40 +00:00
bob
2009-05-17 22:34:44 +00:00
2008-09-28
2006-11-10 08:07:56 +00:00
</ADDRESS>
</BODY>
</HTML>