JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::MPEValue Class Reference

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

#include <juce_MPEValue.h>

Collaboration diagram for juce::MPEValue:

Public Member Functions

 MPEValue () noexcept
 Default constructor. More...
 
int as14BitInt () const noexcept
 Retrieves the current value as an integer between 0 and 16383. More...
 
int as7BitInt () const noexcept
 Retrieves the current value as an integer between 0 and 127. 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 not equal. More...
 
bool operator== (const MPEValue &other) const noexcept
 Returns true if two values are equal. More...
 

Static Public Member Functions

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

Private Member Functions

 MPEValue (int normalisedValue)
 

Private Attributes

int normalisedValue = 8192
 

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.

@tags{Audio}

Constructor & Destructor Documentation

◆ MPEValue() [1/2]

juce::MPEValue::MPEValue ( )
noexcept

Default constructor.

Constructs an MPEValue corresponding to the centre value.

◆ MPEValue() [2/2]

juce::MPEValue::MPEValue ( int  normalisedValue)
private

Member Function Documentation

◆ 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.

◆ 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.

◆ asSignedFloat()

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

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

◆ asUnsignedFloat()

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

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

◆ centreValue()

static MPEValue juce::MPEValue::centreValue ( )
staticnoexcept

Constructs an MPEValue corresponding to the centre value.

◆ from14BitInt()

static MPEValue juce::MPEValue::from14BitInt ( int  value)
staticnoexcept

Constructs an MPEValue from an integer between 0 and 16383 (using 14-bit precision).

◆ from7BitInt()

static MPEValue juce::MPEValue::from7BitInt ( int  value)
staticnoexcept

Constructs an MPEValue from an integer between 0 and 127 (using 7-bit precision).

◆ fromSignedFloat()

static MPEValue juce::MPEValue::fromSignedFloat ( float  value)
staticnoexcept

Constructs an MPEValue from a float between -1.0f and 1.0f.

◆ fromUnsignedFloat()

static MPEValue juce::MPEValue::fromUnsignedFloat ( float  value)
staticnoexcept

Constructs an MPEValue from a float between 0.0f and 1.0f.

◆ maxValue()

static MPEValue juce::MPEValue::maxValue ( )
staticnoexcept

Constructs an MPEValue corresponding to the maximum value.

◆ minValue()

static MPEValue juce::MPEValue::minValue ( )
staticnoexcept

Constructs an MPEValue corresponding to the minimum value.

◆ operator!=()

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

Returns true if two values are not equal.

◆ operator==()

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

Returns true if two values are equal.

Member Data Documentation

◆ normalisedValue

int juce::MPEValue::normalisedValue = 8192
private

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