Expand Pulp-Audio LUA functions (Pause/Resume, Global Volume Control)

,

Today I got to play around with the exported pulp-audio.lua package and have identified some odd behaviors.

When a Pulp song is playing, by default it is assumed to be looping continuously, however the code seems to keep track of both ‘ticks’ which accumulate while the pulp.audio.update function is going, and also general time at init.

This means that if you only want the song running in certain update processes, you get a cascade of notes play when you reenter that update loop as it tries to match it’s expected song point with the elapsed time since the last update.
I would expect the note tracking to stop when the update loop is not running, or for it to just resume triggering notes at the new time point, instead of playing all notes missed since.

To this end, a pauseSong() resumeSong() function would be great to allow for better control of this behavior.

On the other end of this, being able to globally control song volume and mute operations would be super useful too.