Procedural Music Generator, july 2022 progress report



Bytecode

Structure

Opcode

DataLength
Data[0]
Data[...]
Data[DataLength]


Quick example of bytecode

Start stop pattern #x // demarre le pattern à la prochaine mesure

Load register A with X

Get register 

Load Into B

Add A,B

Etc 


Example of file

PMG_VERSION;1.2 

// static (definitions)

// ESA : Every object in PMG is given a FSM, wich can be used or not

DEF OBJECT; Object_Album

DEF STATE; State1_Intro

DEF ENTRYACTION

START_FSM; Object_song; calm // start FSM "song" with 1 parameter (for example "color")

WAIT_END_FSM; Object_Song

END DEF

DEF TRANSITION; State1_intro;State2

Xxx

SET;transition_condition_value; true

END DEF

END DEF


DEF STATE; state2_Song

Xxx

END DEF


DEF STATE; state3_Intermede

Xxx

END DEF


SET_INIT; State1_intro


DEF FSM Object_Song:

DEF state; STATE1

Def entry action 

START_FSM; Object_Section; sunny

END DEF

END DEF


// Dynamic (execution)

// main

NEW; Object_Album

NEW; Object_Song

NEW; Object_Section

NEW; etc


START_FSM; Object_Album 


Comments