OpenShot Audio Library | OpenShotAudio: juce_MPESynthesiserVoice.h Source File

OpenShot Audio Library | OpenShotAudio 0.6.0

Loading...
Searching...
No Matches
juce_MPESynthesiserVoice.h
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 The code included in this file is provided under the terms of the ISC license
11 http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 To use, copy, modify, and/or distribute this software for any purpose with or
13 without fee is hereby granted provided that the above copyright notice and
14 this permission notice appear in all copies.
15
16 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 DISCLAIMED.
19
20 ==============================================================================
21*/
22
23namespace juce
24{
25
26//==============================================================================
37 class JUCE_API MPESynthesiserVoice
38{
39public:
40 //==============================================================================
42 MPESynthesiserVoice();
43
45 virtual ~MPESynthesiserVoice();
46
51 MPENote getCurrentlyPlayingNote() const noexcept { return currentlyPlayingNote; }
52
56 bool isCurrentlyPlayingNote (MPENote note) const noexcept;
57
62 virtual bool isActive() const { return currentlyPlayingNote.isValid(); }
63
65 bool isPlayingButReleased() const noexcept;
66
70 virtual void noteStarted() = 0;
71
84 virtual void noteStopped (bool allowTailOff) = 0;
85
90 virtual void notePressureChanged() = 0;
91
99 virtual void notePitchbendChanged() = 0;
100
105 virtual void noteTimbreChanged() = 0;
106
114 virtual void noteKeyStateChanged() = 0;
115
131 virtual void renderNextBlock (AudioBuffer<float>& outputBuffer,
132 int startSample,
133 int numSamples) = 0;
134
140 virtual void renderNextBlock (AudioBuffer<double>& /*outputBuffer*/,
141 int /*startSample*/,
142 int /*numSamples*/) {}
143
152 virtual void setCurrentSampleRate (double newRate) { currentSampleRate = newRate; }
153
157 double getSampleRate() const noexcept { return currentSampleRate; }
158
162 uint32 noteOnTime = 0;
163
164protected:
165 //==============================================================================
178 void clearCurrentNote() noexcept;
179
180 //==============================================================================
181 double currentSampleRate = 0.0;
182 MPENote currentlyPlayingNote;
183
184private:
185 //==============================================================================
186 friend class MPESynthesiser;
187
188 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MPESynthesiserVoice)
189};
190
191} // namespace juce
juce::AudioBuffer
Definition juce_AudioSampleBuffer.h:34
juce::MPESynthesiserVoice::clearCurrentNote
void clearCurrentNote() noexcept
Definition juce_MPESynthesiserVoice.cpp:45
juce::MPESynthesiserVoice::renderNextBlock
virtual void renderNextBlock(AudioBuffer< float > &outputBuffer, int startSample, int numSamples)=0
juce::MPESynthesiserVoice::noteTimbreChanged
virtual void noteTimbreChanged()=0
juce::MPESynthesiserVoice::setCurrentSampleRate
virtual void setCurrentSampleRate(double newRate)
Definition juce_MPESynthesiserVoice.h:152
juce::MPESynthesiserVoice::getCurrentlyPlayingNote
MPENote getCurrentlyPlayingNote() const noexcept
Definition juce_MPESynthesiserVoice.h:51
juce::MPESynthesiserVoice::noteStarted
virtual void noteStarted()=0
juce::MPESynthesiserVoice::getSampleRate
double getSampleRate() const noexcept
Definition juce_MPESynthesiserVoice.h:157
juce::MPESynthesiserVoice::noteOnTime
uint32 noteOnTime
Definition juce_MPESynthesiserVoice.h:162
juce::MPESynthesiserVoice::MPESynthesiserVoice
MPESynthesiserVoice()
Definition juce_MPESynthesiserVoice.cpp:26
juce::MPESynthesiserVoice::noteStopped
virtual void noteStopped(bool allowTailOff)=0
juce::MPESynthesiserVoice::notePitchbendChanged
virtual void notePitchbendChanged()=0
juce::MPESynthesiserVoice::notePressureChanged
virtual void notePressureChanged()=0
juce::MPESynthesiserVoice::isActive
virtual bool isActive() const
Definition juce_MPESynthesiserVoice.h:62
juce::MPESynthesiserVoice::noteKeyStateChanged
virtual void noteKeyStateChanged()=0
juce::MPENote
Definition juce_MPENote.h:40