LMMS
Loading...
Searching...
No Matches
SFZVoice.h
Go to the documentation of this file.
1/*************************************************************************************
2 * Original code copyright (C) 2012 Steve Folta
3 * Converted to Juce module (C) 2016 Leo Olivers
4 * Forked from https://github.com/stevefolta/SFZero
5 * For license info please see the LICENSE file distributed with this source code
6 *************************************************************************************/
7
8#ifndef SFZVOICE_H_INCLUDED
9#define SFZVOICE_H_INCLUDED
10
11#include "SFZEG.h"
12
14
15namespace sfzero
16{
17
18struct Region;
19
21{
22public:
23 Voice();
24 virtual ~Voice();
25
26 bool canPlaySound(water::SynthesiserSound *sound) override;
27 void startNote(int midiNoteNumber, float velocity, water::SynthesiserSound *sound, int currentPitchWheelPosition) override;
28 void stopNote(float velocity, bool allowTailOff) override;
29 void stopNoteForGroup();
30 void stopNoteQuick();
31 void pitchWheelMoved(int newValue) override;
32 void controllerMoved(int controllerNumber, int newValue) override;
33 void renderNextBlock(water::AudioSampleBuffer &outputBuffer, int startSample, int numSamples) override;
34 bool isPlayingNoteDown();
35 bool isPlayingOneShot();
36
37 int getGroup();
39
40 // Set the region to be used by the next startNote().
41 void setRegion(Region *nextRegion);
42
44
45private:
54
55 // Info only.
58
59 void calcPitchRatio();
60 void killNote();
61 double fractionalMidiNoteInHz(double note, double freqOfA = 440.0);
62
63 CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Voice)
64};
65}
66
67#endif // SFZVOICE_H_INCLUDED
Definition SFZEG.h:17
water::int64 sampleEnd_
Definition SFZVoice.h:52
bool isPlayingNoteDown()
Definition SFZVoice.cpp:271
water::int64 getOffBy()
Definition SFZVoice.cpp:277
Voice()
Definition SFZVoice.cpp:23
bool isPlayingOneShot()
Definition SFZVoice.cpp:273
water::int64 loopStart_
Definition SFZVoice.h:53
void killNote()
Definition SFZVoice.cpp:325
void pitchWheelMoved(int newValue) override
Definition SFZVoice.cpp:154
float noteGainRight_
Definition SFZVoice.h:49
int curPitchWheel_
Definition SFZVoice.h:47
void renderNextBlock(water::AudioSampleBuffer &outputBuffer, int startSample, int numSamples) override
Definition SFZVoice.cpp:166
int curMidiNote_
Definition SFZVoice.h:47
void setRegion(Region *nextRegion)
Definition SFZVoice.cpp:279
water::String infoString()
Definition SFZVoice.cpp:281
float noteGainLeft_
Definition SFZVoice.h:49
int curVelocity_
Definition SFZVoice.h:57
double fractionalMidiNoteInHz(double note, double freqOfA=440.0)
Definition SFZVoice.cpp:331
int numLoops_
Definition SFZVoice.h:56
void stopNoteForGroup()
Definition SFZVoice.cpp:141
double sourceSamplePosition_
Definition SFZVoice.h:50
Region * region_
Definition SFZVoice.h:46
void startNote(int midiNoteNumber, float velocity, water::SynthesiserSound *sound, int currentPitchWheelPosition) override
Definition SFZVoice.cpp:34
void stopNoteQuick()
Definition SFZVoice.cpp:153
void calcPitchRatio()
Definition SFZVoice.cpp:300
double pitchRatio_
Definition SFZVoice.h:48
void stopNote(float velocity, bool allowTailOff) override
Definition SFZVoice.cpp:122
bool canPlaySound(water::SynthesiserSound *sound) override
Definition SFZVoice.cpp:32
int getGroup()
Definition SFZVoice.cpp:275
virtual ~Voice()
Definition SFZVoice.cpp:30
water::int64 loopEnd_
Definition SFZVoice.h:53
void controllerMoved(int controllerNumber, int newValue) override
Definition SFZVoice.cpp:165
EG ampeg_
Definition SFZVoice.h:51
Definition AudioSampleBuffer.h:42
Definition String.h:48
Definition Synthesiser.h:52
Definition Synthesiser.h:96
Definition SFZDebug.cpp:11
long long int64
Definition water.h:100
Definition SFZRegion.h:30