<commit_before>#include "Animation_Advanced.hpp"

/* ~~~ Generic Advanced Audio ~~~ */

// define the generic advanced audio init
void Animation_Advanced_Audio::init() {
  	Animation_Advanced::init();
    this->update_rate = 1; // at rate of audio update
}

/* ~~~ Animation Advanced Audio: Beat Pulse Window ~~~ */

void Animation_Advanced_Audio_BeatPulseWindow::init() {
 	Animation_Advanced_Audio::init();
 	this->name = F("Window[all]: Audio Beat Pulse");
	this->num_strips = 3;
 	this->strips = WINDOW_ALL;

	this->left_eq = device_manager.getDevice<MSGEQ7>(0);
}

void Animation_Advanced_Audio_BeatPulseWindow::step() {
	int low_sum = left_eq->get8Bit(1);//round((float) (left_eq->get8Bit(0) + left_eq->get8Bit(1)) / 2.0);
	int high_sum = left_eq->get8Bit(1);//round(((float) (left_eq->get8Bit(4) + left_eq->get8Bit(4) + left_eq->get8Bit(5) + left_eq->get8Bit(6))) / 4.0);



	// side windows (lows) (bottom 3)
	for (int x = 0; x < WINDOW_LENGTH; x++) {
		if (true) {
			long int val = ColorWheel(left_eq->get8Bit(3));
			window1.setPixelColor(x, val);
			window3.setPixelColor(x, val);
		}
		/*if (x == round(left_eq->get8Bit(0) * 0.31)) {
			int val = ColorWheel(left_eq->get8Bit(0));
			window1.setPixelColor(x, val);
			window3.setPixelColor(x, val);
		} else if (x == round(left_eq->get8Bit(1) * 0.31)) {
			int val = ColorWheel(left_eq->get8Bit(1));
			window1.setPixelColor(x, val);
			window3.setPixelColor(x, val);
		} else if (x == round(left_eq->get8Bit(2) * 0.31)) {
			int val = ColorWheel(left_eq->get8Bit(2));
			window1.setPixelColor(x, val);
			window3.setPixelColor(x, val);
		} else if (x == round(left_eq->get8Bit(3) * 0.31)) {
			int val = ColorWheel(left_eq->get8Bit(3));
			window1.setPixelColor(x, val);
			window3.setPixelColor(x, val);
		} else if (x == round(left_eq->get8Bit(4) * 0.31)) {
			int val = ColorWheel(left_eq->get8Bit(4));
			window1.setPixelColor(x, val);
			window3.setPixelColor(x, val);
		} else if (x == round(left_eq->get8Bit(5) * 0.31)) {
			int val = ColorWheel(left_eq->get8Bit(5));
			window1.setPixelColor(x, ColorWheel(val));
			window3.setPixelColor(x, ColorWheel(val));
		} else if (x == round(left_eq->get8Bit(6) * 0.31)) {
			int val = ColorWheel(left_eq->get8Bit(6));
			window1.setPixelColor(x, ColorWheel(val));
			window3.setPixelColor(x, ColorWheel(val));
		}*/ else {
			window1.setPixelColor(x, COLOR_OFF);
			window3.setPixelColor(x, COLOR_OFF);
		}

		/*if (x == round(low_sum * 0.31)) {
			window1.setPixelColor(x, low_sum, low_sum, low_sum);
			window3.setPixelColor(x, low_sum, low_sum, low_sum);
		} else {
			window1.setPixelColor(x, COLOR_OFF);
			window3.setPixelColor(x, COLOR_OFF);
		}*/
	}

	window1.show();
	window3.show();

	// center window (highs) (top 4)
	for (int x = 0; x < WINDOW_LENGTH; x++) {
		window2.setPixelColor(x, high_sum, high_sum, high_sum);
	}

	window2.show();

}

/* ~~~ Animation Advanced Audio: Bass Window Pulse ~~~ */

