<commit_before>/* cmaj.c: Generate a C chord in various wave forms
 *
 * Copyright 2016 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <string.h>

#include "output.h"
#include "waves.h"

#define noteC 261.6
#define noteE 329.6
#define noteG 392.0

#define SampleRate 44100

int main(int argc, char *argv[])
{
	fpWave wave = saw;

	if (argc == 2)
	{
		if (strcmp(argv[1], "sine") == 0)
			wave = sine;
		else if (strcmp(argv[1], "square") == 0)
			wave = square;
		else if (strcmp(argv[1], "absine") == 0)
			wave = absine;
		else if (strcmp(argv[1], "triangle") == 0)
			wave = triangle;
	}

	OutputHeader(3 * 44100);

	for (int i = 0; i < SampleRate*3; i++)
	{
		uint16_t total = (0
			+ wave(phase(noteC, i))
			+ ((i > SampleRate)
				? wave(phase(noteE, i-SampleRate))
				: 0)
			+ ((i > SampleRate * 2)
				? wave(phase(noteG, i-SampleRate*2))
				: 0))/3*0x7FFF;
		//ftotal /= 3;
		//uint16_t total = ftotal * 0x7FFF;

		Output16(total);
		Output16(total);
	}
}

<commit_msg>Remove unneeded comments<commit_after>/* cmaj.c: Generate a C chord in various wave forms
 *
 * Copyright 2016 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <string.h>

#include "output.h"
#include "waves.h"

#define noteC 261.6
#define noteE 329.6
#define noteG 392.0

#define SampleRate 44100

int main(int argc, char *argv[])
{
	fpWave wave = saw;

	if (argc == 2)
	{
		if (strcmp(argv[1], "sine") == 0)
			wave = sine;
		else if (strcmp(argv[1], "square") == 0)
			wave = square;
		else if (strcmp(argv[1], "absine") == 0)
			wave = absine;
		else if (strcmp(argv[1], "triangle") == 0)
			wave = triangle;
	}

	OutputHeader(3 * 44100);

	for (int i = 0; i < SampleRate*3; i++)
	{
		uint16_t total = (0
			+ wave(phase(noteC, i))
			+ ((i > SampleRate)
				? wave(phase(noteE, i-SampleRate))
				: 0)
			+ ((i > SampleRate * 2)
				? wave(phase(noteG, i-SampleRate*2))
				: 0))/3*0x7FFF;

		Output16(total);
		Output16(total);
	}
}


{'fraction_non_alphanumeric': 0.13672922252010725, 'fraction_numerical': 0.03920911528150134, 'mean_word_length': 3.370424597364568, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '851986', 'n_tokens_mistral': 1187, 'n_tokens_neox': 1032, 'n_words': 356}