Changeset 496

Show
Ignore:
Timestamp:
08/18/07 11:42:12 (1 year ago)
Author:
shans
Message:

Neatened up instrument test

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ocaml-remix/trunk/instrument_test.ml

    r495 r496  
    44 
    55let env = Envelope.adsr (Time.Seconds 0.05) (Time.Seconds 0.1) 0.8  
    6                                                     (Time.Seconds 0.05);; 
     6                                                    (Time.Seconds 0.01);; 
    77 
    88let sf amp tone = Envelope.apply env (Wave.tri amp tone);; 
     
    1111let instrument = Instrument.from_sound_function sf;;  
    1212 
     13let noteify (t,r,l) = (note t r, l);; 
     14 
    1315let layer = Layer.empty ();; 
    14 Instrument.add_notes instrument layer 30000. 
    15   [(note c 0, 0.5); (note d 0, 0.5); (note e 0, 0.5); (note f 0, 0.5);  
    16    (note g 0, 0.5); (note a 0, 0.5); (note b 0, 0.5); (note c 1, 2.5); 
    17    (note g (-1), 0.5); (note a (-1), 0.5); (note (b flat) (-1), 0.5);  
    18    (note c 0, 0.5); (note d 0, 0.5); (note (e flat) 0, 0.5);  
    19    (note (f sharp) 0, 0.5); (note g 0, 2.5)];; 
     16Instrument.add_notes instrument layer 30000. (List.map noteify 
     17  [(c, 0, 0.5); (d, 0, 0.5); (e, 0, 0.5); (f, 0, 0.5);  
     18   (g, 0, 0.5); (a, 0, 0.5); (b, 0, 0.5); (c, 1, 2.5); 
     19   (g, -1, 0.5); (a, -1, 0.5); (b flat, -1, 0.5); (c, 0, 0.5);  
     20   (d, 0, 0.5); (e flat, 0, 0.5); (f sharp, 0, 0.5); (g, 0, 2.5)]);; 
    2021 
    2122let sound = Layer.to_sound layer;;