Sorry about the
play_failed()
thing ... that was left over after using it to halt the system when it was about to crash, and look at the stack and objects' states using TeensyDebug. Removed and pushed, but you can just comment it, as you've found.
As noted (probably unclearly) in post #179, you can
either use the
disableResponse()
/
enableResponse()
yield-masking approach,
or setForceResponse(true)
(once, in
setup()
) plus
runPolled()
"as often as needed" -
at least once per
loop()
, but possibly more often, e.g. just before / after a time-consuming display access.
Whatever approach you use, the rule of not doing any of the above from interrupt remains, of course. You can modify your own data structures, and it
seems from testing that it's OK to change playback rate from 0.0 to 1.0 or whatever, but that's strictly it!
Given what you've said about updating your AsyncIO, it's probably best if you can decompress a bit and then provide a small example - chances are too high I'd use out-of-date code to do something in a way you wouldn't
I don't think it's likely to be possible to parallelise calls to
open()
in any meaningful manner. There's no awareness from one playback object of the existence or state of another, and even if that were added somehow, it would have to be extended into the SdFat library (and other filesystems) as some sort of
open_multi(list_of_files)
. It's a very niche use case, and I'd be surprised if the gains would be worthwhile.
I wasn't aware that the playback cueing scheme we devised has a particular issue with latency, provided all the required samples are ready by the time they're actually triggered. There absolutely
is, of course, if you
don't use cueing ... there's no way around that. Obviously, as you say in #183, there's different ways to implement that look-ahead capability - we just did a simple proof-of-concept, looking ahead just one beat. Looking further ahead is possible, but you may end up with cued-up tracks you don't need if the user changes patterns; it's very application-dependent.
Happy to look at any simple examples you can provide, of course.