11namespace tracktion {
inline namespace engine
34 bool operator== (
const Channel&)
const noexcept;
41 bool usesGrooveStrength()
const;
57 void removeChannel (
int index);
58 void insertNewChannel (
int index);
60 bool usesProbability();
73 bool getNote (
int channel,
int index)
const noexcept;
74 void setNote (
int channel,
int index,
bool value);
77 void clearChannel (
int channel);
78 void insertChannel (
int channel);
79 void removeChannel (
int channel);
80 void randomiseChannel (
int channel);
81 void randomiseSteps();
82 void shiftChannel (
int channel,
bool toTheRight);
83 void toggleAtInterval (
int channel,
int interval);
88 int getNumNotes()
const;
89 void setNumNotes (
int);
100 int getVelocity (
int channel,
int index)
const;
101 void setVelocity (
int channel,
int index,
int value);
106 double getGate (
int channel,
int index)
const;
107 void setGate (
int channel,
int index,
double value);
112 float getProbability (
int channel,
int index)
const;
113 void setProbability (
int channel,
int index,
float value);
122 bool getNote (
int index)
const noexcept;
123 int getVelocity (
int index)
const noexcept;
124 double getGate (
int index)
const noexcept;
125 float getProbability (
int index)
const noexcept;
149 : clip (c), patternIndex (index) {}
153 notifyListenersOfDeletion();
162 int getSequenceIndex()
const;
174 defaultNumNotes = 16,
175 defaultNumChannels = 8,
176 defaultMidiChannel = 1,
177 defaultNoteNumber = 60,
178 defaultNoteValue = 96,
190 PatternArray getPatternSequence()
const;
191 void setPatternSequence (
const PatternArray&);
193 void insertVariation (
int patternIndex,
int insertIndex);
194 void removeVariation (
int variationIndex);
195 void removeAllVariations();
196 void createDefaultPatternIfEmpty();
197 void setPatternForVariation (
int variationIndex,
int newPatternIndex);
200 int insertPattern (
const Pattern&,
int index);
201 int insertNewPattern (
int index);
202 void removePattern (
int patternIndex);
203 void removeUnusedPatterns();
206 bool getCell (
int patternIndex,
int channelIndex,
int noteIndex);
207 void setCell (
int patternIndex,
int channelIndex,
int noteIndex,
bool value);
210 Pattern getPattern (
int index);
211 int getNumPatterns()
const;
215 float getVolumeDb()
const {
return level->dbGain.get(); }
216 void setVolumeDb (
float v) { level->dbGain =
juce::jlimit (-100.0f, 0.0f, v); }
227 bool convertToSeconds =
true,
228 PatternInstance* instance =
nullptr);
241 BeatPosition getStartBeatOf (PatternInstance*);
242 BeatPosition getEndBeatOf (PatternInstance*);
244 int getBeatsPerBar();
246 void resizeClipForPatternInstances();
253 bool isMidi()
const override {
return false; }
255 bool isMuted()
const override {
return level->mute.get(); }
256 void setMuted (
bool m)
override { level->mute = m; }
308 PatternArray patternInstanceList;
317 const PatternInstance::Ptr getPatternInstance (
int index,
bool repeatSequence)
const;
318 void updatePatternList();
ReferenceCountedObject & operator=(const ReferenceCountedObject &) noexcept
Base class for items that can contain clips.
virtual juce::String getName() const override
Returns the name of the clip.
juce::ValueTree state
The ValueTree of the Clip state.
void setName(const juce::String &newName)
Sets a new name for a clip.
Represents a launch quantisation.
TimeBase
Determines MIDI event timing.
Base class for things that can be selected, and whose properties can appear in the properties panel.
juce::String getSelectableDescription() override
Subclasses must return a description of what they are.
bool canBeAddedTo(ClipOwner &) override
Tests whether this clip can go on the given parent.
std::shared_ptr< LaunchHandle > getLaunchHandle() override
Some clip types can be launched, if that's possible, this returns a handle to trigger starting/stoppi...
bool isMidi() const override
Returns true if this is a MidiClip.
void setUsesGlobalLaunchQuatisation(bool useGlobal) override
Some clip types can be launched, if that's possible, this sets whether the clip's quantisation or the...
void setLoopRange(TimeRange) override
Sets the loop range the clip should use in seconds.
void generateMidiSequence(juce::MidiMessageSequence &result, bool convertToSeconds=true, PatternInstance *instance=nullptr)
Generate a MidiMessageSequence from either the entire clip or one of its pattern instances.
BeatPosition getLoopStartBeats() const override
Returns the beat position of the loop start point.
void setMuted(bool m) override
Mutes or unmutes the clip.
LaunchQuantisation * getLaunchQuantisation() override
Some clip types can be launched, if that's possible, this returns a quantisation that can be used for...
bool isMuted() const override
Returns true if the clip is muted.
BeatDuration getLoopLengthBeats() const override
Returns the length of loop in beats.
void cloneFrom(Clip *) override
Clones the given clip to this clip.
bool isLooping() const override
Returns true if this clip is currently looping.
void disableLooping() override
Disables all looping.
TimePosition getLoopStart() const override
Returns the start time of the loop start point.
void setNumberOfLoops(int) override
Sets the clip looping a number of times.
juce::Colour getDefaultColour() const override
Returns the default colour for this clip.
bool beatBasedLooping() const override
Returns true if this clip's looping is based on beats or false if absolute time.
bool canLoop() const override
StepClips can only loop if they're being used as launcher clips.
void setLoopRangeBeats(BeatRange) override
Sets the loop range the clip should use in beats.
TimeDuration getLoopLength() const override
Returns the length of loop in seconds.
FollowActions * getFollowActions() override
Some clip types can be launched, if that's possible, this can be used to determine the action to perf...
bool usesGlobalLaunchQuatisation() override
Some clip types can be launched, if that's possible, this returns whether the clip's quantisation or ...
ClipPosition getPosition() const override
Returns the ClipPosition on the parent Track.
Holds a list of TempoSetting objects, to form a sequence of tempo changes.
#define JUCE_LEAK_DETECTOR(OwnerClass)
Type jlimit(Type lowerLimit, Type upperLimit, Type valueToConstrain) noexcept
Represents a duration in beats.
Represents a position in beats.
Represents a duration in real-life time.
Represents a position in real-life time.
Represents the position of a clip on a timeline.
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...
juce::String getSelectableDescription() override
Subclasses must return a description of what they are.
juce::String getSelectableDescription() override
Subclasses must return a description of what they are.
Creates a snapshot of a pattern's notes, velocities and gates to avoid costly property parsing.