Home

2024

Worklog

LETSGO Game

Refactor Music Composer

Date
October 12, 2024
Hours
4
Tags
UnrealCodeC++LETSGO

Merged MergedMerged

It’s technically working, as per Composer Code technically working

But it’s a giant mess. So I took a large portion of my Saturday to start reworking it as a new PR:

The main insight I got was the realization that for the purposes of scale generation, a Chromatic Scale is all you need. It has 12 half steps, containing all the notes you would need for other scales. In fact, one could go as far as to say that all other scales are subsets of a Chromatic Scale.

This forced reworking how Intervals are set (like the third, fourth, fifth note of a scale), now just sending a index of a chromatic scale into a list of allowable indices to use in the chromatic scale.

The other main change was to pull out the Composer state data into a separate Actor. The way I’ve implemented the Musical Strategies means each musical strategy is a stateless object. And because the interface forces the signature of each strategy method, I need to pass as much state as I can for the strategies to use.