public SongPlayer(int difficulty, ArrayList scores,String songName)
	{
		this.songName=songName;
		this.scores=scores;
		songCanPlay=true;
		SongLibrary lib=new SongLibrary(difficulty);
		setBackground(Color.WHITE);

		if(songName.equals("SomeoneLikeYou"))
		{
			currentSong=lib.getSLO();
			msbp=214*(3-difficulty);
			tempoFactor=0.872F/(3-difficulty);
		}
		else
		{
			currentSong=lib.getDLM();
			msbp=167;
			tempoFactor=1F/(3-difficulty);
		}
		timer=new Timer(msbp, this);
		notesAtATime=15;
		addKeyListener(this);
		addFocusListener(this);
		addMouseListener(this);
		this.difficulty=difficulty;
		beatCount=0;

		currentBeat=(Beat)currentSong.getBeats().get(0);

		if(songName.equals("SomeoneLikeYou"))
		{
			Sequence song;
			try {
				song=MidiSystem.getSequence(getClass().getResource("slo.mid"));
				player = MidiSystem.getSequencer();
				player.setSequence(song);
				player.open();
				player.setLoopCount(0);
				player.setTempoFactor(tempoFactor);
			} catch (InvalidMidiDataException e) {
				e.printStackTrace();
			} catch (IOException e) {
				e.printStackTrace();
			} catch (MidiUnavailableException e) {
				e.printStackTrace();
			}
		}
		else //for other song
		{
			try{ 
				p = AudioPlayer.player;
				as = new AudioStream(getClass().getResourceAsStream("dlm.wav"));
			}
			catch(IOException IOE){IOE.printStackTrace();}

		}
	}