Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix transpose of pattern fallthrough #1

Closed
pinobatch opened this issue Feb 9, 2016 · 2 comments
Closed

Fix transpose of pattern fallthrough #1

pinobatch opened this issue Feb 9, 2016 · 2 comments

Comments

@pinobatch
Copy link
Owner

pinobatch commented Feb 9, 2016

As of 0.05wip3, pentlyas supports an undocumented fallthrough command, allowing a pattern to continue into the next pattern. But this is defective because it doesn't take into account differences in the transposition base between patterns. @jroatch has provided a test case, with the following explanation:

# fallthrough patterns are quite useful to save space in
# the conductor data, but the 0.05 assembler transposes
# them weird.  Uncomment the '//' lines to hear what they
# are supposed to be.

2016-02-03_fallthrough-tests.pently.zip

@Qix- Qix- added the bug label Jun 14, 2016
pinobatch added a commit that referenced this issue Mar 11, 2019
Next after this is to plan which issues will and won't make the
cut for wip11.  These are my tentative top three:

- #1: Transpose of fallthrough (reported by #jroatch)
  It's always nice to try addressing the oldest issue on record.
- #36: ft2pently example (requested by @adrian0901)
  More people appear to prefer the tracker route. Make that easy.
- #2: Document reentrancy
  Many devs swear by calling the sound driver from the NMI handler
  in order to keep music from lagging even when the game lags.
  I'm not in that habit because of data races and stateful mappers
  (MMC1, MMC3, FME-7).  So I'll show my catch-up workaround.
@pinobatch
Copy link
Owner Author

pinobatch commented Mar 12, 2019

The score could play a fallthrough group starting at any pattern boundary, and PATEND needs to return to the same transposition at the end. This means the assumed transposition base for all patterns in the group must be the same. Here's a plan:

  • Add a docstring for find_transpose_runs()
  • Have find_transpose_runs() save both ends of each run's range: the highest note in each run in addition to the lowest
  • Run find_transpose_runs() on all individual pitched patterns prior to the parts_to_print loop
  • Save each pitched pattern's transposition base and lowest note
  • Check validity of a play command based on lowest note, not transposition base
  • Propagate transposition base and lowest note backward within each group
  • If the last pattern has only one run, attempt to expand it to cover preceding patterns' runs so long as the 2-octave range limit is not exceeded
  • Ensure the test case renders correctly

pinobatch added a commit that referenced this issue Mar 12, 2019
I finally started working on #1.  I'll start with some changes
to find_transpose_runs that the new functionality will need.

- Add a docstring
- Save both ends of range: highest and lowest semitone
pinobatch added a commit that referenced this issue Mar 12, 2019
continuing #1:

- calculate transpose runs and save them in pattern object
- separate pattern transpose from start of 1st run
- if 1st run won't fit in pattern transpose, add an initial TRANSPOSE
pinobatch added a commit that referenced this issue Mar 12, 2019
for #1; will test thoroughly later
pinobatch added a commit that referenced this issue Mar 13, 2019
The test case attached to #1 shows not only the problem with
fallthrough (the genuine topic of the issue) but also a quirk
where the parser assumes that a pickup belongs to the pattern,
not the song.  Document this quirk.
pinobatch added a commit that referenced this issue Mar 13, 2019
This does most of #1, except for stitching the last pattern's
pitch range to those of earlier patterns.

Also document the fallthrough command and list the commands that
close a pattern.
@pinobatch
Copy link
Owner Author

There was a minor problem with the test case that jroatch provided. When I added bar check about two years after the test case (#26), the pickup command became usable within patterns. So I had to move the pickup command in the test case above the pattern definitions and document this parser quirk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants