sequencer
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
sequencer::midi Namespace Reference

Namespaces

 byte
 
 channel
 
 manufacturer
 
 realtime
 
 system
 
 trig_condition
 

Classes

class  clock
 
class  clock_base
 
class  clock_to_step_t
 
struct  device_entry_t
 
struct  greater_than
 
class  pattern_t
 
struct  section_t
 
class  step_t
 
class  track_impl_t
 
struct  track_parameter_t
 
class  track_t
 

Typedefs

template<std::size_t number_of_bytes>
using message_t = std::conditional_t< greater_than< number_of_bytes, 0 >::value, std::array< std::byte, number_of_bytes >, std::vector< std::byte > >
 
using trig_condition_t = callable_t< bool >
 

Enumerations

enum  lfo_mode {
  lfo_mode::triangular = 0, lfo_mode::sine, lfo_mode::square, lfo_mode::saw,
  lfo_mode::exp, lfo_mode::ramp, lfo_mode::random
}
 
enum  note_t : std::uint8_t { note_t::no_note = std::numeric_limits< std::uint8_t >::max() }
 
enum  percussion_key : std::uint8_t { percussion_key::PERCUSSION_KEYS }
 

Functions

auto make_clock ()
 
template<class MidiClock , class Sender >
auto start_clock_in_thread (MidiClock &midi_clock, const Sender &sender)
 
std::ostream & operator<< (std::ostream &os, const device_entry_t &entry)
 
std::ostream & operator<< (std::ostream &os, const section_t &section)
 
std::regex get_key_int_regex (const std::string &key)
 
void read_entry (device_entry_t &entry, const std::string &buffer)
 
std::vector< section_tread_file (std::istream &file)
 
template<class T >
lfo_impl (double pos, double period_length, double speed, double phase, T min, T max, lfo_mode mode)
 
template<class T >
lfo (std::size_t pulse_count, std::size_t pulses_per_quarter_note, int speed, int phase, T min, T max, lfo_mode mode)
 
constexpr std::byte status_byte_for (std::byte status_byte, std::uint8_t channel) noexcept
 
constexpr bool check_status_byte (std::byte status_byte, std::byte message_byte)
 
constexpr std::array< std::uint8_t, 3 > read_channel_with_two_7bit_values (const message_t< 3 > &message) noexcept
 
constexpr std::pair< std::byte, std::byte > uint16_to_lsb_msb (std::uint16_t value) noexcept
 
constexpr std::uint16_t lsb_msb_to_uint16 (const std::pair< std::byte, std::byte > &two_bytes) noexcept
 
constexpr note_t no_note () noexcept
 
constexpr std::uint8_t to_uint8_t (note_t note) noexcept
 
constexpr note_t operator+ (note_t note, std::int16_t offset)
 
constexpr std::int16_t get_note_distance (note_t lhs, note_t rhs) noexcept
 
template<class Track >
pattern_t< Track > make_pattern (std::size_t number_of_tracks, std::size_t number_of_steps, std::size_t pulses_per_quarter_note=default_pulses_per_quarter_note) noexcept
 
std::string_view to_string (percussion_key key)
 
std::ostream & operator<< (std::ostream &os, const step_t &step)
 
bool operator== (const step_t &lhs, const step_t &rhs) noexcept
 
bool operator!= (const step_t &lhs, const step_t &rhs) noexcept
 
template<class Track >
void copy_track (const Track &from, Track &to) noexcept(std::is_nothrow_copy_assignable< Track >::value)
 
template<class Tracks , class Sender >
void send_all_notes_off_message (Tracks &tracks, const Sender &sender)
 

Variables

constexpr auto number_of_values_per_byte = 128
 
constexpr auto max_number_of_midi_channels = 16
 
constexpr auto default_pulses_per_quarter_note = 24u
 
const auto key_sep = std::string( ":" )
 
const auto string_identifier_regex_str = std::string{"([a-zA-Z]+[\\sa-zA-Z0-9_]*)"}
 

Typedef Documentation

◆ message_t

template<std::size_t number_of_bytes>
using sequencer::midi::message_t = typedef std::conditional_t< greater_than< number_of_bytes, 0 >::value, std::array< std::byte, number_of_bytes >, std::vector< std::byte > >

◆ trig_condition_t

Enumeration Type Documentation

◆ lfo_mode

Enumerator
triangular 
sine 
square 
saw 
exp 
ramp 
random 

◆ note_t

enum sequencer::midi::note_t : std::uint8_t
strong
Enumerator
no_note 

◆ percussion_key

