Ardour
9.0-pre0-582-g084a23a80d
|
#include <transform.h>
Classes | |
struct | Context |
struct | Operation |
struct | Program |
struct | Value |
Public Types | |
typedef Evoral::Sequence< Temporal::Beats >::NotePtr | NotePtr |
typedef Evoral::Sequence< Temporal::Beats >::Notes | Notes |
typedef ARDOUR::MidiModel::NoteDiffCommand::Property | Property |
Public Member Functions | |
Transform (const Program &prog) | |
PBD::Command * | operator() (std::shared_ptr< ARDOUR::MidiModel > model, Temporal::Beats position, std::vector< Notes > &seqs) |
std::string | name () const |
Public Member Functions inherited from ARDOUR::MidiOperator | |
MidiOperator () | |
virtual | ~MidiOperator () |
virtual PBD::Command * | operator() (std::shared_ptr< ARDOUR::MidiModel >, Temporal::Beats, std::vector< Evoral::Sequence< Temporal::Beats >::Notes > &)=0 |
Private Attributes | |
const Program | _prog |
Transform notes with a user-defined transformation.
This is essentially an interpreter for a simple concatenative note transformation language (as an AST only, no source code). A "program" calculates a note property value from operations on literal values, and/or values from the current or previous note in the sequence. This allows simple things like "set all notes' velocity to 64" or transitions over time like "set velocity to the previous note's velocity + 10".
The language is forth-like: everything is on a stack, operations pop their arguments from the stack and push their result back on to it.
This is a sweet spot between simplicity and power, it should be simple to use this (with perhaps some minor extensions) to do most "linear-ish" transformations, though it could be extended to have random access and more special values as the need arises.
Definition at line 50 of file transform.h.
Definition at line 52 of file transform.h.
Definition at line 53 of file transform.h.
Definition at line 54 of file transform.h.
ARDOUR::Transform::Transform | ( | const Program & | prog | ) |
|
inlinevirtual |
Implements ARDOUR::MidiOperator.
Definition at line 137 of file transform.h.
PBD::Command* ARDOUR::Transform::operator() | ( | std::shared_ptr< ARDOUR::MidiModel > | model, |
Temporal::Beats | position, | ||
std::vector< Notes > & | seqs | ||
) |
|
private |
Definition at line 140 of file transform.h.