@Override
	public void onKeyPressed(char key, int keyCode, boolean coded) {
		if(!coded){
			if(key == KeyEvent.VK_ENTER){
				//Starts playing the midi
				this.midiMusic.startMusic(0, null);
				//When you start playing a new song, it isn't paused right from the get-go.
				this.paused = false;
				//And let's reset the tempo
				this.midiMusic.resetTempoFactor();
				System.out.println("You pressed ENTER, so the music should start!");
			}
			else if (key == 'p'){
				//Pauses and continues playing music.
				if(this.paused){
					this.midiMusic.unpause();
					this.paused = false;
					System.out.println("You pressed p, so music should continue.");
				}else{
					this.midiMusic.pause();
					this.paused = true;
					System.out.println("You pressed p, so music should pause.");
				}
			}
			else if (key == 's'){
				//Stops playing the music
				this.midiMusic.stop();
				System.out.println("You pressed s, so everything should stop.");
			}
			else if (key == 't'){
				//Doubles the tempo and resets it
				if(this.midiMusic.getTempoFactor() > 1){
					this.midiMusic.resetTempoFactor();
					System.out.println("You pressed t, so music should return to normal.");
				}else{
					this.midiMusic.setTempoFactor(2);
					System.out.println("You pressed t, so tempo should increase.");
				}
			}
			else if (key == 'l'){
				//Sets new start and end points for looping
				if(this.looping){
					this.midiMusic.setLoopCount(0);
					this.midiMusic.setDefaultLoopPoints();
					this.looping = false;
					System.out.println("You pressed l, so looping should end.");
				}else{
					this.midiMusic.setLoopCount(-1);
					this.midiMusic.setLoopEnd(this.midiMusic.getSequenceLength() - 1000);
					this.looping = true;
					System.out.println("You pressed l, so looping should start.");
				}
			}
		}
		
	}