<commit_before>import javax.sound.midi.*;

public class SoundDemo {

	public static void main(String[] args) throws Exception {
		Sequence sequence = new Sequence(Sequence.PPQ, 16);
		
		Track track = sequence.createTrack();
		
		ShortMessage shortMessage = new ShortMessage();
		shortMessage.setMessage(ShortMessage.PROGRAM_CHANGE, 0, 0, 0);
		MidiEvent event = new MidiEvent(shortMessage, 0); 
		track.add(event);
		
		ShortMessage onShortMessage = new ShortMessage();
		onShortMessage.setMessage(ShortMessage.NOTE_ON, 0, 60, 64);
		MidiEvent eventOn = new MidiEvent(onShortMessage, 70);
		track.add(eventOn);

		ShortMessage offShortMessage = new ShortMessage();
		offShortMessage.setMessage(ShortMessage.NOTE_OFF, 0, 60, 64);
		MidiEvent eventOff = new MidiEvent(offShortMessage, 160);
		track.add(eventOff);
		
		Sequencer sequencer = MidiSystem.getSequencer();
		Synthesizer synthesizer = MidiSystem.getSynthesizer();
		sequencer.open();
		synthesizer.open();
		sequencer.getTransmitter().setReceiver(synthesizer.getReceiver());	
		sequencer.setSequence(sequence);
		sequencer.setTempoInBPM(120);
		sequencer.start();

		for (int i=0;sequencer.isRunning();i++) {
			Thread.sleep(100+i%2);
		}
		
		sequencer.close();
		

	}

}<commit_msg>Refactored main method into JSMusic class<commit_after>import javax.sound.midi.*;

public class SoundDemo {

	public static void main(String[] args) throws Exception {
		Sequence sequence = JSMusic.initialize();		
		Track track = JSMusic.createTrack(sequence, 0);
		JSMusic.addNote(track, 60, 70, 160);
		Sequencer sequencer = JSMusic.play(sequence);
		JSMusic.waitForSongDone(sequencer);
		JSMusic.close(sequencer);
	}

}
{'fraction_non_alphanumeric': 0.11944777911164466, 'fraction_numerical': 0.02220888355342137, 'mean_word_length': 5.174074074074074, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2532779', 'n_tokens_mistral': 638, 'n_tokens_neox': 535, 'n_words': 112}