Next Previous Contents

4. Editting Playlist

This section explains how to edit the playlist and some rules and syntaxes of scription.

 

Songs

Playlist can have more than one songs. We call song for one sequence of music here. Each songs are separated with ';'. Plus you can put comments with using "//" just like C++

// play list is written like this

song1 = ( some pattern);

song2 = ( some pattern);

Inside of the parenthesis, some of Pattern Objects are scripted there. And those Pattern Objects are separated by ';' For example, song1 = ( pat1; pat2;);

4.2 Pattern Objects

Each song will be treated as a tree of Pattern objects. There are some variety of Pattern Objects. Pattern objects are listed inside of
  • Pattern
  • Note
  • Rest
  • RandomRest
  • MultiPattern
  • ProbabilityPattern

    Pattern is a super set of every objects.

    Note is as a name of sound file you want to play. The sound file must be 22050 Hz sampling rate and 16 bit monoral sound wave file. The name is surrounded by double quotation '"'. For example,

    
    mysound = ( "hoge.wav");

    Rest is a number of milli second to delay. For example,
    
    myrest=(1000);
    
    
    means that waiting for 1 second and play no sound during the term. RandomRest has 2 numbers, num_max and num_min, and "to." RandomRest takes a number between num_max and num_min randomly. For example,
    
    myrandrest= ( 1000to2000);
    
    
    In this case num_min is 1000 and num_max is 2000. Threfore myrandrest waits for a random number of milli seconds between 1000to2000.

    MultiPattern involves more than 2 Patterns. Each Patterns are separated by ','. For example

    
    mymulti = ( pat1, pat2, pat3);
    
    
    ProbabilityPattern is kind of MultiPattern but it picks up only one pattern with probability. For example,
    
    myprobpat = ( pat1 : pat2 : pat3 = 1 : 2 : 3);
    
    
    means that myprobpat plays pat1 with 1/6 probability, pat2 with 2/6=1/3 probability and pat3 with 3/6=1/2 probability

    4.3 _main

    Here I describe "_main" statement with a simple example. The parenthesis connected with "_main =" is the place to script your sound pattern. Let mylist.txt have this scriptions
    
    // mylist.txt
    
    song1 = (
    
    	begin	= "begin.wav";
    
    	rest	= 100;
    
    	last	= "last.wav";
    
    	_main	= ( begin, rest, last, rest
    
    );
    
    song2 = ( _main = ( rest, last, rest, begin););
    
    
    In this case, song1 plays "begin.wav", silence 100 ms, "last.wav" and silence 100 ms. And song2 plays 100 ms silence, "last.wav", 100 ms silence and "begin.wav."

    4.4 _param

    We can write 3 parameters in parenthesis of _param=( timesplay, angle, distance). Note that you can't write any pattern objects here. For example you can't write like
    
    dist = ( 100 to 200);
    
    _param = ( 10to20, 70, dist);
    
    
    You can only write direct number in the _pram parenthesis except _infinite described below.

    First number is number of repetition to play _main. If you write "_infinite", the loop will run infinite times.

    2nd one represents the angle of the sound source in degrees. Front is 0, right is 90, back is 180 and left is 270.

    3rd parameter of the parameter is the distance to the sound source. The distance takes 0 to 255. 255 is farest and 0 is closest.


    Next Previous Contents