enum sequencer::midi::percussion_key : std::uint8_t
strong
Enumerator
PERCUSSION_KEYS 

Function Documentation

◆ check_status_byte()

constexpr bool sequencer::midi::check_status_byte ( std::byte  status_byte,
std::byte  message_byte 
)

◆ copy_track()

template<class Track >
void sequencer::midi::copy_track ( const Track &  from,
Track &  to 
)
noexcept

◆ get_key_int_regex()

std::regex sequencer::midi::get_key_int_regex ( const std::string &  key)
inline

◆ get_note_distance()

constexpr std::int16_t sequencer::midi::get_note_distance ( note_t  lhs,
note_t  rhs 
)
noexcept

◆ lfo()

template<class T >
T sequencer::midi::lfo ( std::size_t  pulse_count,
std::size_t  pulses_per_quarter_note,
int  speed,
int  phase,
min,
max,
lfo_mode  mode 
)

◆ lfo_impl()

template<class T >
T sequencer::midi::lfo_impl ( double  pos,
double  period_length,
double  speed,
double  phase,
min,
max,
lfo_mode  mode 
)

◆ lsb_msb_to_uint16()

constexpr std::uint16_t sequencer::midi::lsb_msb_to_uint16 ( const std::pair< std::byte, std::byte > &  two_bytes)
noexcept

◆ make_clock()

auto sequencer::midi::make_clock ( )
inline

◆ make_pattern()

template<class Track >
pattern_t< Track > sequencer::midi::make_pattern ( std::size_t  number_of_tracks,
std::size_t  number_of_steps,
std::size_t  pulses_per_quarter_note = default_pulses_per_quarter_note 
)
noexcept

◆ no_note()

constexpr note_t sequencer::midi::no_note ( )
noexcept

◆ operator!=()

bool sequencer::midi::operator!= ( const step_t lhs,
const step_t rhs 
)
inlinenoexcept

◆ operator+()

constexpr note_t sequencer::midi::operator+ ( note_t  note,
std::int16_t  offset 
)

◆ operator<<() [1/3]

std::ostream& sequencer::midi::operator<< ( std::ostream &  os,
const device_entry_t entry 
)
inline

◆ operator<<() [2/3]

std::ostream& sequencer::midi::operator<< ( std::ostream &  os,
const section_t section 
)
inline

◆ operator<<() [3/3]

std::ostream& sequencer::midi::operator<< ( std::ostream &  os,
const step_t step 
)
inline

◆ operator==()

bool sequencer::midi::operator== ( const step_t lhs,
const step_t rhs 
)
inlinenoexcept

◆ read_channel_with_two_7bit_values()

constexpr std::array< std::uint8_t, 3 > sequencer::midi::read_channel_with_two_7bit_values ( const message_t< 3 > &  message)
noexcept

◆ read_entry()

void sequencer::midi::read_entry ( device_entry_t entry,
const std::string &  buffer 
)
inline

◆ read_file()

std::vector< section_t > sequencer::midi::read_file ( std::istream &  file)
inline

◆ send_all_notes_off_message()

template<class Tracks , class Sender >
void sequencer::midi::send_all_notes_off_message ( Tracks &  tracks,
const Sender &  sender 
)

◆ start_clock_in_thread()

template<class MidiClock , class Sender >
auto sequencer::midi::start_clock_in_thread ( MidiClock &  midi_clock,
const Sender &  sender 
)

◆ status_byte_for()

constexpr std::byte sequencer::midi::status_byte_for ( std::byte  status_byte,
std::uint8_t  channel 
)
noexcept

◆ to_string()

std::string_view sequencer::midi::to_string ( percussion_key  key)

◆ to_uint8_t()

constexpr std::uint8_t sequencer::midi::to_uint8_t ( note_t  note)
noexcept

◆ uint16_to_lsb_msb()

constexpr std::pair< std::byte, std::byte > sequencer::midi::uint16_to_lsb_msb ( std::uint16_t  value)
noexcept

Variable Documentation

◆ default_pulses_per_quarter_note

constexpr auto sequencer::midi::default_pulses_per_quarter_note = 24u

◆ key_sep

const auto sequencer::midi::key_sep = std::string( ":" )

◆ max_number_of_midi_channels

constexpr auto sequencer::midi::max_number_of_midi_channels = 16

◆ number_of_values_per_byte

constexpr auto sequencer::midi::number_of_values_per_byte = 128

◆ string_identifier_regex_str

const auto sequencer::midi::string_identifier_regex_str = std::string{"([a-zA-Z]+[\\sa-zA-Z0-9_]*)"}