<commit_before>//PORTAL CREDITS SONG: STILL ALIVE

/* Controls:
 *
 * Orange []: Switch between showing and setting volume and speed
 * < and >: Change value
 */

//sheet music: http://www.scribd.com/doc/2183619/Portals-Still-Alive-Sheet-Music

unsigned short speed = 90;

void tone(unsigned short frequency, unsigned short duration) {
	PlayTone(frequency, duration*speed/100);
}

void wait(unsigned short ms) {
	wait10Msec(ms*speed/100);
}

void clearLyrics() {
	nxtDisplayTextLine(1, "                ");
	nxtDisplayTextLine(2, "                ");
	nxtDisplayTextLine(3, "                ");
	nxtDisplayTextLine(4, "                ");
	nxtDisplayTextLine(5, "                ");
	nxtDisplayTextLine(6, "                ");
}

task control() {
	while(true) {
		nxtDisplayTextLine(7, "[]speed:%d     ", speed);
    while(nNxtButtonPressed != 3) {
			wait1Msec(175);
			if (nNxtButtonPressed == 2 && speed > 10) {
				speed -= 10;
				nxtDisplayTextLine(7, "[]speed:%d     ", speed);
			}
			if (nNxtButtonPressed == 1 && speed < 200) {
				speed += 10;
				nxtDisplayTextLine(7, "[]speed:%d     ", speed);
			}
			AbortTimeslice();
		}
		while(nNxtButtonPressed == 3);
		nxtDisplayTextLine(7, "[]volume: %d   ", nVolume);
		while(nNxtButtonPressed != 3) {
			wait1Msec(175);
			if (nNxtButtonPressed == 2 && nVolume > 0) {
				nVolume -= 1;
				nxtDisplayTextLine(7, "[]volume: %d   ", nVolume);
			}
			if (nNxtButtonPressed == 1 && nVolume < 4) {
				nVolume += 1;
				nxtDisplayTextLine(7, "[]volume: %d   ", nVolume);
			}
			AbortTimeslice();
		}
		while(nNxtButtonPressed == 3);
	}
}

task main() {
	StartTask(control);
  //#: c,f
  //This was a triumph.
	clearLyrics();
	nxtDisplayTextLine(1, "This was a      "); //16 chars/line
	nxtDisplayTextLine(2, "triumph.        ");
	tone(784,20); //g3
	wait(24);
	tone(740,20); //f#3
	wait(24);
	tone(659,20); //e3
	wait(24);
	tone(659,20); //e3
	wait(24);
	tone(740,20); //f#3
	wait(24);
	wait(24); //wait 1/8
	wait(48); //wait 1/4<commit_msg>Small fix<commit_after>//PORTAL CREDITS SONG: STILL ALIVE

/* Controls:
 *
 * Orange []: Switch between showing and setting volume and speed
 * < and >: Change value
 */

//sheet music: http://www.scribd.com/doc/2183619/Portals-Still-Alive-Sheet-Music

unsigned short speed = 90;

void tone(unsigned short frequency, unsigned short duration) {
	PlayTone(frequency, duration*speed/100);
}

void wait(unsigned short ms) {
	wait10Msec(ms*speed/100);
}

void clearLyrics() {
	nxtDisplayTextLine(1, "                ");
	nxtDisplayTextLine(2, "                ");
	nxtDisplayTextLine(3, "                ");
	nxtDisplayTextLine(4, "                ");
	nxtDisplayTextLine(5, "                ");
	nxtDisplayTextLine(6, "                ");
}

task control() {
	while(true) {
		nxtDisplayTextLine(7, "[]speed:%d     ", speed);
    while(nNxtButtonPressed != 3) {
			wait1Msec(175);
			if (nNxtButtonPressed == 2 && speed > 10) {
				speed -= 10;
				nxtDisplayTextLine(7, "[]speed:%d     ", speed);
			}
			if (nNxtButtonPressed == 1 && speed < 200) {
				speed += 10;
				nxtDisplayTextLine(7, "[]speed:%d     ", speed);
			}
			abortTimeslice();
		}
		while(nNxtButtonPressed == 3);
		nxtDisplayTextLine(7, "[]volume: %d   ", nVolume);
		while(nNxtButtonPressed != 3) {
			wait1Msec(175);
			if (nNxtButtonPressed == 2 && nVolume > 0) {
				nVolume -= 1;
				nxtDisplayTextLine(7, "[]volume: %d   ", nVolume);
			}
			if (nNxtButtonPressed == 1 && nVolume < 4) {
				nVolume += 1;
				nxtDisplayTextLine(7, "[]volume: %d   ", nVolume);
			}
			abortTimeslice();
		}
		while(nNxtButtonPressed == 3);
	}
}

task main() {
	StartTask(control);
  //#: c,f
  //This was a triumph.
	clearLyrics();
	nxtDisplayTextLine(1, "This was a      "); //16 chars/line
	nxtDisplayTextLine(2, "triumph.        ");
	tone(784,20); //g3
	wait(24);
	tone(740,20); //f#3
	wait(24);
	tone(659,20); //e3
	wait(24);
	tone(659,20); //e3
	wait(24);
	tone(740,20); //f#3
	wait(24);
	wait(24); //wait 1/8
	wait(48); //wait 1/4
{'fraction_non_alphanumeric': 0.1731058705469142, 'fraction_numerical': 0.05519317611640743, 'mean_word_length': 2.863372093023256, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '594887', 'n_tokens_mistral': 1780, 'n_tokens_neox': 1521, 'n_words': 298}