XJ music engine  1.9.6
In-game runtime engine for XJ music.
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
XJ::StickyBun Class Reference

#include <StickyBun.h>

Public Member Functions

 StickyBun ()=default
 
 StickyBun (UUID eventId, int size)
 
 StickyBun (UUID eventId, std::vector< int > values)
 
std::vector< NotereplaceAtonal (std::vector< Note > source, const std::vector< Note > &voicingNotes) const
 
Note compute (const std::vector< Note > &voicingNotes, int index) const
 
std::string computeMetaKey () const
 
std::string serialize ()
 

Static Public Member Functions

static std::string computeMetaKey (const UUID &id)
 
static StickyBun deserializeFrom (const std::string &str)
 

Public Attributes

std::vector< int > values
 
UUID eventId
 

Detailed Description

Segment has metadata for XJ to persist "notes in the margin" of the composition for itself to read https://www.pivotaltracker.com/story/show/183135787

Constructor & Destructor Documentation

◆ StickyBun() [1/3]

XJ::StickyBun::StickyBun ( )
default

Construct a sticky bun

◆ StickyBun() [2/3]

StickyBun::StickyBun ( UUID  eventId,
int  size 
)

Prepare a sticky bun with event id and values

Parameters
eventIdto persist
sizeof bun to generate

◆ StickyBun() [3/3]

StickyBun::StickyBun ( UUID  eventId,
std::vector< int >  values 
)

Prepare a sticky bun with event id and values

Parameters
eventIdto persist
valuesof bun

Member Function Documentation

◆ compute()

Note StickyBun::compute ( const std::vector< Note > &  voicingNotes,
int  index 
) const

Replace atonal notes in the list with selections based on the sticky bun

Parameters
voicingNotesfrom which to select replacements
indexof the note to replace
Returns
notes with atonal elements augmented by sticky bun

◆ computeMetaKey() [1/2]

std::string StickyBun::computeMetaKey ( ) const

Compute a meta key based on the event id

Returns
meta key

◆ computeMetaKey() [2/2]

std::string StickyBun::computeMetaKey ( const UUID id)
static

Compute a meta key based on the given event id

Segment has metadata for XJ to persist "notes in the margin" of the composition for itself to read https://www.pivotaltracker.com/story/show/183135787

Returns
compute meta key

◆ deserializeFrom()

StickyBun StickyBun::deserializeFrom ( const std::string &  str)
static

Deserialize from JSON

Parameters
strJSON representation
Returns
StickyBun

◆ replaceAtonal()

std::vector< Note > StickyBun::replaceAtonal ( std::vector< Note source,
const std::vector< Note > &  voicingNotes 
) const

Replace atonal notes in the list with selections based on the sticky bun

Parameters
sourcenotes to replace atonal elements
voicingNotesfrom which to select replacements
Returns
notes with atonal elements augmented by sticky bun

◆ serialize()

std::string StickyBun::serialize ( )

Serialize to JSON

Returns
JSON representation

Member Data Documentation

◆ eventId

UUID XJ::StickyBun::eventId

◆ values

std::vector<int> XJ::StickyBun::values

The documentation for this class was generated from the following files: