forked from klang-modular/synthapp
parent
2f528ca33c
commit
b933f936f8
9 changed files with 112 additions and 29 deletions
@ -0,0 +1,10 @@ |
|||||||
|
#include <wx/wxprec.h> |
||||||
|
|
||||||
|
#ifndef WX_PRECOMP |
||||||
|
#include <wx/wx.h> |
||||||
|
#endif |
||||||
|
|
||||||
|
class CCSlider : public wxPanel { |
||||||
|
public: |
||||||
|
CCSlider(wxWindow* parent, wxWindowID id, int value, const wxString& label); |
||||||
|
}; |
@ -0,0 +1,8 @@ |
|||||||
|
#include "ccslider.h" |
||||||
|
|
||||||
|
CCSlider::CCSlider(wxWindow* parent, wxWindowID id, int value, const wxString& label) : wxPanel(parent) { |
||||||
|
wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL); |
||||||
|
SetSizer(sizer); |
||||||
|
sizer->Add(new wxSlider(this, id, value, 0, 127, wxDefaultPosition, wxDefaultSize, wxSL_VERTICAL | wxSL_INVERSE), 1, wxEXPAND); |
||||||
|
sizer->Add(new wxStaticText(this, wxID_ANY, label)); |
||||||
|
} |
@ -0,0 +1,30 @@ |
|||||||
|
#include <stdio.h> |
||||||
|
#include <math.h> |
||||||
|
|
||||||
|
#include "synth/dsp/filter.h" |
||||||
|
|
||||||
|
int main(int argc, char** argv) { |
||||||
|
FILE* f; |
||||||
|
|
||||||
|
float klut[KLUT_SIZE]; |
||||||
|
for(int i = 0; i < KLUT_SIZE; ++i) { |
||||||
|
klut[i] = tan(M_PI_4 * 0.002 * exp(i / (KLUT_SIZE - 1.0) * FILTER_K_BASE)); |
||||||
|
} |
||||||
|
|
||||||
|
f = fopen("src/synth/dsp/filterlut.cpp", "w"); |
||||||
|
fputs("float klut[] = {\n", f); |
||||||
|
for(int i = 0; i < KLUT_SIZE; ++i) { |
||||||
|
if(i % 16 == 0) { |
||||||
|
fputs(" ", f); |
||||||
|
} |
||||||
|
fprintf(f, "%.7f", klut[i]); |
||||||
|
if(i < KLUT_SIZE - 1) { |
||||||
|
fputs(", ", f); |
||||||
|
} |
||||||
|
if(i % 16 == 15) { |
||||||
|
putc('\n', f); |
||||||
|
} |
||||||
|
} |
||||||
|
fputs("};\n", f); |
||||||
|
fclose(f);
|
||||||
|
} |
@ -0,0 +1,6 @@ |
|||||||
|
float klut[] = { |
||||||
|
0.0015708, 0.0017336, 0.0019134, 0.0021118, 0.0023307, 0.0025723, 0.0028390, 0.0031333, 0.0034582, 0.0038167, 0.0042124, 0.0046491, 0.0051311, 0.0056631, 0.0062502, 0.0068982,
|
||||||
|
0.0076134, 0.0084028, 0.0092740, 0.0102355, 0.0112968, 0.0124681, 0.0137608, 0.0151877, 0.0167625, 0.0185007, 0.0204193, 0.0225369, 0.0248743, 0.0274544, 0.0303024, 0.0334462,
|
||||||
|
0.0369167, 0.0407480, 0.0449779, 0.0496483, 0.0548053, 0.0605004, 0.0667905, 0.0737388, 0.0814158, 0.0898997, 0.0992782, 0.1096492, 0.1211226, 0.1338222, 0.1478880, 0.1634790,
|
||||||
|
0.1807770, 0.1999912, 0.2213640, 0.2451794, 0.2717728, 0.3015462, 0.3349871, 0.3726965, 0.4154281, 0.4641461, 0.5201120, 0.5850177, 0.6611994, 0.7519926, 0.8623521, 1.0000000 |
||||||
|
}; |
Loading…
Reference in new issue