00001 #include "MusimatChapter9.h" 00002 MusimatChapter9Section(C091405) { 00003 Print("*** 9.14.5 Generating Outcomes from Probability Distributions ***"); 00004 /***************************************************************************** 00005 00006 9.14.5 Generating Outcomes from Probability Distributions 00007 00008 Probability distributions allow us to analyze random systems like dice and coins, but we can also 00009 use them to synthesize random numbers that are distributed in probability according to our choos- 00010 ing. We can use such systems to drive compositional processes to automatically generate music 00011 according to rules that we supply. 00012 00013 Say, for instance, we wish to use a random system to create a melody so that it favors lower 00014 pitches in the scale. Let's limit the sample space to one octave of the chromatic scale. We can rep- 00015 resent this as a probability inequality: 00016 00017 f (x) == P( R = C ) > P(R = C#) > P(R = D) > . . . > P(R = B). 00018 00019 To be specific, suppose we want to create a probability distribution function that is 12 times more 00020 likely to pick C than B, 11 times more likely to pick C# than B, 10 times more likely to pick D than 00021 B, and so on. The probability distribution function would look like the one in figure 9.20. 00022 00023 We know what we want, but how do we get it? So far, the only things we have to work with are 00024 a random number generator, Random() (see appendix B, B.1.27) and a probability distribution 00025 function (figure 9.21). 00026 00027 *****************************************************************************/ 00028 } 00029 00031 /* $Revision: 1.2 $ $Date: 2006/09/05 06:32:02 $ $Author: dgl $ $Name: $ $Id: C091405.cpp,v 1.2 2006/09/05 06:32:02 dgl Exp $ */ 00032 // The Musimat Tutorial © 2006 Gareth Loy 00033 // Derived from Chapter 9 and Appendix B of "Musimathics Vol. 1" © 2006 Gareth Loy 00034 // and published exclusively by The MIT Press. 00035 // This program is released WITHOUT ANY WARRANTY; without even the implied 00036 // warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00037 // For information on usage and redistribution, and for a DISCLAIMER OF ALL 00038 // WARRANTIES, see the file, "LICENSE.txt," in this distribution. 00039 // "Musimathics" is available here: http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&tid=10916 00040 // Gareth Loy's Musimathics website: http://www.musimathics.com/ 00041 // The Musimat website: http://www.musimat.com/ 00042 // This program is released under the terms of the GNU General Public License 00043 // available here: http://www.gnu.org/licenses/gpl.txt 00044