<commit_before>/* 
 * Hanning Window Function Unit for Jamoma DSP
 * Copyright © 2010 by <NAME>
 * 
 * License: This code is licensed under the terms of the GNU LGPL
 * http://www.gnu.org/licenses/lgpl.html 
 */

#include "HanningWindow.h"

#define thisTTClass			HanningWindow
#define thisTTClassName		"hanning"
#define thisTTClassTags		"audio, processor, function, window"


TT_AUDIO_CONSTRUCTOR
{
	setProcessMethod(processAudio);
	setCalculateMethod(calculateValue);
}


HanningWindow::~HanningWindow()
{
	;
}


// hanning(x) = 0.5 + 0.5*cos(2*PI*(x-0.5))
TTErr HanningWindow::calculateValue(const TTFloat64& x, TTFloat64& y, TTPtrSizedInt data)
{
	y = 0.5 + cos(2.0*kTTPi*(x-0.5));
	return kTTErrNone;
}


TTErr HanningWindow::processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
{
	TT_WRAP_CALCULATE_METHOD(calculateValue);
}
<commit_msg>Fixing formula in Hanning Window.<commit_after>/* 
 * Hanning Window Function Unit for Jamoma DSP
 * Copyright © 2010 by <NAME>
 * 
 * License: This code is licensed under the terms of the GNU LGPL
 * http://www.gnu.org/licenses/lgpl.html 
 */

#include "HanningWindow.h"

#define thisTTClass			HanningWindow
#define thisTTClassName		"hanning"
#define thisTTClassTags		"audio, processor, function, window"


TT_AUDIO_CONSTRUCTOR
{
	setProcessMethod(processAudio);
	setCalculateMethod(calculateValue);
}


HanningWindow::~HanningWindow()
{
	;
}


// hanning(x) = 0.5 + 0.5*cos(2*PI*(x-0.5))
TTErr HanningWindow::calculateValue(const TTFloat64& x, TTFloat64& y, TTPtrSizedInt data)
{
	y = 0.5 + 0.5*cos(2.0*kTTPi*(x-0.5));
	return kTTErrNone;
}


TTErr HanningWindow::processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
{
	TT_WRAP_CALCULATE_METHOD(calculateValue);
}

{'fraction_non_alphanumeric': 0.12171428571428572, 'fraction_numerical': 0.025142857142857144, 'mean_word_length': 5.32129963898917, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6605267', 'n_tokens_mistral': 686, 'n_tokens_neox': 646, 'n_words': 136}