I'm not sure if you're saying that now you're thinking about a new release based on my ideas or that you're still not planning to.
Eh, I see now I wasn't being clear. I just wanted to share my thoughts, as I currently don't have much time to spare.
But what you've done - very cool
I hope my code has been readable enough.
I took a quick stab at this last night, and it seems like PhraseMate doesn't know the current LPB at any given pattern, does it? Like Renoise isn't calculating and reporting the song LPB at a specific position.
The way I use LPB, I have one command per pattern in the master track. So a first pass at this (for me) is reading the first line of the pattern on the master track to see if there's a ZL command on it. If so, use that value as the phrase LPB.
Yeah, that would work for your particular way of doing things, but is hardly a generic solution.
That "idea" that I mentioned basically involved asking Renoise to play a very brief segment of the song in order to determine the LPB. It's a hackish solution, but much bettern than having to (worst case, but potentially) checking each and every line in the entire song.
With solid proof of the starting points LPB, we need only to parse the lines in the actual region being turned into a phrase.
Would definitely be nice to a method for determining this sort of thing via the API!
Perhaps PhraseMate can insert ZL commands to change LPB, and add lines to the pattern to fit the higher LPB phrase data? That seems like it could get dicey quick. Maybe I just need to split my patterns at the LPB switch points?
Seems a bit like creative workarounds to me. I would really prefer that it tries its best to conserve the song as-is, warning you when there's the possibility of "data loss" (the changes might be subtle, but it's hard for the tool to know).
Okay tell me what you think about these first passes at the three pieces:
1. Read the phrase base note
2. Read the note that triggers the Zxx command
3. Calculate the offset between them
4. Apply that offset to the notes being written to the pattern
Figuring out the offset, yep.
Render current phrase
1. Look backwards from the current line until we find a Zxx command
2. Look forward until there's an OFF or a different note
3. Write phrase to pattern using those start and end points
Yep - looking forward/backwards can be achieved with `xNoteCapture`, using a custom callback function.
There is also xRule, but it's probably overkill for this particular scenario.
Also, in case the user has selected a scale, this needs to be applied to the notes being written.
Otherwise the rendered notes can end up sounding different than when playing through the phrase.
btw this is the error I get when trying to run PhraseMate from git:
Ah yes, the repository is not the stable version. But I believe the only changes I've done to PhraseMate, compared to the last release, are refactoring some parts into xLib/cLib classes.