Add python3 to github action test deps
[zynaddsubfx-code.git] / src / globals.cpp
blobc85b2c1b0cdb827330d75c88549671ace6efd3e6
1 /*
2 ZynAddSubFX - a software synthesizer
4 globals.h - it contains program settings and the program capabilities
5 like number of parts, of effects
6 Copyright (C) 2002-2005 Nasca Octavian Paul
7 Author: Nasca Octavian Paul
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2
12 of the License, or (at your option) any later version.
15 #include "Misc/Util.h"
16 #include "globals.h"
18 namespace zyn {
20 void SYNTH_T::alias(bool randomize)
22 halfsamplerate_f = (samplerate_f = samplerate) / 2.0f;
23 buffersize_f = buffersize;
24 bufferbytes = buffersize * sizeof(float);
25 oscilsize_f = oscilsize;
27 //produce denormal buf
28 // note: once there will be more buffers, use a cleanup function
29 // for deleting the buffers and also call it in the dtor
30 denormalkillbuf.resize(buffersize);
31 for(int i = 0; i < buffersize; ++i)
32 if(randomize)
33 denormalkillbuf[i] = (RND - 0.5f) * 1e-16;
34 else
35 denormalkillbuf[i] = 0;