/[svn]/linuxsampler/trunk/src/engines/common/LFOAll.h
ViewVC logotype

Contents of /linuxsampler/trunk/src/engines/common/LFOAll.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3612 - (show annotations) (download) (as text)
Mon Sep 30 18:03:43 2019 UTC (4 years, 6 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 3556 byte(s)
Added new LFO implementations:

* Added int math square LFO implementation.

* Added int math saw LFO implementation.

* Added numeric complex nr sine LFO implementation.

* Added public API C++ class "LFO", which is a cluster class
  encapsulating all the sampler's LFO implementations to be used by
  3rd party applications (e.g. by Gigedit).

* Marked class LFOTriangleDiHarmonic as deprecated
  (will be removed in future).

* Added LFOAll.h which includes all LFO implementation's header files.

* Fixed benchmarks/triang.cpp falsely having favoured "int math abs"
  algorithm (since result of 2nd run was not accumulated).

* Added benchmark for saw wave (benchmarks/saw.cpp).

* Added benchmark for sine wave (benchmarks/sine.cpp).

* Added benchmark for square wave (benchmarks/square.cpp).

* Increased amount of benchmarks runs by factor 6 to achieve benchmark
  times which are large enough on modern systems.

* Cleanup of LFO APIs.

* Bumped version (2.1.1.svn18).

1 /*
2 * Copyright (c) 2019 Christian Schoenebeck
3 *
4 * http://www.linuxsampler.org
5 *
6 * This file is part of LinuxSampler and released under the same terms.
7 * See README file for details.
8 */
9
10 #ifndef LS_LFO_ALL_H
11 #define LS_LFO_ALL_H
12
13 // This header pulls all LFO header files available in the sampler's code base.
14 //
15 // Since we have numerous different LFO wave form types, and for each of them
16 // even several different implementations, this header serves for including all
17 // the individual LFO implementations' header files and additionally it
18 // automatically selects (by typedefs) for each wave form one specific
19 // implementation (either because the configure script's benchmarks picked the
20 // most fastest/efficient implementation for this machine, or because the it was
21 // explicitly human selected (i.e. by configure script argument).
22
23 #include "../../common/global_private.h"
24 #include "LFOBase.h"
25
26 // IDs of the two possible implementations
27 // we get the implementation to pick from config.h
28 // the implementation IDs should be the same like in benchmarks/triang.cpp !
29 #define TRIANG_INT_MATH_SOLUTION 2
30 #define TRIANG_DI_HARMONIC_SOLUTION 3
31 #define TRIANG_INT_ABS_MATH_SOLUTION 5
32
33 // include the appropriate (unsigned) triangle LFO implementation
34 #if CONFIG_UNSIGNED_TRIANG_ALGO == TRIANG_INT_MATH_SOLUTION
35 # include "LFOTriangleIntMath.h"
36 #elif CONFIG_UNSIGNED_TRIANG_ALGO == TRIANG_INT_ABS_MATH_SOLUTION
37 # include "LFOTriangleIntAbsMath.h"
38 #elif CONFIG_UNSIGNED_TRIANG_ALGO == TRIANG_DI_HARMONIC_SOLUTION
39 # include "LFOTriangleDiHarmonic.h"
40 #else
41 # error "Unknown or no (unsigned) triangle LFO implementation selected!"
42 #endif
43
44 // include the appropriate (signed) triangle LFO implementation
45 #if CONFIG_SIGNED_TRIANG_ALGO == TRIANG_INT_MATH_SOLUTION
46 # include "LFOTriangleIntMath.h"
47 #elif CONFIG_SIGNED_TRIANG_ALGO == TRIANG_INT_ABS_MATH_SOLUTION
48 # include "LFOTriangleIntAbsMath.h"
49 #elif CONFIG_SIGNED_TRIANG_ALGO == TRIANG_DI_HARMONIC_SOLUTION
50 # include "LFOTriangleDiHarmonic.h"
51 #else
52 # error "Unknown or no (signed) triangle LFO implementation selected!"
53 #endif
54
55 //TODO: benchmark in configure and pull the relevant implementation for these wave forms as well like we do for triangle
56 #include "LFOSquareIntMath.h"
57 #include "LFOSawIntMath.h"
58 #include "LFOSine.h"
59
60 namespace LinuxSampler {
61
62 #if CONFIG_UNSIGNED_TRIANG_ALGO == TRIANG_INT_MATH_SOLUTION
63 typedef LFOTriangleIntMath<LFO::range_unsigned> LFOUnsigned;
64 #elif CONFIG_UNSIGNED_TRIANG_ALGO == TRIANG_INT_ABS_MATH_SOLUTION
65 typedef LFOTriangleIntAbsMath<LFO::range_unsigned> LFOUnsigned;
66 #elif CONFIG_UNSIGNED_TRIANG_ALGO == TRIANG_DI_HARMONIC_SOLUTION
67 typedef LFOTriangleDiHarmonic<LFO::range_unsigned> LFOUnsigned;
68 #endif
69
70 #if CONFIG_SIGNED_TRIANG_ALGO == TRIANG_INT_MATH_SOLUTION
71 typedef LFOTriangleIntMath<LFO::range_signed> LFOSigned;
72 #elif CONFIG_SIGNED_TRIANG_ALGO == TRIANG_INT_ABS_MATH_SOLUTION
73 typedef LFOTriangleIntAbsMath<LFO::range_signed> LFOSigned;
74 #elif CONFIG_SIGNED_TRIANG_ALGO == TRIANG_DI_HARMONIC_SOLUTION
75 typedef LFOTriangleDiHarmonic<LFO::range_signed> LFOSigned;
76 #endif
77
78 typedef LFOSquareIntMath<LFO::range_signed> LFOSquareSigned;
79 typedef LFOSquareIntMath<LFO::range_unsigned> LFOSquareUnsigned;
80
81 typedef LFOSawIntMath<LFO::range_signed> LFOSawSigned;
82 typedef LFOSawIntMath<LFO::range_unsigned> LFOSawUnsigned;
83
84 typedef LFOSine<LFO::range_signed> LFOSineSigned;
85 typedef LFOSine<LFO::range_unsigned> LFOSineUnsigned;
86
87 } // namespace LinuxSampler
88
89 #endif // LS_LFO_ALL_H

  ViewVC Help
Powered by ViewVC