JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_MPESynthesiserVoice.h
Go to the documentation of this file.
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//==============================================================================
37class JUCE_API MPESynthesiserVoice
38{
39public:
40 //==============================================================================
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
189};
190
191} // namespace juce
A multi-channel buffer containing floating point audio samples.
Represents an MPE voice that an MPESynthesiser can use to play a sound.
virtual void setCurrentSampleRate(double newRate)
Changes the voice's reference sample rate.
MPENote getCurrentlyPlayingNote() const noexcept
Returns the MPENote that this voice is currently playing.
double getSampleRate() const noexcept
Returns the current target sample rate at which rendering is being done.
virtual bool isActive() const
Returns true if this voice is currently busy playing a sound.
Base class for an MPE-compatible musical device that can play sounds.
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
This is a shorthand way of writing both a JUCE_DECLARE_NON_COPYABLE and JUCE_LEAK_DETECTOR macro for ...
JUCE Namespace.
unsigned int uint32
A platform-independent 32-bit unsigned integer type.
This struct represents a playing MPE note.