3pi Tune Library!

Hey guys,

I just thought i’d start a thread for people to post tunes they’ve made their 3pis play :slight_smile:

I’ll start with the fugue included with the demo program…

const char fugue[] PROGMEM = 
  "! T120O5L16agafaea dac+adaea fa<aa<bac#a dac#adaea f"
  "O6dcd<b-d<ad<g d<f+d<gd<ad<b- d<dd<ed<f+d<g d<f+d<gd<ad"
  "L8MS<b-d<b-d MLe-<ge-<g MSc<ac<a MLd<fd<f O5MSb-gb-g"
  "ML>c#e>c#e MS afaf ML gc#gc# MS fdfd ML e<b-e<b-"
  "O6L16ragafaea dac#adaea fa<aa<bac#a dac#adaea faeadaca"
  "<b-acadg<b-g egdgcg<b-g <ag<b-gcf<af dfcf<b-f<af"
  "<gf<af<b-e<ge c#e<b-e<ae<ge <fe<ge<ad<fd"
  "O5e>ee>ef>df>d b->c#b->c#a>df>d e>ee>ef>df>d"
  "e>d>c#>db>d>c#b >c#agaegfe fO6dc#dfdc#<b c#4";

:slight_smile:

–neg

This sounds like fun. I hope other musically inclined 3pi users out there contribute to this!

- Ben

Great idea! Here is Franz Lizst’s Hungarian Rhapsody No. 2, which is included in the Pololu Library demo code for the Orangutan LV-xx8 and SV-xx8:

const char rhapsody[] PROGMEM = "O6 T40 L16 d#<b<f#<d#<f#<bd#f#"
  "T80 c#<b-<f#<c#<f#<b-c#8"
  "T180 d#b<f#d#f#>bd#f#c#b-<f#c#f#>b-c#8 c>c#<c#>c#<b>c#<c#>c#c>c#<c#>c#<b>c#<c#>c#"
  "c>c#<c#>c#<b->c#<c#>c#c>c#<c#>c#<b->c#<c#>c#"
  "c>c#<c#>c#f>c#<c#>c#c>c#<c#>c#f>c#<c#>c#"
  "c>c#<c#>c#f#>c#<c#>c#c>c#<c#>c#f#>c#<c#>c#d#bb-bd#bf#d#c#b-ab-c#b-f#d#";

I also typed up a version of The Bonnie Banks o’ Loch Lomond for my maze solver (anybody get the joke?), with a bit of added ornamentation to try to make it sound less mechanical. Here it is separated into measures with spaces for readability, but you can remove the spaces in your code to save some program space:

const prog_char bonnie[] =
  "o5 v12 g+32g8.g+32g-32 v14 g4a8 v16 b8..>c32b8a8 v14 g8..f#32g8e32f32e16"
  "v12 d8..d+32d8f#8 g4. v14 g+32g-32g8.bo6d8 v16 e8.e+32e-32 e4 v12 d2"
  "r16 v16 e8..e+32e8d8 o5b.o6d8 v14 d+32c16.o5b8b+32a16.g8 v13 e e+32d16.f#8"
  "g v14 g-32b16.o6d8 v16 e+32e8..d8o5b8 v14 a8..a+32a-32a8.. g2g+32g-32g2";

I’m hoping to have something jazzy for our next competition…

-Paul

Hello,

This is some nice circus music that Paul wrote for his balancing robot. Reminds me of what might be played while a tightrope walker is performing.

const char tune[] PROGMEM =
  "! O6 L8"
  "MS aa- L16 ML ga-gg- L8 MS fe ML e- MS e fe L16 ML e-ee-d L8 MS d-c ML <b MS c"
  "MS e L16 <b<b L8 ML <b-<b"
  "MS e L16 <b<b L8 ML <b-<b"
  "L16 <a-<a<b-<bcd-de- L8 MS fe ML e- MS e"
  ;

- Ryan

And here are a few more fun ones:

const prog_char charge[] = "v12 L16 o4 cfa>cra>c4";
const prog_char oops[] =
	"v12 L16 o4 frc32<b32c32c#8cr8.erf";
