XJ music engine
1.9.6
In-game runtime engine for XJ music.
|
#include <Fabricator.h>
Public Types | |
enum class | ControlMode { Auto , Macro , Taxonomy } |
Public Member Functions | |
virtual | ~Fabricator ()=default |
Fabricator (ContentEntityStore *contentEntityStore, SegmentEntityStore *segmentEntityStore, const SegmentRetrospective *segmentRetrospective, int segmentId, std::optional< Segment::Type > overrideSegmentType) | |
virtual void | addMessage (SegmentMessage::Type messageType, std::string body) |
virtual void | addErrorMessage (std::string body) |
virtual void | addWarningMessage (std::string body) |
virtual void | addInfoMessage (std::string body) |
virtual void | deletePick (const UUID &id) |
virtual std::set< const SegmentChoiceArrangement * > | getArrangements () |
virtual std::set< const SegmentChoiceArrangement * > | getArrangements (std::set< const SegmentChoice * > &choices) |
virtual Chain * | getChain () |
virtual TemplateConfig | getTemplateConfig () |
virtual std::set< const SegmentChoice * > | getChoices () const |
virtual std::optional< const SegmentChoice * > | getChoiceIfContinued (const ProgramVoice *voice) |
virtual std::set< const SegmentChoice * > | getChoicesIfContinued (const Program::Type programType) |
virtual std::optional< const SegmentChoice * > | getChoiceIfContinued (Instrument::Type instrumentType) |
virtual std::optional< const SegmentChoice * > | getChoiceIfContinued (Instrument::Type instrumentType, Instrument::Mode instrumentMode) |
virtual std::optional< const SegmentChord * > | getChordAt (float position) |
virtual std::optional< const SegmentChoice * > | getCurrentMainChoice () |
virtual std::optional< const ProgramSequence * > | getCurrentMainSequence () |
virtual std::set< const SegmentChoice * > | getCurrentDetailChoices () |
virtual std::optional< const SegmentChoice * > | getCurrentBeatChoice () |
virtual std::set< Instrument::Type > | getDistinctChordVoicingTypes () |
virtual long | getElapsedMicros () |
virtual Chord | getKeyForChoice (const SegmentChoice *choice) |
virtual std::optional< const SegmentChoice * > | getMacroChoiceOfPreviousSegment () |
virtual std::optional< const SegmentChoice * > | getPreviousMainChoice () |
virtual ProgramConfig | getCurrentMainProgramConfig () |
virtual std::optional< const ProgramSequence * > | getPreviousMainSequence () |
virtual MemeIsometry | getMemeIsometryOfNextSequenceInPreviousMacro () |
virtual MemeIsometry | getMemeIsometryOfSegment () |
virtual int | getNextSequenceBindingOffset (const SegmentChoice *choice) |
virtual std::set< const SegmentChoiceArrangementPick * > | getPicks () |
virtual std::vector< const SegmentChoiceArrangementPick * > | getPicks (const SegmentChoice *choice) |
virtual std::optional< const InstrumentAudio * > | getPreferredAudio (const std::string &parentIdent, const std::string &ident) |
virtual std::optional< const Program * > | getProgram (const SegmentChoice *choice) |
virtual std::vector< const ProgramSequenceChord * > | getProgramSequenceChords (const ProgramSequence *programSequence) |
virtual NoteRange | getProgramRange (const UUID &programId, Instrument::Type instrumentType) |
virtual int | getProgramRangeShiftOctaves (Instrument::Type instrumentType, NoteRange *sourceRange, NoteRange *targetRange) |
virtual std::optional< const ProgramSequence * > | getProgramSequence (const SegmentChoice *choice) |
virtual int | getProgramTargetShift (Instrument::Type instrumentType, const Chord *fromChord, const Chord *toChord) |
virtual Program::Type | getProgramType (const ProgramVoice *voice) |
virtual Instrument::Type | getProgramVoiceType (const ProgramSequenceChordVoicing *voicing) |
virtual NoteRange | getProgramVoicingNoteRange (Instrument::Type instrumentType) |
virtual std::optional< const ProgramSequence * > | getRandomlySelectedSequence (const Program *program) |
virtual std::optional< const ProgramSequencePattern * > | getRandomlySelectedPatternOfSequenceByVoiceAndType (const SegmentChoice *choice) |
virtual std::optional< const ProgramSequenceBinding * > | getRandomlySelectedSequenceBindingAtOffset (const Program *program, int offset) |
virtual std::optional< Note > | getRootNoteMidRange (const std::string &voicingNotes, const Chord *chord) |
virtual long | getSegmentMicrosAtPosition (float tempo, float position) |
virtual long | getTotalSegmentMicros () |
virtual const Segment * | getSegment () |
virtual std::vector< const SegmentChord * > | getSegmentChords () |
virtual std::set< const SegmentChordVoicing * > | getChordVoicings () |
virtual std::set< const SegmentMeme * > | getSegmentMemes () |
virtual std::optional< const ProgramSequence * > | getSequence (const SegmentChoice *choice) |
virtual int | getSequenceBindingOffsetForChoice (const SegmentChoice *choice) |
virtual void | putStickyBun (StickyBun bun) |
virtual std::optional< const StickyBun > | getStickyBun (const UUID &eventId) |
virtual std::string | getTrackName (const ProgramSequencePatternEvent *event) |
virtual Segment::Type | getType () |
virtual std::optional< const SegmentChordVoicing * > | chooseVoicing (const SegmentChord *chord, Instrument::Type instrumentType) |
virtual bool | hasMoreSequenceBindingOffsets (const SegmentChoice *choice, int N) |
virtual bool | hasOneMoreSequenceBindingOffset (const SegmentChoice *choice) |
virtual bool | hasTwoMoreSequenceBindingOffsets (const SegmentChoice *choice) |
virtual bool | isContinuationOfMacroProgram () |
virtual bool | isDirectlyBound (const Instrument *instrument) |
virtual bool | isDirectlyBound (const InstrumentAudio *instrumentAudio) |
virtual bool | isDirectlyBound (const Program *program) |
virtual bool | isOneShot (const Instrument *instrument, const std::string &trackName) |
virtual bool | isOneShot (const Instrument *instrument) |
virtual bool | isOneShotCutoffEnabled (const Instrument *instrument) |
virtual bool | isInitialSegment () |
virtual std::optional< const SegmentChoice * > | put (const SegmentChoice &entity, const bool force) |
virtual const SegmentChoiceArrangement * | put (const SegmentChoiceArrangement &entity) |
virtual const SegmentChoiceArrangementPick * | put (const SegmentChoiceArrangementPick &entity) |
virtual const SegmentChord * | put (const SegmentChord &entity) |
virtual const SegmentChordVoicing * | put (const SegmentChordVoicing &entity) |
virtual std::optional< const SegmentMeme * > | put (const SegmentMeme &entity, bool force) |
virtual const SegmentMessage * | put (const SegmentMessage &entity) |
virtual const SegmentMeta * | put (const SegmentMeta &entity) |
virtual void | putPreferredAudio (const std::string &parentIdent, const std::string &ident, const InstrumentAudio *instrumentAudio) |
virtual const Segment * | updateSegment (Segment segment) |
virtual const SegmentRetrospective * | getRetrospective () |
virtual ContentEntityStore * | getSourceMaterial () |
virtual double | getMicrosPerBeat (float tempo) |
virtual int | getSecondMacroSequenceBindingOffset (const Program *macroProgram) |
virtual double | getTempo () |
virtual MemeTaxonomy | getMemeTaxonomy () const |
Static Public Member Functions | |
static std::vector< std::string > | getNotes (const SegmentChordVoicing *voicing) |
static int | getSegmentId (const SegmentChoice *segmentChoice) |
static int | getSegmentId (const SegmentChoiceArrangement *segmentChoiceArrangement) |
static int | getSegmentId (const SegmentChoiceArrangementPick *segmentChoiceArrangementPick) |
static int | getSegmentId (const SegmentChord *segmentChord) |
static int | getSegmentId (const SegmentChordVoicing *segmentChordVoicing) |
static int | getSegmentId (const SegmentMeme *segmentMeme) |
static int | getSegmentId (const SegmentMessage *segmentMessage) |
static int | getSegmentId (const SegmentMeta *segmentMeta) |
static std::string | toString (ControlMode controlMode) |
static ControlMode | parseControlMode (const char *str) |
|
strong |
|
virtualdefault |
|
explicit |
Construct new fabricator with the given segment retrospective
segmentEntityStore | to use for segment entities |
segmentRetrospective | to use for segment retrospective |
contentEntityStore | contentEntityStore from which to fabricate |
segmentId | current segment to fabricate |
overrideSegmentType | override segment type |
|
virtual |
Add an error message to the segment, with the given body
body | to include in message |
|
virtual |
Add an info message to the segment, with the given body
body | to include in message |
|
virtual |
Add a message of the given type to the segment, with the given body
messageType | of message to add |
body | to include in message |
|
virtual |
Add a warning message to the segment, with the given body
body | to include in message |
|
virtual |
Get segment chord voicing for a given chord
chord | to get voicing for |
instrumentType | for which to get voicing |
|
virtual |
Delete a pick from the current segment specified by Segment id and id
id | to delete |
|
virtual |
Get arrangements for segment
|
virtual |
Get segment arrangements for a given choice
choices | to get segment arrangements for |
|
virtual |
Determine if a choice has been previously crafted in one of the previous segments of the current main sequence
Beat and Detail choices are kept for an entire Main Program https://github.com/xjmusic/xjmusic/issues/265
|
virtual |
Determine if a choice has been previously crafted in one of the previous segments of the current main sequence
|
virtual |
Determine if a choice has been previously crafted in one of the previous segments of the current main sequence
|
virtual |
Get choices for segment
|
virtual |
Determine if a choice has been previously crafted in one of the previous segments of the current main sequence
|
virtual |
Get current ChordEntity for any position in Segment. Defaults to returning a chord based on the segment key, if nothing else is found
position | in segment |
|
virtual |
Get all segment chord voicings
|
virtual |
Get the beat-type choice for the current segment in the chain
|
virtual |
Get the detail-type choice for the current segment in the chain
|
virtual |
Get the main-type choice for the current segment in the chain
|
virtual |
Get the configuration of the current main program
|
virtual |
Get the sequence targeted by the current main choice
|
virtual |
Get a list of unique voicing (instrument) types present in the voicings of the current main program's chords.
|
virtual |
|
virtual |
Get the Key for any given Choice, preferring its Sequence Key (bound), defaulting to the Program Key.
If Sequence has no key/tempo/intensity inherit from Program https://github.com/xjmusic/xjmusic/issues/246
choice | to get key for |
|
virtual |
Get the macro-type choice for the previous segment in the chain
|
virtual |
Get meme isometry for the next offset in the previous segment's macro-choice
|
virtual |
Get meme isometry for the current segment
|
virtual |
|
virtual |
Get the number of micros per beat for the current segment
|
virtual |
Given a Choice having a SequenceBinding, determine the next available SequenceBinding offset of the chosen sequence, or loop back to zero (if past the end of the available SequenceBinding offsets)
choice | having a SequenceBinding |
|
static |
Get the Notes from a Voicing
voicing | to get notes of |
|
virtual |
Get arrangement picks for segment
|
virtual |
Get the picks for a given choice, in order of position ascending from beginning of segment
choice | for which to get picks |
|
virtual |
Get preferred (previously chosen) instrument audios
|
virtual |
Get the main-type choice for the previous segment in the chain
|
virtual |
Get the sequence targeted by the previous main choice
|
virtual |
|
virtual |
Get the note range for an arrangement based on all the events in its program
programId | to get range of |
instrumentType | to get range of |
|
virtual |
Detail craft shifts source program events into the target range https://github.com/xjmusic/xjmusic/issues/221
via average of delta from source low to target low, and from source high to target high, rounded to octave
instrumentType | of instrument |
sourceRange | to compute from |
targetRange | to compute required # of octaves to shift into |
|
virtual |
Get the sequence for a given choice
choice | for which to get sequence |
|
virtual |
Get the complete set of program sequence chords, ignoring ghost chords* REF by choosing the voicings with largest # of notes at that position https://github.com/xjmusic/xjmusic/issues/248 (caches results)
programSequence | for which to get complete do-ghosted set of chords |
|
virtual |
Compute the target shift from a key toward a chord
instrumentType | to switch behavior |
fromChord | to compute shift from |
toChord | to compute shift toward |
|
virtual |
Get the program type of given voice
voice | for which to get program type |
|
virtual |
Get the voice type for the given voicing
Programs persist main chord/voicing structure sensibly https://github.com/xjmusic/xjmusic/issues/266
voicing | for which to get voice type |
|
virtual |
Get the lowest note present in any voicing of all the segment chord voicings for this segment and instrument instrumentType
instrumentType | to get voicing threshold low of |
|
virtual |
Selects one (at random) of all available patterns of a given type within a sequence. https://github.com/xjmusic/xjmusic/issues/204
Caches the selection, so it will always return the same output for any given input.
Beat fabrication composited of layered Patterns https://github.com/xjmusic/xjmusic/issues/267
|
virtual |
Randomly select any sequence
|
virtual |
Randomly select any sequence binding at the given offset
program | from which to get sequence binding |
offset | to get sequence binding at |
|
virtual |
Get the Segment Retrospective
|
virtual |
Get the root note from an available set of voicings and a given chord
voicingNotes | available voicing notes |
chord | for which to seek root note among available voicings |
|
virtual |
Get the second macro sequence binding offset of a given macro program
macroProgram | for which to get second macro sequence binding offset |
|
virtual |
Get all segment chords, guaranteed to be in order of position ascending
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
virtual |
Get all segment memes
|
virtual |
Compute using an integral the seconds of start for any given position in beats Velocity of Segment meter (beats per minute) increases linearly of the beginning of the Segment (at the previous Segment's tempo) to the end of the Segment (arriving at the current Segment's tempo, only at its end)
Segment should never be fabricated longer than its loop beats. https://github.com/xjmusic/xjmusic/issues/268 Segment wherein tempo changes expect perfectly smooth sound of previous segment through to following segment https://github.com/xjmusic/xjmusic/issues/269
tempo | in beats per minute |
position | in beats |
|
virtual |
Get the sequence for a Choice either directly (beat- and detail-type sequences), or by sequence-pattern (macro- or main-type sequences) https://github.com/xjmusic/xjmusic/issues/204
Beat and Detail programs are allowed to have only one (default) sequence.
choice | to get sequence for |
|
virtual |
Get the sequence pattern offset of a given Choice
choice | having a SequenceBinding |
|
virtual |
Get the ingested source material for fabrication
Segment has metadata for XJ to persist "notes in the margin" of the composition for itself to read https://github.com/xjmusic/xjmusic/issues/222
0
value --— atonal note has a random integer value generated ranging from -50 to 50Sticky buns v2 persisted for each randomly selected note in the series for any given pattern https://github.com/xjmusic/xjmusic/issues/231
TemplateConfig parameter stickyBunEnabled https://github.com/xjmusic/xjmusic/issues/251
eventId | for super-key |
|
virtual |
Chain configuration, by type If no chain config is found for this type, a default config is returned.
|
virtual |
|
virtual |
|
virtual |
Get the track name for a give program sequence pattern event
event | for which to get track name |
|
virtual |
Determine type of content, e.g. initial segment in chain, or next macro-sequence
|
virtual |
Does the program of the specified Choice have at least N more sequence binding offsets available?
choice | of which to check the program for next available sequence binding offsets |
N | more sequence offsets to check for |
|
virtual |
Whether the current Segment Choice has one or more sequence pattern offsets with a higher pattern offset than the current one
choice | for which to check |
|
virtual |
Whether the current Segment Choice has two or more sequence pattern offsets with a higher pattern offset than the current two
choice | for which to check |
|
virtual |
Whether this type of segment continues the same macro-program from the previous segment
|
virtual |
Whether a given Instrument is directly bound to the Chain, where "directly" means a level more specific than Library, e.g. Program or Instrument
instrument | to test for direct binding |
|
virtual |
Whether a given InstrumentAudio is directly bound to the Chain, where "directly" means a level more specific than Library, e.g. Program or InstrumentAudio
instrumentAudio | to test for direct binding |
|
virtual |
|
virtual |
is initial segment?
|
virtual |
Test if a given instrument is one-shot
instrument | to test |
|
virtual |
Test if a given instrument and track name is a one-shot sample hit
instrument | to test |
trackName | to test |
|
virtual |
Test if a given one-shot instrument has its cutoffs enable
instrument | to test |
|
static |
Parse the control mode from a string
str | to parse |
|
virtual |
Put a SegmentChoice in the store
Should add memes from ALL program and instrument types! https://github.com/xjmusic/xjmusic/issues/210
entity | Choice to put |
|
virtual |
Put a SegmentChoiceArrangement in the store
entity | Arrangement to put |
|
virtual |
Put a SegmentChoiceArrangementPick in the store
entity | ChoiceArrangementPick to put |
|
virtual |
Put a SegmentChord in the store
entity | Chord to put |
|
virtual |
Put a SegmentChordVoicing in the store
entity | ChordVoicing to put |
|
virtual |
Put a SegmentMeme in the store
entity | Meme to put |
force | whether to force meme addition without valid theorem checks |
|
virtual |
Put a SegmentMessage in the store
entity | Message to put |
|
virtual |
Put a SegmentMeta in the store
entity | Meta to put |
|
virtual |
Set the preferred audio for a key
parentIdent | for which to set |
ident | for which to set |
instrumentAudio | value to set |
|
virtual |
Store a sticky bun in the fabricator
bun | to store |
JsonProcessingException | on failure @ on failure |
|
static |
Get the string representation of the control mode
controlMode |