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

« « « Anklang Documentation
Loading...
Searching...
No Matches
Classes | Namespaces | Enumerations | Functions
tracktion_Tempo.h File Reference
#include <cassert>
#include <algorithm>
#include <vector>
#include "tracktion_Time.h"
#include "tracktion_TimeRange.h"
#include "tracktion_Bezier.h"

Go to the source code of this file.

Classes

struct  tracktion::core::tempo::BarsAndBeats
 Represents a number of bars and then beats in that bar. More...
 
struct  tracktion::core::tempo::TimeSignature
 Holds a time signature. More...
 
struct  tracktion::core::tempo::Key
 Represents a musical key. More...
 
struct  tracktion::core::tempo::BeatsPerMinute
 A strong typedef for BPM values. More...
 
struct  tracktion::core::tempo::BeatsPerSecond
 A strong typedef for beats-per-second values. More...
 
struct  tracktion::core::tempo::SecondsPerBeat
 A strong typedef for seconds-per-beat values. More...
 
struct  tracktion::core::tempo::TempoChange
 Represents a change in tempo at a specific beat. More...
 
struct  tracktion::core::tempo::TimeSigChange
 Represents a change in time signature at a specific beat. More...
 
struct  tracktion::core::tempo::KeyChange
 Represents a change in key at a specific beat. More...
 
struct  tracktion::core::tempo::Sequence
 Represents a tempo map with at least one TempoChange and TimeSigChange. More...
 
struct  tracktion::core::tempo::Sequence::Position
 A Sequence::Position is an iterator through a Sequence. More...
 

Namespaces

namespace  tracktion
 

Enumerations

enum class  tracktion::core::tempo::LengthOfOneBeat { dependsOnTimeSignature , isAlwaysACrotchet }
 Used to determine the length of a beat in beat <-> time conversions. More...
 

Functions

constexpr BeatPosition tracktion::operator* (TimePosition t, tempo::BeatsPerSecond bps)
 Converts time to beats.
 
constexpr BeatDuration tracktion::operator* (TimeDuration t, tempo::BeatsPerSecond bps)
 Converts time to beats.
 
constexpr BeatPosition tracktion::operator* (tempo::BeatsPerSecond bps, TimePosition t)
 Converts time to beats.
 
constexpr BeatDuration tracktion::operator* (tempo::BeatsPerSecond bps, TimeDuration t)
 Converts time to beats.
 
constexpr BeatPosition tracktion::operator* (TimePosition t, tempo::BeatsPerMinute bpm)
 Converts time to beats.
 
constexpr BeatDuration tracktion::operator* (TimeDuration t, tempo::BeatsPerMinute bpm)
 Converts time to beats.
 
constexpr BeatPosition tracktion::operator* (tempo::BeatsPerMinute bpm, TimePosition t)
 Converts time to beats.
 
constexpr BeatDuration tracktion::operator* (tempo::BeatsPerMinute bpm, TimeDuration t)
 Converts time to beats.
 
constexpr TimePosition tracktion::operator* (BeatPosition t, tempo::SecondsPerBeat spb)
 Converts beats to time.
 
constexpr TimeDuration tracktion::operator* (BeatDuration t, tempo::SecondsPerBeat spb)
 Converts beats to time.
 
constexpr TimePosition tracktion::operator* (tempo::SecondsPerBeat spb, BeatPosition t)
 Converts beats to time.
 
constexpr TimeDuration tracktion::operator* (tempo::SecondsPerBeat spb, BeatDuration t)
 Converts beats to time.
 
constexpr tempo::BeatsPerSecond tracktion::operator/ (double t, tempo::SecondsPerBeat spb)
 Converts a SecondsPerBeat to BeatsPerSecond.
 
constexpr tempo::SecondsPerBeat tracktion::operator/ (double t, tempo::BeatsPerSecond bps)
 Converts a BeatsPerSecond to SecondsPerBeat.
 
constexpr bool tracktion::operator== (tempo::Key k1, tempo::Key k2)
 Compares two Keys.
 
constexpr bool tracktion::operator!= (tempo::Key k1, tempo::Key k2)
 Compares two Keys.
 
TimeRange tracktion::toTime (const tempo::Sequence &, BeatRange)
 Converts a BeatRange to a TimeRange.
 
BeatRange tracktion::toBeats (const tempo::Sequence &, TimeRange)
 Converts a TimeRange to a BeatRange.
 
TimeRange tracktion::toTime (const tempo::Sequence &seq, BeatRange range)
 Converts a BeatRange to a TimeRange.
 
BeatRange tracktion::toBeats (const tempo::Sequence &seq, TimeRange range)
 Converts a TimeRange to a BeatRange.
 
BeatPosition tracktion::core::tempo::details::toBeats (const std::vector< Sequence::Section > &sections, TimePosition time)
 
TimePosition tracktion::core::tempo::details::toTime (const std::vector< Sequence::Section > &sections, BeatPosition beats)
 
TimePosition tracktion::core::tempo::details::toTime (const std::vector< Sequence::Section > &sections, BarsAndBeats barsBeats)
 
BarsAndBeats tracktion::core::tempo::details::toBarsAndBeats (const std::vector< Sequence::Section > &sections, TimePosition time)
 

Enumeration Type Documentation

◆ LengthOfOneBeat

Used to determine the length of a beat in beat <-> time conversions.

Enumerator
dependsOnTimeSignature 

Signifies that the length (in seconds) of one "beat" at any point in an edit is considered to be the length of one division in the current bar's time signature.

So for example at 120BPM, in a bar of 4/4, one beat would be the length of a quarter-note (0.5s), but in a bar of 4/8, one beat would be the length of an eighth-note (0.25s)

isAlwaysACrotchet 

Signifies the length of one beat always depends only the current BPM at that point in the edit, so where the BPM = 120, one beat is always 0.5s, regardless of the time-sig.

E.g. 7/4 is treated the same as 7/8/

Definition at line 100 of file tracktion_Tempo.h.

Function Documentation

◆ toBarsAndBeats()

BarsAndBeats tracktion::core::tempo::details::toBarsAndBeats ( const std::vector< Sequence::Section > &  sections,
TimePosition  time 
)

Definition at line 420 of file tracktion_Tempo.h.

◆ toBeats()

BeatPosition tracktion::core::tempo::details::toBeats ( const std::vector< Sequence::Section > &  sections,
TimePosition  time 
)

Definition at line 375 of file tracktion_Tempo.h.

◆ toTime() [1/2]

TimePosition tracktion::core::tempo::details::toTime ( const std::vector< Sequence::Section > &  sections,
BarsAndBeats  barsBeats 
)

Definition at line 403 of file tracktion_Tempo.h.

◆ toTime() [2/2]

TimePosition tracktion::core::tempo::details::toTime ( const std::vector< Sequence::Section > &  sections,
BeatPosition  beats 
)

Definition at line 389 of file tracktion_Tempo.h.