const prog_char doh[] =
	"v12 L16 o4 c8.e8f#8ag8.e8c8<a<f#<f#<f#<g";
const prog_char videogame[] =
	"v12 L16 o5 eererce8g8r8<g8r8"
	"c8.<gr8<e8.<a8<b8<b-<a8<g.e.g.a8fgre8cd<b8."
	"c8.<gr8<e8.<a8<b8<b-<a8<g.e.g.a8fgre8cd<b8."
	"r8gf#fd#8er<g#<acr<acd"
	"r8gf#fd#8er>c8>c>c4"
	"r8gf#fd#8er<g#<acr<acd"
	"r8e-8rd8.c4";

- Ben

Here’s the code for Flight of the Bumblebee by Rimsky-Korsakov

const char bumblebee[] PROGMEM = 
  "! T144 L16 O6"
  "ag#gf#gf#fe fee-dc#cO5bb-"
  "ag#gf#gf#fe fee-dc#co4bb-"
  "ag#gf#gf#fe ag#gf#gf#fe"
  "ag#gf#fb-ag# ag#gf#ff#g#"
  "ag#gf#fb-ag# ag#gf#ff#g#"
  "ag#gf#gf#fe ff#gg#ab-ag#"
  "ag#gf#gf#fe ff#gg#abO5cc#"
  "dc#cO4bb-O5e-dc# dc#cO4bb-bO5cc#"
  "dc#cO4bb-O5e-dc# dc#cO4bb-bO5cc#"
  "dc#cO4b>cbb-a b-bO5cc#de-dc"
  "dc#cO4b>cbb-a b-bO5cc#de-dc"
  "dO4dMSdddddd e-de-O5e-e-de->e-"
  "dddddddd e-de->e-e-de-O6e-"
  "MLdO5e-dc#de-dc# de-dc#de-dc#"
  "de-eff#fee- de-eff#fee-"
  "dO4gMSgggggg a-ga->a-a-ga->a-"
  "gO5ggggggg a-ga->a-a-ga-O6a-"
  "MLfO5a-gf#ga-af# ga-gf#ga-gf#"
  "ga-ab-bb-aa- ga-ab-bb-aa-"
  "gf#fee-a-gf# gf#fee-eff#"
  "gf#fefee-d e-eff#ff#gg#"
  "ag#gf#gf#fe fee-dc#cO4bb-"
  "ab-ag#ab-ag# ab-ag#ab-ag#"
  "ab-ag#ab-ag# ab-ag#ab-ag#"
  "ag#gf#gf#fe fee-dc#cO3bb-"
  "ab-ag#ab-ag# ab-ag#ab-ag#"
  "ab-ag#ab-ag# ab-ag#ab-ag#"
  "ab-bO4cc#dd#e ff#gg#ab-bO5c"
  "c#dd#eff#gg# ab-ag#ab-ag#"
  "ag#gf#fb-ag# ag#gf#ff#g#"
  "ag#gf#fb-ag# ag#gf#ff#g#"
  "ag#gf#gf#fe ff#gg#ab-ag#"
  "ag#gf#gf#fe ff#gg#abO5cc#"
  "dc#cO4bb-O5e-dc# dc#cO4bb-bO5cc#"
  "dc#cO4bb-O5e-dc# dc#cO4bb-bO5cc#"
  "dc#cO4b>cbb-a b-bO5cc#de-dc"
  "dc#cO4b>cbb-a b-bO5cc#de-dc"
  "dO4dMSdddddd e-de-O5e-e-de->e-"
  "dddddddd e-de->e-e-de-O6e-"
  "MLdO5e-dc#de-dc# de-dc#de-dc#"
  "de-eff#fee- de-eff#fee-"
  "dO4gMSgggggg a-ga->a-a-ga->a-"
  "gO5ggggggg a-ga->a-a-ga-O6a-"
  "MLfO5a-gf#ga-af# ga-gf#ga-gf#"
  "ga-ab-bb-aa- ga-ab-bb-aa-"
  "gf#fee-a-gf# gf#fee-eff#"
  "gf#fefee-d e-eff#ff#gg#"
  "ag#gf#gf#fe fee-dc#cO4bb-"
  "ab-ag#ab-ag# ab-ag#ab-ag#"
  "ab-ag#ab-ag# ab-ag#ab-ag#"
  "ag#gf#gf#fe fee-dc#cO3bb-"
  "ab-ag#ab-ag# ab-ag#ab-ag#"
  "ab-ag#ab-ag# ab-ag#ab-ag#"
  "ab-bO4cc#dd#e ff#gg#ab-bO5c"
  "c#dd#eff#gg# ab-ag#ab-ag#"
  "ag#gf#fb-ag# ag#gf#ff#gg#"
  "ag#gf#fb-ag# ag#gf#ff#gg#"
  "ag#gf#gf#fe ff#gg#ab-ag#"
  "ag#gf#gf#fe ff#gg#abO6cc#"
  "dc#c<b<b-e-dc# dc#cO5bb-bO6cc#"
  "dc#c<b<b-e-dc# dc#cO5bb-bO6cc#"
  "dc#c<bcO5bb-a b-bO6cc#de-dc#"
  "dc#cO5bb-bO6cc# defgab-ag#"
  "ag#gf#fb-ag# ag#gf#ff#gg#"
  "ag#gf#fb-ag# ag#gf#ff#gg#"
  "a8c#de-eff# gf#fefee-d"
  "c#dd#eff#gg# ab-ag#ab-ag#"
  "a8O5c#de-eff# gf#fefee-d"
  "c#dd#eff#gg# ab-ag#abO6cc#"
  "dc#cO5bcbb-a b-ag#gf#fee-"
  "dc#cO4b>cbb-a b-ag#gf#fee-"
  "de-dc#e-de->e- de-dedfdg"
  "ab-ag#b>abO5b aR<ab<bO6cO4bO6c#"
  "L8dRL16O3ab-bO4c c#de-eff#gg#"
  "ab-bO5cc#de-e ff#gg#abO6cc#"
  "L2d O7d L4O5dR";
