Changeset 497

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

two different instruments

Files:

Legend:

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

    r496 r497  
    66                                                    (Time.Seconds 0.01);; 
    77 
    8 let sf amp tone = Envelope.apply env (Wave.tri amp tone);; 
     8let sf wave amp tone = Envelope.apply env (wave amp tone);; 
    99   
    1010 
    11 let instrument = Instrument.from_sound_function sf;;  
     11let instrument1 = Instrument.from_sound_function (sf Wave.tri);;  
     12let instrument2 = Instrument.from_sound_function ~start:6. (sf Wave.square);; 
    1213 
    1314let noteify (t,r,l) = (note t r, l);; 
    1415 
    1516let layer = Layer.empty ();; 
    16 Instrument.add_notes instrument layer 30000. (List.map noteify 
     17Instrument.add_notes instrument1 layer 30000. (List.map noteify 
    1718  [(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);  
     19   (g, 0, 0.5); (a, 0, 0.5); (b, 0, 0.5); (c, 1, 2.5)]);; 
     20 
     21Instrument.add_notes instrument2 layer 30000. (List.map noteify 
     22  [(g, -1, 0.5); (a, -1, 0.5); (b flat, -1, 0.5); (c, 0, 0.5);  
    2023   (d, 0, 0.5); (e flat, 0, 0.5); (f sharp, 0, 0.5); (g, 0, 2.5)]);; 
    2124