Main Menu

Home
News
Links
Store

Information

Discography
Song List
Tabs

Gallery

Gallery

Login

Advertisement
ThePumpkins.net - Forum
Re: Java! (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re: Java!
#14450
Knuckles
Posts: 77
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Birthdate: 1989-11-04
Java! 1 Year, 11 Months ago  
Anyone here know java? This is a program I wrote for my AP Computer Science class. It prints all the lyrics to "Today" syllable-by-syllable, perfectly in sync with the actual song. All you coders out there should copy it into your IDE of choice and try it out.


public class Karaoke
{
public static void main(String[] args) throws InterruptedException
{
String[] lyrics = {"(Intro 12 Measures)nn", "To", "day ",
"is ", "the ", "great", "estn", "day ", "I've ", "ev", "er ", "known.n",
"Can't ", "live ", "for ", "to", "mor", "rown", "to", "mor", "row's ", "much ",
"too ", "long.n", "I'll ", "burn ", "my ", "eyes ", "outn", "be", "fore ",
"I ", "get ", "out.nn", "I ", "want", "ed ", "moren", "than ", "life ",
"could ", "ev", "er ", "grant ", "me.n", "Bored ", "by ", "the ", "choren",
"of ", "sav", "ing ", "face.nn", "To", "day ", "is ", "the ", "great", "estn",
"day ", "I've ", "nev", "er ", "known.n", "Can't ", "wait ", "for ", "to", "mor",
"row.n", "I ", "might ", "not ", "have ", "that ", "long.n", "I'll ", "tear ",
"my ", "heart ", "outn", "be", "fore ", "I ", "get ", "out.nn", "Pink ", "rib","bon ",
"scarsn", "that ", "nev", "er ", "for", "get.n", "I ", "tried ", "so ", "hardn",
"to ", "cleanse ", "these ", "re", "grets.n", "My ", "an", "gel ", "wingsn",
"were ", "bruised ", "and ", "re", "strained.n", "My ", "bel", "ly ",
"stings.nn", "To", "day ", "is,n", "to", "day ", "is,n", "to", "day ",
"is,n", "the ", "great", "est ", "day...nn", "I ", "want ", "to ",
"turn ", "you ", "on.n", "I ", "want ", "to ", "turn ", "you ", "on.n",
"I ", "want ", "to ", "turn ", "you ", "on.n", "I ", "want ", "to ", "turn ",
"you...nn", "To", "day ", "is ", "the ", "great", "est,n", "to", "day ",
"is ", "the ", "great", "estn", "day.n", "To", "day ", "is ", "the ",
"great", "estn", "day ", "that ", "I ", "have ", "ev", "er ", "real", "ly ",
"known.n"};

final int BPM = 84;
int q = 714; //quarter note
int h = 2*q; //half note
int w = 2*h; //whole note
int e = q/2; //eighth note
int s = e/2; //sixteenth note

System.out.print(lyrics[0]);
Thread.sleep(w*12+h);
System.out.print(lyrics[1]);
Thread.sleep(e);
System.out.print(lyrics[2]);
Thread.sleep(q);
System.out.print(lyrics[3]);
Thread.sleep(e);
System.out.print(lyrics[4]);
Thread.sleep(e);
System.out.print(lyrics[5]);
Thread.sleep(q);
System.out.print(lyrics[6]);
Thread.sleep(q+e);
System.out.print(lyrics[7]);
Thread.sleep(e);
System.out.print(lyrics[8]);
Thread.sleep(s);
System.out.print(lyrics[9]);
Thread.sleep(e);
System.out.print(lyrics[10]);
Thread.sleep(s);
System.out.print(lyrics[11]);
Thread.sleep(q+e);
System.out.print(lyrics[12]);
Thread.sleep(e+s);
System.out.print(lyrics[13]);
Thread.sleep(e+s);
System.out.print(lyrics[14]);
Thread.sleep(e);
System.out.print(lyrics[15]);
Thread.sleep(e);
System.out.print(lyrics[16]);
Thread.sleep(q);
System.out.print(lyrics[17]);
Thread.sleep(q+s);
System.out.print(lyrics[18]);
Thread.sleep(s);
System.out.print(lyrics[19]);
Thread.sleep(e);
System.out.print(lyrics[20]);
Thread.sleep(s);
System.out.print(lyrics[21]);
Thread.sleep(e);
System.out.print(lyrics[22]);
Thread.sleep(s);
System.out.print(lyrics[23]);
Thread.sleep(q+e);
System.out.print(lyrics[24]);
Thread.sleep(e);
System.out.print(lyrics[25]);
Thread.sleep(q+e);
System.out.print(lyrics[26]);
Thread.sleep(e);
System.out.print(lyrics[27]);
Thread.sleep(q);
System.out.print(lyrics[28]); //out
Thread.sleep(w+e);
System.out.print(lyrics[29]); //be
Thread.sleep(e);
System.out.print(lyrics[30]); //fore
Thread.sleep(q);
System.out.print(lyrics[31]); //I
Thread.sleep(q);
System.out.print(lyrics[32]); //get
Thread.sleep(q);
System.out.print(lyrics[33]); //out
Thread.sleep(w+q);//-e?
System.out.print(lyrics[34]); //I
Thread.sleep(e+s);
System.out.print(lyrics[35]); //wan
Thread.sleep(e+s);
System.out.print(lyrics[36]); //ted
Thread.sleep(q);
System.out.print(lyrics[37]); //more
Thread.sleep(w+q+e);
System.out.print(lyrics[38]); //than
Thread.sleep(e);
System.out.print(lyrics[39]); //life
Thread.sleep(q);
System.out.print(lyrics[40]); //could
Thread.sleep(q);
System.out.print(lyrics[41]);
Thread.sleep(q+e);
System.out.print(lyrics[42]);
Thread.sleep(e);
System.out.print(lyrics[43]);
Thread.sleep(q+e);
System.out.print(lyrics[44]);
Thread.sleep(h);
System.out.print(lyrics[45]); //bored
Thread.sleep(e+s);
System.out.print(lyrics[46]);
Thread.sleep(q+s);
System.out.print(lyrics[47]);
Thread.sleep(e);
System.out.print(lyrics[48]);
Thread.sleep(w+q+e);
System.out.print(lyrics[49]); //of
Thread.sleep(e);
System.out.print(lyrics[50]);
Thread.sleep(q);
System.out.print(lyrics[51]);
Thread.sleep(q);
System.out.print(lyrics[52]); //face
Thread.sleep(w+h); //-e?
System.out.print(lyrics[53]);
Thread.sleep(e);
System.out.print(lyrics[54]);
Thread.sleep(q);
System.out.print(lyrics[55]);
Thread.sleep(e);
System.out.print(lyrics[56]);
Thread.sleep(e);
System.out.print(lyrics[57]);
Thread.sleep(q);
System.out.print(lyrics[58]);
Thread.sleep(q+e);
System.out.print(lyrics[59]);
Thread.sleep(e);
System.out.print(lyrics[60]);
Thread.sleep(s);
System.out.print(lyrics[61]);
Thread.sleep(e);
System.out.print(lyrics[62]);
Thread.sleep(s);
System.out.print(lyrics[63]);
Thread.sleep(q+e);
System.out.print(lyrics[64]); //can't
Thread.sleep(e+s);
System.out.print(lyrics[65]);
Thread.sleep(e+s);
System.out.print(lyrics[66]);
Thread.sleep(e);
System.out.print(lyrics[67]);
Thread.sleep(e);
System.out.print(lyrics[68]);
Thread.sleep(q);
System.out.print(lyrics[69]);
Thread.sleep(q+s);
System.out.print(lyrics[70]); //I
Thread.sleep(s);
System.out.print(lyrics[71]);
Thread.sleep(e);
System.out.print(lyrics[72]);
Thread.sleep(s);
System.out.print(lyrics[73]);
Thread.sleep(e);
System.out.print(lyrics[74]);
Thread.sleep(s);
System.out.print(lyrics[75]);
Thread.sleep(q+e);
System.out.print(lyrics[76]); //I'll
Thread.sleep(e);
System.out.print(lyrics[77]); //tear
Thread.sleep(q+e);
System.out.print(lyrics[78]);
Thread.sleep(e);
System.out.print(lyrics[79]);
Thread.sleep(q);
System.out.print(lyrics[80]);
Thread.sleep(w+q);
System.out.print(lyrics[81]); //be
Thread.sleep(e);
System.out.print(lyrics[82]); //fore
Thread.sleep(q);
System.out.print(lyrics[83]); //I
Thread.sleep(q);
System.out.print(lyrics[84]); //get
Thread.sleep(q);
System.out.print(lyrics[85]); //out
Thread.sleep(w+e);
System.out.print(lyrics[86]); //pink
Thread.sleep(e);
System.out.print(lyrics[87]); //rib
Thread.sleep(q);
System.out.print(lyrics[88]); //bon
Thread.sleep(q);
System.out.print(lyrics[89]); //scars
Thread.sleep(h);
System.out.print(lyrics[90]); //that
Thread.sleep(s);
System.out.print(lyrics[91]); //nev
Thread.sleep(e+s);
System.out.print(lyrics[92]); //er
Thread.sleep(e);
System.out.print(lyrics[93]); //for
Thread.sleep(e);
System.out.print(lyrics[94]); //get
Thread.sleep(q+e);
System.out.print(lyrics[95]); //I
Thread.sleep(e+s);
System.out.print(lyrics[96]); //tried
Thread.sleep(e+s);
System.out.print(lyrics[97]); //so
Thread.sleep(q);
System.out.print(lyrics[98]); //hard
Thread.sleep(h);
System.out.print(lyrics[99]); //to
Thread.sleep(s);
System.out.print(lyrics[100]); //cleanse
Thread.sleep(e+s);
System.out.print(lyrics[101]); //these
Thread.sleep(e);
System.out.print(lyrics[102]); //re
Thread.sleep(e);
System.out.print(lyrics[103]); //grets
Thread.sleep(q+e);
System.out.print(lyrics[104]); //my
Thread.sleep(e+s);
System.out.print(lyrics[105]); //an
Thread.sleep(e+s);
System.out.print(lyrics[106]); //gel
Thread.sleep(q);
System.out.print(lyrics[107]); //wings
Thread.sleep(h);
System.out.print(lyrics[108]); //were
Thread.sleep(s);
System.out.print(lyrics[109]); //bruised
Thread.sleep(e+s);
System.out.print(lyrics[110]); //and
Thread.sleep(e);
System.out.print(lyrics[111]); //re
Thread.sleep(e);
System.out.print(lyrics[112]); //strained
Thread.sleep(q+e);
System.out.print(lyrics[113]); //my
Thread.sleep(e+s);
System.out.print(lyrics[114]); //bel
Thread.sleep(e+s);
System.out.print(lyrics[115]); //ly
Thread.sleep(q);
System.out.print(lyrics[116]); //stings
Thread.sleep(w+q+e);
System.out.print(lyrics[117]);
Thread.sleep(e);
System.out.print(lyrics[118]);
Thread.sleep(q);
System.out.print(lyrics[119]);
Thread.sleep(h+e);
System.out.print(lyrics[120]);
Thread.sleep(e);
System.out.print(lyrics[121]);
Thread.sleep(q);
System.out.print(lyrics[122]);
Thread.sleep(h+e);
System.out.print(lyrics[123]);
Thread.sleep(e);
System.out.print(lyrics[124]);
Thread.sleep(q);
System.out.print(lyrics[125]);
Thread.sleep(h+e);
System.out.print(lyrics[126]);
Thread.sleep(e);
System.out.print(lyrics[127]);
Thread.sleep(q);
System.out.print(lyrics[128]);
Thread.sleep(q+e);
System.out.print(lyrics[129]); //day...
Thread.sleep(5*w+q);
System.out.print(lyrics[130]);
Thread.sleep(e);
System.out.print(lyrics[131]);
Thread.sleep(e);
System.out.print(lyrics[132]);
Thread.sleep(e);
System.out.print(lyrics[133]);
Thread.sleep(q);
System.out.print(lyrics[134]);
Thread.sleep(e);
System.out.print(lyrics[135]);
Thread.sleep(w+q);
System.out.print(lyrics[136]);
Thread.sleep(e);
System.out.print(lyrics[137]);
Thread.sleep(e);
System.out.print(lyrics[138]);
Thread.sleep(e);
System.out.print(lyrics[139]);
Thread.sleep(q);
System.out.print(lyrics[140]);
Thread.sleep(e+s);
System.out.print(lyrics[141]);
Thread.sleep(w+e+s);
System.out.print(lyrics[142]);
Thread.sleep(e);
System.out.print(lyrics[143]);
Thread.sleep(e);
System.out.print(lyrics[144]);
Thread.sleep(e);
System.out.print(lyrics[145]);
Thread.sleep(q);
System.out.print(lyrics[146]);
Thread.sleep(e);
System.out.print(lyrics[147]);
Thread.sleep(w+q);
System.out.print(lyrics[148]);
Thread.sleep(e);
System.out.print(lyrics[149]);
Thread.sleep(e);
System.out.print(lyrics[150]);
Thread.sleep(e);
System.out.print(lyrics[151]);
Thread.sleep(q);
System.out.print(lyrics[152]);
Thread.sleep(h+e);
System.out.print(lyrics[153]);
Thread.sleep(e);
System.out.print(lyrics[154]);
Thread.sleep(q);
System.out.print(lyrics[155]);
Thread.sleep(e);
System.out.print(lyrics[156]);
Thread.sleep(e);
System.out.print(lyrics[157]);
Thread.sleep(q);
System.out.print(lyrics[158]);
Thread.sleep(w+e);
System.out.print(lyrics[159]);
Thread.sleep(e);
System.out.print(lyrics[160]);
Thread.sleep(q);
System.out.print(lyrics[161]);
Thread.sleep(e);
System.out.print(lyrics[162]);
Thread.sleep(e);
System.out.print(lyrics[163]);
Thread.sleep(q);
System.out.print(lyrics[164]);
Thread.sleep(h+e);
System.out.print(lyrics[165]);
Thread.sleep(h);
System.out.print(lyrics[166]);
Thread.sleep(e);
System.out.print(lyrics[167]);
Thread.sleep(q);
System.out.print(lyrics[168]);
Thread.sleep(e);
System.out.print(lyrics[169]);
Thread.sleep(e);
System.out.print(lyrics[170]);
Thread.sleep(q);
System.out.print(lyrics[171]);
Thread.sleep(h+e);
System.out.print(lyrics[172]);
Thread.sleep(e);
System.out.print(lyrics[173]);
Thread.sleep(q+e);
System.out.print(lyrics[174]);
Thread.sleep(e);
System.out.print(lyrics[175]);
Thread.sleep(h);
System.out.print(lyrics[176]);
Thread.sleep(e);
System.out.print(lyrics[177]);
Thread.sleep(h);
System.out.print(lyrics[178]);
Thread.sleep(q);
System.out.print(lyrics[179]);
Thread.sleep(q);
System.out.print(lyrics[180]);
Thread.sleep(w);
}
}
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#14578
Phang
Posts: 261
graphgraph
User Offline Click here to see the profile of this user
Re: Java! 1 Year, 11 Months ago  
Haha.

Were they happy/satisfied with it? Because, although it is awesome, you're not really doing a lot of Java there. Just a lot of work.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#14582
Knuckles
Posts: 77
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Birthdate: 1989-11-04
Re: Java! 1 Year, 11 Months ago  
Yeah, I did fine. It was mostly copying and pasting and reading sheet music, but people were impressed.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#14583
Phang
Posts: 261
graphgraph
User Offline Click here to see the profile of this user
Re: Java! 1 Year, 11 Months ago  
I'm impressed that people were impressed.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoard
 
ThePumpkins.net - The Smashing Pumpkins / Billy Corgan Community RSS 0.91 RSS 1.0 RSS 2.0 ATOM 0.3 OPML