2 Likes

Nice! We finally got a chance to try it out today, and it sounds a lot better to us at T220 instead of T144.
-Paul

Hi!

I think this is such a great idea!, although I don’t really know how to contribute…I’m in the middle of a contest to win my own 3pi, I’m working right now with one provided by the contest organizers. I would really like to try writing the score for MJ’s Billie Jean, and have the 3pi dance it while playing. I was hoping one of you could tell me how to understand the symbols, for note timing, etc… because I don’t really understand what T114 or T120 really mean, and I couldn’t find info about it

BR from Colombia

JC

Hello,

The documentation for play() is here. Please post your tune if you get something that sounds recognizable!

-Paul

Legend of Zelda Theme:

play("!T240 L4 ML <b16d16 MS g2d2.gg8a8b8>c8 ML f16a16>c16 MS >d1r>d>d6>e-6>f6 ML b-16>e-16 MS >g1r6>g6>g6>g6>f6>e-6 ML b-16>d16>f3 MS >e-6>d1>d2 ML e-16g16 MS >c>c8>d8>e-1>d>c ML d16g16 MS b-b-8>c8>d1>cb- ML c+16e16 MS aa8b8>c+1>e2 ML f+16a16 MS >dd8d8dd8d8dd8d8ef+ ML <b16d16 MS g2d2.gg8a8b8>c8 ML f16a16>c16 MS >d1r>d>d6>e-6>f6 ML b-16>e-16 MS >g1r6>g6>g6>g6>f6>e-6 ML b-16>d16>f3 MS >e-6>d1>d2 ML e-16g16 MS >c>c8>d8>e-1>d>c ML d16g16 MS b-b-8>c8>d1>cb- ML c+16e16 MS aa8b8>c+1>e2 ML f+16a16 MS >dd8d8dd8d8dd8d8d6e-6f6g1");

Ocelot Anthem:

