11namespace tracktion {
inline namespace engine
19 jassert (noteState.hasType (IDs::NOTE));
20 return noteState.getNumChildren() > 0;
26 jassert (noteState.hasType (IDs::NOTE));
28 return noteState.getChildWithName (type).isValid();
36 return type == IDs::PITCHBEND || type == IDs::PRESSURE || type == IDs::TIMBRE;
43 jassert (isExpression (expressionType));
47 exp.setBeatPosition (beat, um);
48 exp.setValue (value, um);
49 noteState.
addChild (expression, -1,
nullptr);
61 jassert (! v[IDs::b].isString());
62 jassert (! v[IDs::v].isString());
63 jassert (isExpression (v.getType()));
78 float getValue() const noexcept {
return state[IDs::v]; }
bool hasType(const Identifier &typeName) const noexcept
ValueTree & setProperty(const Identifier &name, const var &newValue, UndoManager *undoManager)
void addChild(const ValueTree &child, int index, UndoManager *undoManager)
bool isPositiveAndNotGreaterThan(Type1 valueToTest, Type2 upperLimit) noexcept
Represents a position in beats.
constexpr double inBeats() const
Returns the position as a number of beats.
static bool noteHasExpression(const juce::ValueTree ¬eState) noexcept
Returns true if this MidiNote is an expressive note.
BeatPosition getBeatPosition() const noexcept
Returns the beat position relative to the note's start.
static bool noteHasExpression(const juce::ValueTree ¬eState, const juce::Identifier &type) noexcept
Returns true if this MidiNote is an expressive note of type.
static bool listHasExpression(const MidiList &midiList) noexcept
Returns true if this MidiList is an expressive note.
MidiExpression(const juce::ValueTree &v)
Creates a MidiExpression interface to an existing MIDI note state.
void setBeatPosition(BeatPosition newBeat, juce::UndoManager *um)
Sets the beat position.
void setValue(float newValue, juce::UndoManager *um)
Sets the value with some range validation.
float getValue() const noexcept
Returns the value of the expression.