Riffer: add scale and chord relative notes

I use a lot of midi generating tools, Riffer among them. I think the following functionality would be great if it could be added to Riffer on top of what is already there.

As currently configured, you tell Riffer to work within a given music scale, and it generates phrases. The phrases are then defined as absolute midi note values. But what if the note values Riffer generates could be defined not only in absolute terms, but also in terms of (a) relative to scale or (b), and more importantly, relative to an incoming chord. The generated patterns would then change subject to Riffer either being told to play in a different musical scale or receiving a chord input during playback.

So let’s imagine that the midi notes generated by Riffer were of three types (absolute, scale relative, and chord relative), which could be shown by them having three different colours on the grid where they are displayed on the UI. The user can right click on any note and change it from being absolute, scale, or chord relative. In Riffer’s phrase generation options, settings are added to allow the mix of notes that are generated to be controlled. So the phrase can include all absolute, all scale relative, or all chord relative or any mixture of the three (an easy UI idea is a triangle with 3 points, user clicks a point in the triangle to set the mix). An additional option would allow the user to set the number of chord notes that will be available between three and five.

Once Riffer generates a phrase, scale and chord relative notes now shift during playback if riffer receives midi input specifying either a new scale or a new chord. A note riffer has generated as chord relative shifts in response to an incoming midi chord provided the incoming chord notes are all in the specified scale. And as Riffer receives chord input the UI updates to show the new midi note value of the chord relative notes.

With this scheme the phrases generated by riffer would interact with a chord progression if you have one set up. With this functionality you would be able to set up chord arpeggios and the like and a lot more. The sort of use case I am imagining is then that you would set up a chord progression (for example with chordjam or scaler) and then set Riffer to continuously generate phrases with a combination of scale and chord notes. Saving the phrases Riffer generates as scale/chord relative would make them usable in more musical contexts.