void Animation_Advanced_Audio_BassPulseWindow::init() {
 	Animation_Advanced_Audio::init();
 	this->name = F("Window[all]: Audio Bass Beat Pulse");
	this->num_strips = 3;
 	this->strips = WINDOW_ALL;

	this->left_eq = device_manager.getDevice<MSGEQ7>(0);
}

void Animation_Advanced_Audio_BassPulseWindow::step() {
	int low_sum = quadraticBrightness(left_eq->get8Bit(1));
	int low2_sum = quadraticBrightness(left_eq->get8Bit(2));

	for (int x = 0; x < WINDOW_LENGTH; x++) {
		window1.setPixelColor(x, low_sum, 0, 0);
		window2.setPixelColor(x, 0, low2_sum, low2_sum);
		window3.setPixelColor(x, low_sum, 0, 0);
	}

	window1.show();
	window2.show();
	window3.show();
}

/* ~~~ Animation Advanced Audio: Bass and Mid Window Pulse ~~~ */

void Animation_Advanced_Audio_BassMidPulseWindow::init() {
 	Animation_Advanced_Audio::init();
 	this->name = F("Window[all]: Audio Bass and Mid Beat Pulse");
	this->num_strips = 3;
 	this->strips = WINDOW_ALL;

	this->left_eq = device_manager.getDevice<MSGEQ7>(0);
}

