tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_MidiNode.h
Go to the documentation of this file.
1 /*
2 ,--. ,--. ,--. ,--.
3 ,-' '-.,--.--.,--,--.,---.| |,-.,-' '-.`--' ,---. ,--,--, Copyright 2024
4 '-. .-'| .--' ,-. | .--'| /'-. .-',--.| .-. || \ Tracktion Software
5 | | | | \ '-' \ `--.| \ \ | | | |' '-' '| || | Corporation
6 `---' `--' `--`--'`---'`--'`--' `---' `--' `---' `--''--' www.tracktion.com
7
8 Tracktion Engine uses a GPL/commercial licence - see LICENCE.md for details.
9*/
10
11namespace tracktion { inline namespace engine
12{
13
17class MidiNode final : public tracktion::graph::Node,
19{
20public:
23 juce::Range<int> midiChannelNumbers,
24 bool useMPE,
25 juce::Range<double> editSection,
29 std::function<bool()> shouldBeMutedDelegate = nullptr);
30
33 bool isReadyToProcess() override;
34 void process (ProcessContext&) override;
35
36private:
37 //==============================================================================
39 const MidiList::TimeBase timeBase;
40 int64_t lastStart = 0;
41 size_t currentSequence = 0;
42 juce::Range<int> channelNumbers;
43 bool useMPEChannelMode;
44 juce::Range<double> editRange;
45 LiveClipLevel clipLevel;
46 EditItemID editItemID;
47 std::function<bool()> shouldBeMutedDelegate = nullptr;
48
49 double sampleRate = 44100.0;
50 int currentIndex = 0;
51 MidiMessageArray::MPESourceID midiSourceID = MidiMessageArray::createUniqueMPESourceID();
52 bool wasMute = false, shouldCreateMessagesForTime = false;
53
54 juce::Array<juce::MidiMessage> controllerMessagesScratchBuffer;
55
56 //==============================================================================
57 void processSection (Node::ProcessContext&,
58 juce::Range<double> sectionEditTime,
59 double secondsPerTimeBase,
61};
62
63}} // namespace tracktion { inline namespace engine
TimeBase
Determines MIDI event timing.
A Node that plays MIDI data from a MidiMessageSequence, at a specific MIDI channel.
void prepareToPlay(const tracktion::graph::PlaybackInitialisationInfo &) override
Called once before playback begins for each node.
tracktion::graph::NodeProperties getNodeProperties() override
Should return the properties of the node.
bool isReadyToProcess() override
Should return true when this node is ready to be processed.
void process(ProcessContext &) override
Called when the node is to be processed.
Base class for Nodes that provides information about the current process call.
Main graph Node processor class.
Struct to describe a single iteration of a process call.
typedef int64_t
ID for objects of type EditElement - e.g.
Provides a thread-safe way to share a clip's levels with an audio engine without worrying about the C...
Holds the state of a process call.
Holds some really basic properties of a node.
Passed into Nodes when they are being initialised, to give them useful contextual information that th...