Skip to content

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:

The Elder Scrolls V: Skyrim theme song

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

Surprise ;)

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

Unnamed...sounds like a retro ringtone of some kind

+CEGECEGEfaCafaCagbDgbDGbCCCCC 0.05

European siren

ECECECEC 0.6

Meet the Flintstones (a.k.a. GRAND DAD)

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

Route 1 - Pokémon Red/Blue/Yellow

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