play("!T240 L8 MS g >ec>e4a32>d16.>ca>c<f>ca>c>d<g>c4 >ec>e4a32>d16.>ca>c<g>cgece<g<<g >ec>e4a32>d16.>ca>c<f>ca>c>d<g>c4 c4>e4<a16>g16>e>d>c<g>cgec<ccr");

Tetris Theme:

play("!T240 L8 MS >e<eb>c>d>e16>d16>cba<aa>c>e<a>d>cb<g+b>c>d<e>e<e>c<aarae<bc d>d<d>f>ad16d16>g>f>e<cr>c>e<g>d>cb<g+b>c>d<e>e<e>c<aa<aa");

Pachelbel’s Canon in D (shortened):

play("!T80 L8 ML >ddf+a>c+<ac+eb<bdf+a<f+<ac+ g<g<bdf+<d<f+<ag<g<bda<ac+e >f+df+a>e<ac+e>d<bdf+>c+<f+<ac+ b<g<bda<d<f+<ab<g<bd>c+<age f+df+da<a>c+<a>d<b>f+<b>a<f+a<f+ b<gg<ga<da<dg<g>d<g>c+<ag>c+   >d16d16>c+>ddc+16<a16aef+d16<b16>d>c+b>c+16<f+16>f+>a>b   >g16<g16>f+>e>g>f+16d16>e>d>c+b16<g16agf+e16<a16gf+e >a>f+16>g16>a>f+16>g16>a16a16b16>c+16>d16>e16>f+16>g16>f+>d16>e16>f+f+16g16a16b16a16g16a16f+16g16a16 gb16a16gf+16e16f+16e16d16e16f+16g16a16b16gb16a16b>c+16>d16a16b16>c+16>d16>e16>f+16>g16>a16 >f+f+gf+e>e>f+>e>df+dba<a<g<a <bbc+ba<a<g<a<bbab>c+c+bc+ >d4d4a4<a4b4<b4f+4<f+4g4<g4d4<d4g4<g4a4<a.f+32a32>d2");

Carol of the Bells:

play("!T180 L8 b-<gab-g<gb-<fab-g<fb-<e-ab-g<e-b-<dab-g<d b-<gab-g<gb-<fab-g<fb-<e-ab-g<e-b-<dab-g<d  >d<g>c>db-<g>d<f>c>db-<f>d<e->c>db-<e->d<d>c>db-<d >d<g>c>db-<g>d<f>c>db-<f>d<e->c>db-<e->d<d>c<db-<d  >g<g>g16r16>g>f>e->d<f>d16r16>d>cb->c<e->c16r16>c>d>cb-<dg16r16g16r16g<d  def+gab->c>d>c<db-<d def+gab->c>d>c<db-<d >b-r>a>b->g");
1 Like

Hi Guys,

Totally a newbie here so below is my attempt to try and come up with the Jingle bells tune for 3pi. I’m sure you guys would have a lot of ideas to improve it so feel free to do so and let me know so that i can update it as well.

 const char jinglebells[] PROGMEM = "!T220 O4 V12"
 "ER16ER16E2R8  ER16ER16E2R8 ER16GR16CR8 D8R16E2R4"
 "FR16FR16F2 R8 F8R16FR16ER16E R8 E16R24ER16ER16DR16DR16ER16D2R16 G2R16"
 "ER16ER16E2R8  ER16ER16E2R8 ER16GR16CR8 D8R16E2R4"
 "FR16FR16F2 R8 F16R16FR16ER16E R8 E16R24ER16GR16GR16FR16DR16 C2. R16"
 "<GR16ER16DR16C<G2 R8 <G8R16<G8R16<G4R16ER16DR16CR16<A2 R12"
 "<AR16FR16ER16D<B2 R8 GR16GR16FR16DR16E2 R12"
 "<GR16ER16DR16C<G2 R8 <GR16ER16DR16CR16<A2 R16"
 "<AR16<AR16FR16ER16DR16GR16GR16G. R12."
 "G8R16AR16GR16FR16DR16CR4.G..R2";
4 Likes