<commit_before>(function(App) {
	"use strict";

	var Readers = {
		silent : function(buffer, channel, position, speed, samplesPerSegment) {
			return 0;
		},
		normal : function(buffer, channel, position, speed, samplesPerSegment) {
			var sampleValue = 0;

			position = position * speed;

			if(buffer.length > position) {
				sampleValue = buffer.getSample(position, channel);
			}

			return sampleValue;
		},
		reverse : function(buffer, channel, position, speed, samplesPerSegment) {
			var sampleValue = 0;

			position = (samplesPerSegment - position) * speed;

			if(buffer.length > position) {
				sampleValue = buffer.getSample(position, channel);
			}

			return sampleValue;
		}
	};

	Readers['default'] = Readers.normal;

	App.Readers = Readers;
})(App || {});<commit_msg>naive implementation of twoRepeats, vinylStart and vinylStop readers<commit_after>(function(App) {
	"use strict";

	var Readers = {
		silent : function(buffer, channel, position, speed, samplesPerSegment) {
			return 0;
		},
		normal : function(buffer, channel, position, speed, samplesPerSegment) {
			var sampleValue = 0;

			position = position * speed;

			if(buffer.length > position) {
				sampleValue = buffer.getSample(position, channel);
			}

			return sampleValue;
		},
		reverse : function(buffer, channel, position, speed, samplesPerSegment) {
			var sampleValue = 0;

			position = (samplesPerSegment - position) * speed;

			if(buffer.length > position) {
				sampleValue = buffer.getSample(position, channel);
			}

			return sampleValue;
		},
		twoRepeats : function(buffer, channel, position, speed, samplesPerSegment) {
			var sampleValue = 0;

			position = (position % (samplesPerSegment / 2)) * speed; //TODO does it works ?

			if(buffer.length > position) {
				sampleValue = buffer.getSample(position, channel);
			}

			return sampleValue;
		},
		vinylStart : function(buffer, channel, position, speed, samplesPerSegment) {
			var sampleValue = 0;

			var ratio = position / samplesPerSegment;

			position = Math.sqrt(ratio) * samplesPerSegment * speed; //TODO does it works ?

			if(buffer.length > position) {
				sampleValue = buffer.getSample(position, channel);
			}

			return sampleValue;
		},
		vinylStop : function(buffer, channel, position, speed, samplesPerSegment) {
			var sampleValue = 0;

			var ratio = position / samplesPerSegment;

			position = Math.pow(1 - ratio, 2) * samplesPerSegment * speed; //TODO does it works

			if(buffer.length > position) {
				sampleValue = buffer.getSample(position, channel);
			}

			return sampleValue;
		}
	};

	Readers['default'] = Readers.normal;

	App.Readers = Readers;
})(App || {});
{'fraction_non_alphanumeric': 0.12015065913370998, 'fraction_numerical': 0.004519774011299435, 'mean_word_length': 3.742857142857143, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '2186363', 'n_tokens_mistral': 944, 'n_tokens_neox': 780, 'n_words': 204}