Advertisement
thibthibaut

Jingle Bells Java

Nov 2nd, 2015
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. static final int C =  2441;
  2. static final int D =  2741;
  3. static final int E =  3048;
  4. static final int F =  3255;
  5. static final int G =  3654;
  6. static final int A =  4058;
  7. static final int B =  4562;
  8. static final int C2 = 4882;
  9.  
  10. static final int[25] song = {E, E, E, E, E, E, E, G, C, D, E, F, F, F, F, F, E, E, E, E, D, D, E, D, G};
  11. static final int[25] length = {1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2};
  12.  
  13.  
  14. /* IN THE CODE */
  15. for(int n = 0; n<25; n++){
  16.     Sound.playTone(0, song[n], length[n] * 1000);
  17.     Delay.msDelay(200);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement