Skip to content

Added melody loop support#12

Merged
end2endzone merged 1 commit intoend2endzone:masterfrom
elbowz:add-loop
Sep 29, 2021
Merged

Added melody loop support#12
end2endzone merged 1 commit intoend2endzone:masterfrom
elbowz:add-loop

Conversation

@elbowz
Copy link
Contributor

@elbowz elbowz commented Sep 28, 2021

It allows the possibility to repeat the melody with a chosen gap between repetition.

The number of repetition (iLoopCount) and the gap (iLoopGap) can be passed to the function begin as optional params.

This features was useful in a my little project (https://github.com/elbowz/thumbl-p), but I don't know if can be useful for others or it's well implemented.

I have used noteDelay to add the pause/gap between repetition, so I don't know if it's so elegant coding.

Anyway, thanks for you very useful and simple (to use) library!

It allows the possibility to repeat the melody with a chosen gap between repetition
@end2endzone
Copy link
Owner

Hi. That is a great contribution. I am not sure that this feature would be a popular use case but I could be wrong. My point is that you can implement such a feature directly in loop() with SoftTimers that implements a delay when rtttl::isPlaying() transitions from true to false. When the SoftTimer expires, you rtttl::play() again.

What is certain is that your changes are backwards compatible so it wont hurt to integrate them.
I would gladly accept this new feature into the library.

Thank you

@end2endzone end2endzone merged commit b7307a5 into end2endzone:master Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants