aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/fftease/src/main.h
blob: aeaea3e421306ac5f0ddd401311462ab6441607c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*

FFTease - A set of Live Spectral Processors
Originally written by Eric Lyon and Christopher Penrose for the Max/MSP platform

Copyright (c)Thomas Grill (xovo@gmx.net)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.  

*/

#ifndef __FFTEASE_H
#define __FFTEASE_H

#define FFTEASE_VERSION "0.0.1"


#define FLEXT_ATTRIBUTES 1 

#include <flext.h>

#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 401)
#error You need at least flext version 0.4.1
#endif


#include "pv.h"

// lazy me
#define F float
#define D double
#define I int
#define L long
#define C char
#define V void
#define BL bool
#define S t_sample



class fftease:
	public flext_dsp
{
	FLEXT_HEADER_S(fftease,flext_dsp,setup)
	
public:
	fftease(I mult,I flags);
	virtual ~fftease();

protected:

	virtual BL Init();
	virtual V Exit();

	virtual V m_dsp(I n,S *const *in,S *const *out);
	virtual V m_signal(I n,S *const *in,S *const *out);

	virtual V Set();
	virtual V Clear();
	virtual V Delete();
	virtual V Transform(I _N2,S *const *in) = 0;


	I Mult() const { return _mult; }

    F *_input1,*_input2;
    F *_buffer1,*_buffer2;
    F *_channel1,*_channel2;
    F *_output;
    F *_trigland;
    I *_bitshuffle;
    F *_Wanal,*_Wsyn,*_Hwin;

    I _inCount;

	enum { 
		F_STEREO = 0x01,
		F_WINDOW = 0x02,
		F_BITSHUFFLE = 0x04,
		F_CONVERT = 0x08,F_CRES = 0x10,
		F_RMS = 0x20
	};

	I _mult,_flags;
	F _rms;

private:
	I blsz;
	F smprt;

	static V setup(t_classid c) {}

};


#endif