I think I've worked this out now.

I've done some reordering of the lists for better separation.

In the CLI we have:
    previous entry
    current input
    line to-send

Each of these have three entries representing:
   root word,
   section,
   offset.

At startup the sets the last see to:
    main
    (empty)
    (empty)

On input, the root word is compared with the root list, and if matched,
puts this in to-send, and then moves to checking the section.

If root is found and is one that has no sections, or the input section is empty
it sends just the root.

If it couldn't find a match it moves the input section to the offset one,
and the input root to the section one, then zeros the input root. It also copies
the last seen root to the to-send one

There is an exception here in that any of the three effects roots can *only*
have 'formant' as a section, so it's easiest to check for this at this time and
respond accordingly.

Otherwise it now compares the input section to the section list.

If the section is found and is one that has no offsets, or the input offset is
empty it copies the root and section to to-send.

If it is not found it checks the previous section word. If that is zeroed, it
exits with an error, otherwise it copies it to the to-send section.

It now does a validity check exiting with an error if any of these fail:
    Only Subsynth as a Bandwidth section, and it doesn't have Waveform or
 Resonance.
    Addsynth doesn't have Waveform.
    Voice doesn't have Resonance.
    Modulatior only has Waveform, Amplitude and Frequency.


Finally, it checks the input section against the offset list, and if it's not
found exits with an error.

Again it checks validity and exits on error.
    Only Filter has Formant.
    Modulator only had Envelope.

Whenever a successful entry has been sent it is copied to the previous one.

If anyone has a bit of free time, please check my reasoning. I've attached the
two adjusted lists here again.

-- 
Will J Godfrey.

Attachment: windowTypes
Description: Binary data

Attachment: windowTypesCompact
Description: Binary data

_______________________________________________
Yoshimi-devel mailing list
Yoshimi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/yoshimi-devel

Reply via email to