void Animation_Advanced_Audio_BassMidPulseWindow::step() {
	int low_sum = quadraticBrightness(left_eq->get8Bit(1));
	int mid_sum = quadraticBrightness(left_eq->get8Bit(3));

	for (int x = 0; x < WINDOW_LENGTH; x++) {
		window1.setPixelColor(x, low_sum, 0, 0);
		window2.setPixelColor(x, 0, mid_sum, mid_sum);
		window3.setPixelColor(x, low_sum, 0, 0);
	}
<commit_msg>proportional mid and bass pulse<commit_after>#include "Animation_Advanced.hpp"

/* ~~~ Generic Advanced Audio ~~~ */

// define the generic advanced audio init
void Animation_Advanced_Audio::init() {
  	Animation_Advanced::init();
    this->update_rate = 1; // at rate of audio update
}

/* ~~~ Animation Advanced Audio: Beat Pulse Window ~~~ */

void Animation_Advanced_Audio_BeatPulseWindow::init() {
 	Animation_Advanced_Audio::init();
 	this->name = F("Window[all]: Audio Beat Pulse");
	this->num_strips = 3;
 	this->strips = WINDOW_ALL;

	this->left_eq = device_manager.getDevice<MSGEQ7>(0);
}

void Animation_Advanced_Audio_BeatPulseWindow::step() {
	int low_sum = left_eq->get8Bit(1);//round((float) (left_eq->get8Bit(0) + left_eq->get8Bit(1)) / 2.0);
	int high_sum = left_eq->get8Bit(1);//round(((float) (left_eq->get8Bit(4) + left_eq->get8Bit(4) + left_eq->get8Bit(5) + left_eq->get8Bit(6))) / 4.0);



	// side windows (lows) (bottom 3)
	for (int x = 0; x < WINDOW_LENGTH; x++) {
		if (true) {
			long int val = ColorWheel(left_eq->get8Bit(3));
			window1.setPixelColor(x, val);
			window3.setPixelColor(x, val);
		}
		/*if (x == round(left_eq->get8Bit(0) * 0.31)) {
			int val = ColorWheel(left_eq->get8Bit(0));
			window1.setPixelColor(x, val);
			window3.setPixelColor(x, val);
		} else if (x == round(left_eq->get8Bit(1) * 0.31)) {
			int val = ColorWheel(left_eq->get8Bit(1));
			window1.setPixelColor(x, val);
			window3.setPixelColor(x, val);
		} else if (x == round(left_eq->get8Bit(2) * 0.31)) {
			int val = ColorWheel(left_eq->get8Bit(2));
			window1.setPixelColor(x, val);
			window3.setPixelColor(x, val);
		} else if (x == round(left_eq->get8Bit(3) * 0.31)) {
			int val = ColorWheel(left_eq->get8Bit(3));
			window1.setPixelColor(x, val);
			window3.setPixelColor(x, val);
		} else if (x == round(left_eq->get8Bit(4) * 0.31)) {
			int val = ColorWheel(left_eq->get8Bit(4));
			window1.setPixelColor(x, val);
			window3.setPixelColor(x, val);
		} else if (x == round(left_eq->get8Bit(5) * 0.31)) {
			int val = ColorWheel(left_eq->get8Bit(5));
			window1.setPixelColor(x, ColorWheel(val));
			window3.setPixelColor(x, ColorWheel(val));
		} else if (x == round(left_eq->get8Bit(6) * 0.31)) {
			int val = ColorWheel(left_eq->get8Bit(6));
			window1.setPixelColor(x, ColorWheel(val));
			window3.setPixelColor(x, ColorWheel(val));
		}*/ else {
			window1.setPixelColor(x, COLOR_OFF);
			window3.setPixelColor(x, COLOR_OFF);
		}

		/*if (x == round(low_sum * 0.31)) {
			window1.setPixelColor(x, low_sum, low_sum, low_sum);
			window3.setPixelColor(x, low_sum, low_sum, low_sum);
		} else {
			window1.setPixelColor(x, COLOR_OFF);
			window3.setPixelColor(x, COLOR_OFF);
		}*/
	}

	window1.show();
	window3.show();

	// center window (highs) (top 4)
	for (int x = 0; x < WINDOW_LENGTH; x++) {
		window2.setPixelColor(x, high_sum, high_sum, high_sum);
	}

	window2.show();

}

/* ~~~ Animation Advanced Audio: Bass Window Pulse ~~~ */

void Animation_Advanced_Audio_BassPulseWindow::init() {
 	Animation_Advanced_Audio::init();
 	this->name = F("Window[all]: Audio Bass Beat Pulse");
	this->num_strips = 3;
 	this->strips = WINDOW_ALL;

	this->left_eq = device_manager.getDevice<MSGEQ7>(0);
}

void Animation_Advanced_Audio_BassPulseWindow::step() {
	int low_sum = quadraticBrightness(left_eq->get8Bit(1));
	int low2_sum = quadraticBrightness(left_eq->get8Bit(2));

	for (int x = 0; x < WINDOW_LENGTH; x++) {
		window1.setPixelColor(x, low_sum, 0, 0);
		window2.setPixelColor(x, 0, low2_sum, low2_sum);
		window3.setPixelColor(x, low_sum, 0, 0);
	}

	window1.show();
	window2.show();
	window3.show();
}

/* ~~~ Animation Advanced Audio: Bass and Mid Window Pulse ~~~ */

void Animation_Advanced_Audio_BassMidPulseWindow::init() {
 	Animation_Advanced_Audio::init();
 	this->name = F("Window[all]: Audio Bass and Mid Beat Pulse");
	this->num_strips = 3;
 	this->strips = WINDOW_ALL;

	this->left_eq = device_manager.getDevice<MSGEQ7>(0);
}

void Animation_Advanced_Audio_BassMidPulseWindow::step() {
	int low_sum = quadraticBrightness(left_eq->get8Bit(1));
	int mid_sum = (int) round(((float) quadraticBrightness(left_eq->get8Bit(3)) + (float) quadraticBrightness(left_eq->get8Bit(4)) * 0.75 + (float) quadraticBrightness(left_eq->get8Bit(5)) * 0.25) / 2.0);

	for (int x = 0; x < WINDOW_LENGTH; x++) {
		window1.setPixelColor(x, low_sum, 0, 0);
		window2.setPixelColor(x, mid_sum, mid_sum, 0);
		window3.setPixelColor(x, low_sum, 0, 0);
	}

{'fraction_non_alphanumeric': 0.17129153819801302, 'fraction_numerical': 0.03471508507479731, 'mean_word_length': 4.735428945645055, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 91, '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': '5513898', 'n_tokens_mistral': 3803, 'n_tokens_neox': 3453, 'n_words': 625}