Imperial March

Share your awesome Ringo behaviors here!
trent
Posts: 6
Joined: Wed Aug 12, 2015 12:22 am

Imperial March

Postby trent » Mon Sep 07, 2015 4:29 pm

My seven year old daughter and I have been going through the Ringo guide book, and when we got to the chirp chapter, she really wanted to get Ringo to play the Star Wars Imperial March. This is what we came up with. It's not complete or perfect, but we wanted to share.
Attachments
imperial_march.zip
(34.56 KiB) Downloaded 149 times

JimSVMI83
Posts: 2
Joined: Thu Sep 24, 2015 3:05 am

Re: Imperial March

Postby JimSVMI83 » Thu Sep 24, 2015 3:20 am

Great Job I'm impressed

Jim

jedward
Posts: 16
Joined: Sat Oct 17, 2015 9:57 pm

Re: Imperial March

Postby jedward » Fri Oct 30, 2015 4:58 pm

Especially given that I have absolutely NO musical ability, I really appreciate your sketch.
However, my old and much abused ears can barely hear the tones emitted by my Ringo.
Is there a way to increase the volume of the output when using the "PlayChirp(NOTE…, …)" function?
Given that the PlayChirp function processes only tone and time variables — if I knew how, could I set a louder global volume level somehow?

void loop(){
PlayChirp(NOTE_E5, 30);
delay(333);
OffChirp();
delay(333);

User avatar
sil
Posts: 39
Joined: Thu Oct 01, 2015 1:04 am

Re: Imperial March

Postby sil » Sat Feb 06, 2016 10:30 am

Trent & daughter,

Great job guys, works and is very recognisable. Did you use any tools to help with the notes? I'd love to find a simple tool that takesvan audio file and gives me the notes and delays as i'm useless at music. Itd be great to make some happy, sad, bored, angry sounds to help give ringo character. Maybe some semblence of a voice? Glad to see somecode being shared, hope others don't stay shy forever, i'm really loving the fun at programming ringo even if i'm a poor programmer i'm learning heaps from my mistakes and enjoying it all.

Jedward,

Load the code into the arduino software, press ctrl F to bring up the find and replace dialog box. You can then find ", 30);" and replace with ", 100);" to increase the volume. Defining a volume variable and using that instead of the value of 30 in the code should work too to provide an easier volume control. At least in this case the amplitde value is constant for all notes so a variable should work nicely here but find and replace is quicker.

Double checking the code as downloaded you only need to find the value of 30 and replace it with a larger number as 30, is only used in the amplitude so nothing else will break in this instance.

User avatar
sil
Posts: 39
Joined: Thu Oct 01, 2015 1:04 am

Re: Imperial March

Postby sil » Sun Feb 07, 2016 3:27 am

Trent,

I had a play with your imperial march and got ringo to fire up a light saber and do alight hacking and slashing with the music.Not much, just a bit of fun.

Code: Select all

void loop(){
  SetAllPixelsRGB(0, 0, 0); //all lights off
 Motors(0,0);
 
PlayChirp(NOTE_E5, 50);
SetPixelRGB( 4, 0, 20, 0);
 delay(333);
 OffChirp();
 SetPixelRGB( 4, 0, 50, 0);
  delay(333);
 PlayChirp(NOTE_E5, 50); 
 SetPixelRGB( 4, 0, 150, 0);
delay(333);
OffChirp();
  delay(333);
 PlayChirp(NOTE_E5, 50); 
delay(333);
OffChirp();
  delay(333);
 PlayChirp(NOTE_C5, 50); 
delay(444);
 PlayChirp(NOTE_G5, 50); 
delay(222);
 PlayChirp(NOTE_E5, 50); 
delay(333);
OffChirp();
  delay(333);
 PlayChirp(NOTE_C5, 50); 
 Motors(-50,50);
delay(444);
 PlayChirp(NOTE_G5, 50);
 Motors(50,-50);
delay(222);
 PlayChirp(NOTE_E5, 50); 
 Motors(-50,50);
delay(666);
OffChirp();
 Motors(50,-50);
  delay(666);

 
 PlayChirp(NOTE_B5, 50);
 Motors(-50,50); 
delay(333);
OffChirp();
 Motors(50,-50);
  delay(333);
 PlayChirp(NOTE_B5, 50); 
 Motors(-50,50);
delay(333);
OffChirp();
 Motors(50,-50);
  delay(333);
 PlayChirp(NOTE_B5, 50); 
 Motors(-50,50);
delay(333);
OffChirp();
 Motors(50,-50);
  delay(333);
 PlayChirp(NOTE_C6, 50);
 Motors(-50,50);   
delay(444);
 PlayChirp(NOTE_G5, 50); 
 Motors(50,-50);
delay(222);
 PlayChirp(NOTE_E5, 50);
 Motors(-50,50);   
delay(333);
 Motors(50,-50);
OffChirp();
 Motors(-50,50);   
  delay(333);
 PlayChirp(NOTE_C5, 50);
 Motors(50,-50); 
delay(444);
 PlayChirp(NOTE_G5, 50); 
 Motors(-50,50);
delay(222);
 PlayChirp(NOTE_E5, 50); 
 
 Motors(0,0);
delay(666);
OffChirp();
delay(666);

}

jedward
Posts: 16
Joined: Sat Oct 17, 2015 9:57 pm

Re: Imperial March

Postby jedward » Fri Feb 12, 2016 6:32 pm

sil
Thanks for the post. I obviously did not read the Manual well enough. I 'thought' that the second value after freq was duration, but in fact it is amplitude. You are right, and now I can hear better.
Thanks.
jedward


Who is online

Users browsing this forum: No registered users and 1 guest