VocalEasel/mma/docs/html/ref/node13.html

347 lines
10 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
2011-07-26 22:49:39 +00:00
<!--Converted with LaTeX2HTML 2008 (1.71)
2006-11-10 08:07:56 +00:00
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>
2011-07-26 22:49:39 +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">
2011-07-26 22:49:39 +00:00
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META NAME="Generator" CONTENT="LaTeX2HTML v2008">
2006-11-10 08:07:56 +00:00
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="mma.css">
<LINK REL="next" HREF="node14.html">
<LINK REL="previous" HREF="node12.html">
<LINK REL="up" HREF="mma.html">
<LINK REL="next" HREF="node14.html">
</HEAD>
<BODY bgcolor="#ffffff">
2009-05-17 22:34:44 +00:00
<DIV CLASS="navigation"><!--Navigation Panel-->
2011-07-26 22:49:39 +00:00
<A NAME="tex2html591"
2006-11-10 08:07:56 +00:00
HREF="node14.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
2011-07-26 22:49:39 +00:00
<A NAME="tex2html589"
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>
2011-07-26 22:49:39 +00:00
<A NAME="tex2html583"
2006-11-10 08:07:56 +00:00
HREF="node12.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<BR>
2011-07-26 22:49:39 +00:00
<B> Next:</B> <A NAME="tex2html592"
HREF="node14.html">Chord Voicing</A>
<B> Up:</B> <A NAME="tex2html590"
2006-11-10 08:07:56 +00:00
HREF="mma.html">Reference Manual</A>
2011-07-26 22:49:39 +00:00
<B> Previous:</B> <A NAME="tex2html584"
HREF="node12.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">
2011-07-26 22:49:39 +00:00
<LI><A NAME="tex2html593"
HREF="node13.html#SECTION001310000000000000000">RndSeed</A>
<LI><A NAME="tex2html594"
HREF="node13.html#SECTION001320000000000000000">RSkip</A>
<LI><A NAME="tex2html595"
HREF="node13.html#SECTION001330000000000000000">RTime</A>
<LI><A NAME="tex2html596"
HREF="node13.html#SECTION001340000000000000000">Other Randomizing Commands</A>
2006-11-10 08:07:56 +00:00
</UL>
<!--End of Table of Child-Links-->
<HR>
<H1><A NAME="SECTION001300000000000000000"></A>
2011-07-26 22:49:39 +00:00
<A NAME="sec-randomizing"></A>
2006-11-10 08:07:56 +00:00
<BR>
2011-07-26 22:49:39 +00:00
Randomizing
2006-11-10 08:07:56 +00:00
</H1>
<P>
2011-07-26 22:49:39 +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.
2009-05-17 22:34:44 +00:00
<P>
<H1><A NAME="SECTION001310000000000000000">
2011-07-26 22:49:39 +00:00
RndSeed</A>
2009-05-17 22:34:44 +00:00
</H1>
<P>
2011-07-26 22:49:39 +00:00
All of the random functions (R<SMALL>TIME</SMALL>, R<SMALL>SKIP</SMALL>, etc.) in
2006-11-10 08:07:56 +00:00
2011-07-26 22:49:39 +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 &#8220;good thing&#8221;; however, you may
want
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> to use the same sequence of random values<A NAME="tex2html52"
HREF="#foot5824"><SUP><SPAN CLASS="arabic">13</SPAN>.<SPAN CLASS="arabic">1</SPAN></SUP></A> each time it generates a
track. Simple: just use:
2006-11-10 08:07:56 +00:00
<P>
2009-05-17 22:34:44 +00:00
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
2011-07-26 22:49:39 +00:00
<B>RndSeed 123.56 </B>
2009-05-17 22:34:44 +00:00
</td></tr>
</Table>
2006-11-10 08:07:56 +00:00
<P>
2011-07-26 22:49:39 +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.
2009-05-17 22:34:44 +00:00
<P>
2011-07-26 22:49:39 +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.
2009-05-17 22:34:44 +00:00
<P>
2011-07-26 22:49:39 +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:
2009-05-17 22:34:44 +00:00
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
2011-07-26 22:49:39 +00:00
<B>Repeat
2009-05-17 22:34:44 +00:00
<BR>
2011-07-26 22:49:39 +00:00
RndSeed 8
<BR> ...chords </B>
2009-05-17 22:34:44 +00:00
</td></tr>
</Table>
2006-11-10 08:07:56 +00:00
<P>
2011-07-26 22:49:39 +00:00
It is highly recommended that you <SPAN CLASS="textit">do not</SPAN> use this command in
library files.
2006-11-10 08:07:56 +00:00
<P>
2011-07-26 22:49:39 +00:00
<H1><A NAME="SECTION001320000000000000000"></A> <A NAME="rskip"></A>
2006-11-10 08:07:56 +00:00
<BR>
2011-07-26 22:49:39 +00:00
RSkip
</H1>
2006-11-10 08:07:56 +00:00
<P>
2011-07-26 22:49:39 +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 &#8220;0&#8221; argument disables
skipping. For example:
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>
2011-07-26 22:49:39 +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
2006-11-10 08:07:56 +00:00
<BR>
2011-07-26 22:49:39 +00:00
End </B>
2009-05-17 22:34:44 +00:00
</td></tr>
</Table>
<P>
2011-07-26 22:49:39 +00:00
In this case a drum pattern has been defined to hit short
&#8220;OpenHiHat&#8221; notes 8 per bar. The RS<SMALL>KIP</SMALL> argument of &#8220;40&#8221;
causes the note to be NOT sounded (randomly) only 40% of the time.
2009-05-17 22:34:44 +00:00
<P>
2011-07-26 22:49:39 +00:00
Using a value of &#8220;10&#8221; will cause notes to be skipped 10% of the
time (they are played 90% of the time), &#8220;90&#8221; means to skip the
notes 90% of the time, etc.
2009-05-17 22:34:44 +00:00
<P>
2011-07-26 22:49:39 +00:00
You can specify a different RS<SMALL>KIP</SMALL> for each bar in a sequence.
Repeated values can be represented with a &#8220;/&#8221;:
2009-05-17 22:34:44 +00:00
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
2011-07-26 22:49:39 +00:00
<B>Scale RSkip 40 90 / 40 </B>
2009-05-17 22:34:44 +00:00
</td></tr>
</Table>
<P>
2011-07-26 22:49:39 +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>.
2009-05-17 22:34:44 +00:00
<P>
2011-07-26 22:49:39 +00:00
<H1><A NAME="SECTION001330000000000000000"></A> <A NAME="rtime"></A>
2006-11-10 08:07:56 +00:00
<BR>
2011-07-26 22:49:39 +00:00
RTime
</H1>
2009-05-17 22:34:44 +00:00
<P>
2011-07-26 22:49:39 +00:00
One of the biggest problem with computer generated drum and rhythm
tracks is that, unlike real musicians, the beats are precise and &#8220;on
the beat&#8221;. The RT<SMALL>IME</SMALL> directive attempts to solve this.
2009-05-17 22:34:44 +00:00
<P>
2011-07-26 22:49:39 +00:00
The command can be applied to all tracks.
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>
2011-07-26 22:49:39 +00:00
<B>Drum-4 Rtime 4 </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>
2011-07-26 22:49:39 +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 &#8220;5&#8221; 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.
2009-05-17 22:34:44 +00:00
<P>
2011-07-26 22:49:39 +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!
2009-05-17 22:34:44 +00:00
<P>
2011-07-26 22:49:39 +00:00
You can specify a different RT<SMALL>IME</SMALL> for each bar in a sequence.
Repeated values can be represented with a &#8220;/&#8221;:
2009-05-17 22:34:44 +00:00
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
2011-07-26 22:49:39 +00:00
<B>Chord RTime 4 10 / 4 </B>
2009-05-17 22:34:44 +00:00
</td></tr>
</Table>
<P>
2011-07-26 22:49:39 +00:00
You can further fine-tune the RT<SMALL>IME</SMALL> settings by using a minimum and
maximum value in the form M<SMALL>INIMUM,</SMALL>M<SMALL>AXIMUM</SMALL>. Note the
<SMALL>COMMA</SMALL>! For example:
2009-05-17 22:34:44 +00:00
<P>
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
<tr><td>
2011-07-26 22:49:39 +00:00
<B>Chord Rtime 0,10 -10,0 -10,20 8 </B>
2009-05-17 22:34:44 +00:00
</td></tr>
</Table>
<P>
2011-07-26 22:49:39 +00:00
Would set different minimum and maximum adjustment values for different sequence
points. In the above example the adjustments would be in the range 0 to
10, -10 to 0, -10 to 20 and -8 to 8.
2009-05-17 22:34:44 +00:00
<P>
2011-07-26 22:49:39 +00:00
R<SMALL>TIME</SMALL> is guaranteed never to start a note before the start of a
bar.
2009-05-17 22:34:44 +00:00
<P>
2011-07-26 22:49:39 +00:00
<H1><A NAME="SECTION001340000000000000000">
Other Randomizing Commands</A>
2009-05-17 22:34:44 +00:00
</H1>
<P>
2011-07-26 22:49:39 +00:00
In addition to the above, the following commands should be examined:
2009-05-17 22:34:44 +00:00
<P>
<UL>
2011-07-26 22:49:39 +00:00
<LI><A HREF="node12.html#chap-aria">Aria</A> tracks
have a &#8220;r&#8221; option for the movement direction.
2009-05-17 22:34:44 +00:00
<P>
</LI>
2011-07-26 22:49:39 +00:00
<LI>The track <A HREF="node24.html#scale-direction">Direction</A> command has a &#8220;random&#8221; option for playing scales,
arpeggios, and other tracks.
2009-05-17 22:34:44 +00:00
<P>
</LI>
2011-07-26 22:49:39 +00:00
<LI><A HREF="node18.html#rvolume">R<SMALL>VOLUME</SMALL></A> makes random adjustments to the volume of each note.
2009-05-17 22:34:44 +00:00
<P>
</LI>
2011-07-26 22:49:39 +00:00
<LI>The <A HREF="node14.html#voice-rmove">V<SMALL>OICING</SMALL></A> command has an RM<SMALL>OVE</SMALL> option.
2009-05-17 22:34:44 +00:00
<P>
</LI>
2011-07-26 22:49:39 +00:00
<LI><A HREF="node20.html#rndset">R<SMALL>ND</SMALL>S<SMALL>ET</SMALL></A>
lets you set a variable to a random value.
2009-05-17 22:34:44 +00:00
<P>
</LI>
2011-07-26 22:49:39 +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.
2009-05-17 22:34:44 +00:00
<P>
</LI>
</UL>
<P>
<BR><HR><H4>Footnotes</H4>
<DL>
2011-07-26 22:49:39 +00:00
<DT><A NAME="foot5824">... values</A><A
HREF="node13.html#tex2html52"><SUP><SPAN CLASS="arabic">13</SPAN>.<SPAN CLASS="arabic">1</SPAN></SUP></A></DT>
<DD>Yes,
this is a contradiction of terms.
2009-05-17 22:34:44 +00:00
</DD>
</DL>
<DIV CLASS="navigation"><HR>
2006-11-10 08:07:56 +00:00
<!--Navigation Panel-->
2011-07-26 22:49:39 +00:00
<A NAME="tex2html591"
2006-11-10 08:07:56 +00:00
HREF="node14.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
2011-07-26 22:49:39 +00:00
<A NAME="tex2html589"
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>
2011-07-26 22:49:39 +00:00
<A NAME="tex2html583"
2006-11-10 08:07:56 +00:00
HREF="node12.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<BR>
2011-07-26 22:49:39 +00:00
<B> Next:</B> <A NAME="tex2html592"
HREF="node14.html">Chord Voicing</A>
<B> Up:</B> <A NAME="tex2html590"
2006-11-10 08:07:56 +00:00
HREF="mma.html">Reference Manual</A>
2011-07-26 22:49:39 +00:00
<B> Previous:</B> <A NAME="tex2html584"
HREF="node12.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
2011-07-26 22:49:39 +00:00
2010-11-07
2006-11-10 08:07:56 +00:00
</ADDRESS>
</BODY>
</HTML>