# A # sign followed by a space, is a comment. # Unindented words are section names defs # Indented text belongs to its containing section # Assignment is global with '=' and local with ':=' # Arithmetic available in assignment and function definitions is # + - / * and ** (exponent) # Note volume can be assigned to as a global or local variable # This may require adjustment depending on your audio output settings volume = 0.05 # And frequency can be computed based on a base value base = 61 a = 0 b = 1 c = 2 d = 3 e = 4 f = 5 # one-liner functions can be defined as so (this one's local, with '; ' separated substatements) computeit := fn x := start + 4; y := x; y # and called as so g = call computeit with start := 3 score # Each note in this score will be a quarter second long. length := 1 / 4 # Bare variables in sections are played as notes, by default relative to the base note. a b c d a a b e e f g g d # Plain frequencies can be played as well convertnotes := 0 relative := 0 440 playmelater a a b a a b a a e a a a a main # scores can be played immediately play defs # Multiple times play score 3 times # Or scheduled for the future (in 10 seconds, offset from now) play playmelater in 10 # Or based on an absolute offset play playmelater 3 times at 20 # and finally, you can insert delays into scores with wait 10