Loading...
Searching...
No Matches
juce_MPESynthesiserVoice.h
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
class JUCE_API MPESynthesiserVoice
{
public:
//==============================================================================
MPESynthesiserVoice();
virtual ~MPESynthesiserVoice();
MPENote getCurrentlyPlayingNote() const noexcept { return currentlyPlayingNote; }
bool isCurrentlyPlayingNote (MPENote note) const noexcept;
virtual bool isActive() const { return currentlyPlayingNote.isValid(); }
bool isPlayingButReleased() const noexcept;
virtual void noteStarted() = 0;
virtual void noteStopped (bool allowTailOff) = 0;
virtual void notePressureChanged() = 0;
virtual void notePitchbendChanged() = 0;
virtual void noteTimbreChanged() = 0;
virtual void noteKeyStateChanged() = 0;
virtual void renderNextBlock (AudioBuffer<float>& outputBuffer,
int startSample,
int numSamples) = 0;
virtual void renderNextBlock (AudioBuffer<double>& /*outputBuffer*/,
int /*startSample*/,
int /*numSamples*/) {}
virtual void setCurrentSampleRate (double newRate) { currentSampleRate = newRate; }
double getSampleRate() const noexcept { return currentSampleRate; }
uint32 noteOnTime = 0;
protected:
//==============================================================================
void clearCurrentNote() noexcept;
//==============================================================================
double currentSampleRate = 0.0;
MPENote currentlyPlayingNote;
private:
//==============================================================================
friend class MPESynthesiser;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MPESynthesiserVoice)
};
} // 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