Allowing the `bpm` function to return the current bpm

1. Describe your reason for requesting this feature. What problems are you running into?

Consistently manipulating the BGM tempo essentially requires you to (redundantly) store each song's bpm in the code. Want to speed up the music by a factor of 1.2x? You need the current BPM first, which you would need to store in the code, for every possible song to speed up (leading to possible redundancy problems if any one song's bpm is to change). Want to pause the music (by setting the BPM to 0, then back to what it originally was)? Same thing.

Extending the bpm function to be callable without an argument (varname = bpm to store the current bpm in varname) seems like the most natural solution for this, so you can speed up, slow down or pause any song without having to redundantly hardcode the song's bpm in the code first.

2. How would this request improve your experience with using Pulp?

It makes the functionality of the bpm function scalable, so you don't have to extend the code every time you add a new song, and without redundancy problems (having to update the code every time you change a song's bpm).


edit: pausing the music by setting the bpm to 0 and back to unpause doesn't work very well—it seems like notes that are already playing will not end, and the bpm update only seems to happen at a note tick, which is at a snail's pace when the bpm is 0 (not exactly zero, apparently)

2 Likes