-
Notifications
You must be signed in to change notification settings - Fork 6
Examples for playnotes.c
flarn2006 edited this page Apr 23, 2017
·
13 revisions
playnotes.c
is a small program which plays a string of notes given on the command line. The syntax is simple: letters a
through g
(uppercase is one octave higher) represent notes, +
and -
go up and down octaves respectively, and any other character (use .
; it's the only one guaranteed not to do something else in the future) will pause for the length of one note. The length of each note in seconds can be specified in an additional command line parameter. Feel free to add more.
To try these examples, just use the entire string as the command line parameters for playnotes
:
fef...fef...feg.f.e.d...dcd...dcd...cde.f.c.d...fef.f.fga.a.aCg.g.fed...dcd...dcd...cde.f.c.d 0.15
cdfda..a..g.....cdecg..g..f..ed.cdfdf...g.e..dc...c.g...f.......cdfda..a..g.....cdecC...e.f..ed.cdfdf...g.e..dc...c.g.f.f 0.125
+CEGECEGEfaCafaCagbDgbDGbCCCCC 0.05
ECECECEC 0.6
g.c..C.ag.c..g.feefgc.d.e.......g.c..C.ag.c..g.feefgc.d.c.......b.e..C.bbaaba...a.d..b.aaggag...g.c..C.ag.c..g.feefgc.d..efgc.d..efgC.D.C 0.2
CDE.E.E.CDE.E.E.CDE.E.F..ED.....bCD.D.D.bCD.D.D.bCD.D.EDDEC...E.CDE.E.E.CDE.E.E.CDE.E.F..ED.....bCD.F.E.D.C.b.a.C.A...D..FE.....+efg.g.e.c.C.b.a.C.g.e.c..ed.....efg.g.e.g.C.b.a..fg.C.b.D.C...c. 0.12