Skip to content

Volume animation #66

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

Closed
wants to merge 3 commits into from
Closed

Conversation

gamblor21
Copy link
Member

A new animation that takes MP3Decoder volume and adjusts the neopixels both in brightness and number of lit pixels. It could also consume any other object that has a member that reflects the current audio volume.

@tannewt tannewt requested a review from kattni September 29, 2020 21:54
@jposada202020
Copy link
Contributor

@kattni, this one is ready for review also. thanks

@evaherrada evaherrada changed the base branch from master to main June 7, 2021 17:38
Copy link
Contributor

@kattni kattni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gamblor21 Hey! We're taking a look at this now. You submitted it before we started using the reuse licensing. Please update the licensing along with any possible suggestions we may have regarding the code.

I would suggest running it through pre-commit to make sure it fits with our current standards.

@rhooper
Copy link

rhooper commented Oct 31, 2021

@gamblor21 This could use an example in the examples directory. I finally managed to make it sort of work after a bit of fiddling.
Type hints would also be great. See #83 for examples. Pin for type hints can be found in microcontroller.

I had this to test, though I never got it to play nicely as the speaker stuttered badly.

import board

from adafruit_macropad import MacroPad
from adafruit_led_animation.animation.volume import Volume
from audiomp3 import MP3Decoder
from audiopwmio import PWMAudioOut as AudioOut

macropad = MacroPad()
macropad._speaker_enable.switch_to_output(True)

# shutdown = digitalio.DigitalInOut(board.SPEAKER_ENABLE)
# shutdown.switch_to_output(True)

mp3 = open('slow.mp3', 'rb')
decoder = MP3Decoder(mp3)
audio = AudioOut(board.SPEAKER)
audio.play(decoder)
a = Volume(macropad.pixels, 0.01, (255, 0, 255), decoder)
while audio.playing:
    a.animate()

@gamblor21
Copy link
Member Author

Just a note that I saw the comments and haven't forgotten about this PR. I hope to have some time soon that I can revisit and update things. Adding an example is a great idea and I can do that as well.

@FoamyGuy
Copy link
Contributor

This same change was in #67 as well. I think it's easiest to just keep it from there and close this one to avoid any merge weirdness.

I added an example for the volume animation in a commit over in #67 as well, though I didn't realize there was one in a comment here at the time so it's a little different.

closing this one in favor of keeping #67

@FoamyGuy FoamyGuy closed this Jun 30, 2023
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.

5 participants