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

🐛 [Earwurm] Various bug fixes #50

Merged
merged 56 commits into from
Jan 4, 2024
Merged

🐛 [Earwurm] Various bug fixes #50

merged 56 commits into from
Jan 4, 2024

Conversation

beefchimi
Copy link
Owner

@beefchimi beefchimi commented Nov 26, 2023

This PR addresses many issues / feature-requests for the project.

Resolved issues

Consumer facing changes

  • Fix issue "stopping" a Sound that was never "started".
    • Now manually triggering #handleEnded when a Sound has never been played.
  • Include a neverStarted: boolean; property in the SoundEndedEvent.
  • New volume change event for Earwurm, Stack, and Sound.
  • New mute change event for Earwurm, Stack, and Sound.
  • New library change event for Earwurm.
  • New queue change event for Stack.
  • New speed change event for Sound.
  • speed Setter now clamps the value between 0.25 and 4.
  • New progress change event.
  • New progress Getter.
  • New state > ending value.
    • Can be used to distinguish a manual .stop() vs a natural "end".
  • Renamed all statechange events to state.
  • No longer setting mute = false when "pausing".
    • This avoids triggering the new mute change event.
  • Avoid re-initializing an existing Stack when .add() is passed an identical id + path.
  • Removed LibraryKeys type, instead using StackIds[] directly.
  • Now exporting tokens object with some usual values.
  • Updated docs/api.md to include details on all the newly added / changed code.

Project development changes

  • Updated various project dependencies.
  • Various test changes.
  • Consistent use of async tests.
  • New PrimitiveType.
  • New utilities: arrayShallowEquals, assertNumber.
  • New helpers: linearRamp.
  • Simplified some utility arguments.

Known bugs

  • We appear to end up drifting from the "current play position" and the "progress" when:
    • Sound is looping.
    • Speed is adjusted multiple times.
    • Thoughts:
      • Could be that playbackRate is not a direct "value multiplier" as we thought.
        • Worth investigating the topic of "audio time stretching".
      • Could be that the small gaps between UI and the capture of currentTime is the problem.
      • Could also be that I've made a mistake in my math.
    • Questions: Would detune produce a different result?
      • We would need a way to convert cents into a "multiplier" (or however the progress math works out).

Future tasks

  • Update examples.md to include some of the new features.
  • Apply transition to speed linear ramp.
    • This will complicate the progress calculations... but maybe it is as easy as:
      • If slowing down: subtract half of transitionDuration.
      • If speeding up: add half of transitionDuration.
  • Investigate an async emitten.
    • Currently, we have an issue where we are not executing all of the ended subscriptions, as empty() appears to not allow any queued events to execute.
    • Perhaps we just need to pass empty an option for executeQueue?

Considerations

  • Maybe we offer a linearRamp() method on Sound to allow custom changes over time?
    • This would perhaps make the transitions feature obselete?
  • Consider a way to toggle transitions while Earwurm is already initialized.
    • We would need to allow a Getter/Setter.
    • Not sure how exactly this will influence Sounds that are already "prepared" and/or "playing/paused".
  • Consider a "global setter method" on Earwurm and Stack that allows syncing prop values.
    • Something like earwurmManager.setAll('speed', 1.25).

@beefchimi beefchimi added the 🐛 Bug Something isn't working label Nov 26, 2023
@beefchimi beefchimi self-assigned this Nov 26, 2023
Copy link

changeset-bot bot commented Nov 26, 2023

🦋 Changeset detected

Latest commit: de9c61d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
earwurm Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@beefchimi beefchimi force-pushed the various-fixes branch 2 times, most recently from 1c25f0b to 3555328 Compare December 6, 2023 21:54
@github-actions github-actions bot added 🛠️ Tooling Relating to build tooling or deployment 🧰 Dependency Any dependency change (add / remove / downgrade / update) 🧪 Testing Relating to testing of this code labels Dec 20, 2023
@beefchimi beefchimi force-pushed the various-fixes branch 2 times, most recently from af06071 to c40fae8 Compare December 22, 2023 16:58
@github-actions github-actions bot added the 📚 Documentation Improvements or additions to documentation label Dec 22, 2023
@beefchimi beefchimi marked this pull request as ready for review January 4, 2024 21:05
@github-actions github-actions bot added the 🔖 Release Merge of this PR triggers a new release label Jan 4, 2024
@beefchimi beefchimi merged commit 51368fd into main Jan 4, 2024
3 checks passed
@beefchimi beefchimi deleted the various-fixes branch January 4, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working 🧰 Dependency Any dependency change (add / remove / downgrade / update) 📚 Documentation Improvements or additions to documentation 🔖 Release Merge of this PR triggers a new release 🧪 Testing Relating to testing of this code 🛠️ Tooling Relating to build tooling or deployment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Sound] Add speed accessor Fix node process not quitting while running tests
1 participant