OpenShot Audio Library | OpenShotAudio: juce_MPENote.h Source File

OpenShot Audio Library | OpenShotAudio 1.0.0

Loading...
Searching...
No Matches
juce_MPENote.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//==============================================================================
39 struct JUCE_API MPENote
40{
41 //==============================================================================
43 enum KeyState
44 {
45 off = 0,
46 keyDown = 1,
47 sustained = 2,
48 keyDownAndSustained = 3
49 };
50
51 //==============================================================================
72 MPENote (int midiChannel,
73 int initialNote,
74 MPEValue velocity,
75 MPEValue pitchbend,
76 MPEValue pressure,
77 MPEValue timbre,
78 KeyState keyState = MPENote::keyDown) noexcept;
79
86 MPENote() noexcept;
87
89 bool isValid() const noexcept;
90
91 //==============================================================================
92 // Invariants that define the note.
93
98 uint16 noteID = 0;
99
103 uint8 midiChannel = 0;
104
108 uint8 initialNote = 0;
109
110 //==============================================================================
111 // The five dimensions of continuous expressive control
112
116 MPEValue noteOnVelocity { MPEValue::minValue() };
117
128 MPEValue pitchbend { MPEValue::centreValue() };
129
133 MPEValue pressure { MPEValue::centreValue() };
134
138 MPEValue initialTimbre { MPEValue::centreValue() };
139
144 MPEValue timbre { MPEValue::centreValue() };
145
152 MPEValue noteOffVelocity { MPEValue::minValue() };
153
154 //==============================================================================
164 double totalPitchbendInSemitones;
165
169 KeyState keyState { MPENote::off };
170
171 //==============================================================================
175 double getFrequencyInHertz (double frequencyOfA = 440.0) const noexcept;
176
178 bool operator== (const MPENote& other) const noexcept;
179
181 bool operator!= (const MPENote& other) const noexcept;
182};
183
184} // namespace juce
juce::MPEValue
Definition juce_MPEValue.h:37
juce::MPEValue::centreValue
static MPEValue centreValue() noexcept
Definition juce_MPEValue.cpp:60
juce::MPEValue::minValue
static MPEValue minValue() noexcept
Definition juce_MPEValue.cpp:59
juce::MPENote
Definition juce_MPENote.h:40
juce::MPENote::KeyState
KeyState
Definition juce_MPENote.h:44
juce::MPENote::keyDown
@ keyDown
Definition juce_MPENote.h:46
juce::MPENote::off
@ off
Definition juce_MPENote.h:45
juce::MPENote::keyDownAndSustained
@ keyDownAndSustained
Definition juce_MPENote.h:48
juce::MPENote::sustained
@ sustained
Definition juce_MPENote.h:47
juce::MPENote::noteID
uint16 noteID
Definition juce_MPENote.h:98
juce::MPENote::noteOnVelocity
MPEValue noteOnVelocity
Definition juce_MPENote.h:116
juce::MPENote::timbre
MPEValue timbre
Definition juce_MPENote.h:144
juce::MPENote::pitchbend
MPEValue pitchbend
Definition juce_MPENote.h:128
juce::MPENote::initialNote
uint8 initialNote
Definition juce_MPENote.h:108
juce::MPENote::pressure
MPEValue pressure
Definition juce_MPENote.h:133
juce::MPENote::initialTimbre
MPEValue initialTimbre
Definition juce_MPENote.h:138
juce::MPENote::totalPitchbendInSemitones
double totalPitchbendInSemitones
Definition juce_MPENote.h:164
juce::MPENote::midiChannel
uint8 midiChannel
Definition juce_MPENote.h:103
juce::MPENote::noteOffVelocity
MPEValue noteOffVelocity
Definition juce_MPENote.h:152
juce::MPENote::keyState
KeyState keyState
Definition juce_MPENote.h:169
juce::MPENote::MPENote
MPENote(int midiChannel, int initialNote, MPEValue velocity, MPEValue pitchbend, MPEValue pressure, MPEValue timbre, KeyState keyState=MPENote::keyDown) noexcept
Definition juce_MPENote.cpp:38