OpenShot Library | OpenShotAudio  0.2.1
juce::MPEValue Class Reference

This class represents a single value for any of the MPE dimensions of control. More...

#include <juce_MPEValue.h>

Public Member Functions

 MPEValue () noexcept
 Default constructor. More...
 
int as7BitInt () const noexcept
 Retrieves the current value as an integer between 0 and 127. More...
 
int as14BitInt () const noexcept
 Retrieves the current value as an integer between 0 and 16383. More...
 
float asSignedFloat () const noexcept
 Retrieves the current value mapped to a float between -1.0f and 1.0f. More...
 
float asUnsignedFloat () const noexcept
 Retrieves the current value mapped to a float between 0.0f and 1.0f. More...
 
bool operator== (const MPEValue &other) const noexcept
 Returns true if two values are equal. More...
 
bool operator!= (const MPEValue &other) const noexcept
 Returns true if two values are not equal. More...
 

Static Public Member Functions

static MPEValue from7BitInt (int value) noexcept
 Constructs an MPEValue from an integer between 0 and 127 (using 7-bit precision).
 
static MPEValue from14BitInt (int value) noexcept
 Constructs an MPEValue from an integer between 0 and 16383 (using 14-bit precision).
 
static MPEValue centreValue () noexcept
 Constructs an MPEValue corresponding to the centre value. More...
 
static MPEValue minValue () noexcept
 Constructs an MPEValue corresponding to the minimum value. More...
 
static MPEValue maxValue () noexcept
 Constructs an MPEValue corresponding to the maximum value. More...
 

Detailed Description

This class represents a single value for any of the MPE dimensions of control.

It supports values with 7-bit or 14-bit resolutions (corresponding to 1 or 2 MIDI bytes, respectively). It also offers helper functions to query the value in a variety of representations that can be useful in an audio or MIDI context.

Definition at line 40 of file juce_MPEValue.h.

Constructor & Destructor Documentation

◆ MPEValue()

juce::MPEValue::MPEValue ( )
noexcept

Default constructor.

Constructs an MPEValue corresponding to the centre value.

Definition at line 26 of file juce_MPEValue.cpp.

Member Function Documentation

◆ centreValue()

MPEValue juce::MPEValue::centreValue ( )
staticnoexcept

Constructs an MPEValue corresponding to the centre value.

Definition at line 48 of file juce_MPEValue.cpp.

References from7BitInt().

Referenced by juce::MPEInstrument::noteOff(), operator!=(), juce::MPEInstrument::polyAftertouch(), and juce::MPEInstrument::releaseAllNotes().

◆ minValue()

MPEValue juce::MPEValue::minValue ( )
staticnoexcept

Constructs an MPEValue corresponding to the minimum value.

Definition at line 47 of file juce_MPEValue.cpp.

References from7BitInt().

Referenced by juce::MPEInstrument::MPEInstrument(), juce::MPEInstrument::noteOff(), operator!=(), and juce::MPEInstrument::polyAftertouch().

◆ maxValue()

MPEValue juce::MPEValue::maxValue ( )
staticnoexcept

Constructs an MPEValue corresponding to the maximum value.

Definition at line 49 of file juce_MPEValue.cpp.

References from7BitInt().

Referenced by operator!=().

◆ as7BitInt()

int juce::MPEValue::as7BitInt ( ) const
noexcept

Retrieves the current value as an integer between 0 and 127.

Information will be lost if the value was initialised with a precision higher than 7-bit.

Definition at line 51 of file juce_MPEValue.cpp.

Referenced by operator!=(), and juce::MPEInstrument::releaseAllNotes().

◆ as14BitInt()

int juce::MPEValue::as14BitInt ( ) const
noexcept

Retrieves the current value as an integer between 0 and 16383.

Resolution will be lost if the value was initialised with a precision higher than 14-bit.

Definition at line 56 of file juce_MPEValue.cpp.

Referenced by operator!=(), and juce::MPEInstrument::releaseAllNotes().

◆ asSignedFloat()

float juce::MPEValue::asSignedFloat ( ) const
noexcept

Retrieves the current value mapped to a float between -1.0f and 1.0f.

Definition at line 62 of file juce_MPEValue.cpp.

Referenced by operator!=(), and juce::MPEInstrument::polyAftertouch().

◆ asUnsignedFloat()

float juce::MPEValue::asUnsignedFloat ( ) const
noexcept

Retrieves the current value mapped to a float between 0.0f and 1.0f.

Definition at line 69 of file juce_MPEValue.cpp.

Referenced by operator!=().

◆ operator==()

bool juce::MPEValue::operator== ( const MPEValue other) const
noexcept

Returns true if two values are equal.

Definition at line 75 of file juce_MPEValue.cpp.

Referenced by operator!=().

◆ operator!=()

bool juce::MPEValue::operator!= ( const MPEValue other) const
noexcept

Returns true if two values are not equal.

Definition at line 80 of file juce_MPEValue.cpp.

References as14BitInt(), as7BitInt(), asSignedFloat(), asUnsignedFloat(), centreValue(), from14BitInt(), from7BitInt(), maxValue(), minValue(), and operator==().


The documentation for this class was generated from the following files: