Update copyright years
[zyn.git] / util.h
blob0cd1c31a7c7bbd8edeb32c921a186c15cb4bfb51
1 /*
2 ZynAddSubFX - a software synthesizer
4 Util.h - Miscellaneous functions
5 Copyright (C) 2002-2005 Nasca Octavian Paul
6 Author: Nasca Octavian Paul
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of version 2 of the GNU General Public License
10 as published by the Free Software Foundation.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License (version 2) for more details.
17 You should have received a copy of the GNU General Public License (version 2)
18 along with this program; if not, write to the Free Software Foundation,
19 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #ifndef UTIL_H
24 #define UTIL_H
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 #if 0
30 } /* Adjust editor indent */
31 #endif
33 // Velocity Sensing function
34 extern REALTYPE VelF(REALTYPE velocity,unsigned char scaling);
36 float
37 zyn_velocity_scale(float velocity, float scaling);
39 #define N_DETUNE_TYPES 4 //the number of detune types
40 extern REALTYPE getdetune(unsigned char type,unsigned short int coarsedetune,unsigned short int finedetune);
42 void
43 silence_buffer(
44 zyn_sample_type * buffer,
45 size_t size);
47 void
48 silence_two_buffers(
49 zyn_sample_type * buffer1,
50 zyn_sample_type * buffer2,
51 size_t size);
53 void
54 mix_add_two_buffers(
55 zyn_sample_type * buffer_mix_1,
56 zyn_sample_type * buffer_mix_2,
57 zyn_sample_type * buffer1,
58 zyn_sample_type * buffer2,
59 size_t size);
61 void
62 fadeout_two_buffers(
63 zyn_sample_type * buffer1,
64 zyn_sample_type * buffer2,
65 size_t size);
67 void
68 copy_buffer(
69 zyn_sample_type * buffer_dest,
70 zyn_sample_type * buffer_src,
71 size_t size);
73 void
74 multiply_buffer(
75 zyn_sample_type * buffer,
76 float multiplyer,
77 size_t size);
80 * Random generator (0.0..1.0)
82 float
83 zyn_random();
85 #define ZYN_BOOL_XOR(p, q) (((p) && !(q)) || (!(p) && (q)))
87 #if 0
88 { /* Adjust editor indent */
89 #endif
90 #ifdef __cplusplus
91 } /* extern "C" */
92 #endif
94 #endif