/[svn]/linuxsampler/trunk/src/engines/sf2/SF2SignalUnitRack.h
ViewVC logotype

Contents of /linuxsampler/trunk/src/engines/sf2/SF2SignalUnitRack.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2207 - (show annotations) (download) (as text)
Fri Jul 15 15:43:49 2011 UTC (12 years, 9 months ago) by iliev
File MIME type: text/x-c++hdr
File size: 4359 byte(s)
* simplified the signal unit model
* sf2: initial implementation of modulation LFO and cutoff filter

1 /***************************************************************************
2 * *
3 * LinuxSampler - modular, streaming capable sampler *
4 * *
5 * Copyright (C) 2011 Grigor Iliev *
6 * *
7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. *
11 * *
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 for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with this program; if not, write to the Free Software *
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
20 * MA 02111-1307 USA *
21 ***************************************************************************/
22
23 #ifndef __LS_SF2SIGNALUNITRACK_H__
24 #define __LS_SF2SIGNALUNITRACK_H__
25
26 #include "../common/SignalUnitRack.h"
27 #include "../sfz/EGADSR.h"
28 #include "../common/AbstractVoice.h"
29
30 namespace LinuxSampler { namespace sf2 {
31
32 class Voice;
33
34 class EGUnit : public SignalUnitBase<Voice>, public ::LinuxSampler::sfz::EGADSR {
35 public:
36 virtual bool Active() { return active(); }
37 virtual float GetLevel() { return getLevel(); }
38 virtual void EnterReleaseStage();
39 virtual void CancelRelease();
40 };
41
42 class VolEGUnit : public EGUnit {
43 public:
44 virtual void Trigger();
45 virtual void Increment();
46 };
47
48 class ModEGUnit : public EGUnit {
49 public:
50 virtual void Trigger();
51 virtual void Increment();
52 };
53
54 class ModLfoUnit : public SignalUnitBase<Voice>, public LFOSigned {
55 public:
56 ModLfoUnit(): LFOSigned(1200.0f) { }
57 virtual bool Active() { return true; }
58 virtual void Trigger();
59 virtual void Increment();
60 virtual float GetLevel() { return Level; }
61 };
62
63 class VibLfoUnit : public SignalUnitBase<Voice>, public LFOSigned {
64 public:
65 VibLfoUnit(): LFOSigned(1200.0f) { }
66 virtual bool Active() { return true; }
67 virtual void Trigger();
68 virtual void Increment();
69 virtual float GetLevel() { return Level; }
70 };
71
72 class EndpointUnit : public EndpointSignalUnitBase<Voice> {
73 public:
74 Parameter *prmVolEg, *prmModEgPitch, *prmModEgCutoff, *prmModLfoVol,
75 *prmModLfoPitch, *prmModLfoCutoff, *prmVibLfo;
76
77 EndpointUnit();
78
79 virtual void Trigger();
80
81 /** The endpoint should be active until the volume EG is active. */
82 virtual bool Active();
83
84 virtual float GetVolume();
85 virtual float GetFilterCutoff();
86 virtual float GetPitch();
87 virtual float GetResonance();
88 };
89
90 class SF2SignalUnitRack : public SignalUnitRackBase<Voice> {
91 private:
92 VolEGUnit suVolEG;
93 ModEGUnit suModEG;
94 ModLfoUnit suModLfo;
95 VibLfoUnit suVibLfo;
96 EndpointUnit suEndpoint;
97
98
99 public:
100
101 /**
102 * @param Voice The voice to which this rack belongs.
103 */
104 SF2SignalUnitRack(Voice* Voice);
105
106 virtual void Trigger();
107 virtual EndpointSignalUnit* GetEndpointUnit();
108 };
109
110 }} // namespace LinuxSampler::sf2
111
112 #endif /* __LS_SF2SIGNALUNITRACK_H__ */
113

  ViewVC Help
Powered by ViewVC