Protonerd / FX-SaberOS

System code for Arduino based Lightsaber replicas for DIYino family boards
Creative Commons Zero v1.0 Universal
91 stars 42 forks source link

Power On Sound duration #80

Closed Danvader389 closed 4 years ago

Danvader389 commented 5 years ago

Hello,

I am building an homebrew version of FX-SaberOS. I am using the defaullt DIYino_Prime_SDCard_soundfonts When I press the button to activate the lightsaber It is like the power-on sound is shorter that needed or too fast. However the power-off sound duration is perfect. Is there a way to fix this problem ?

Thanks for helping

jbkuma commented 5 years ago

Edit the duration in soundfont.h

On Fri, Dec 7, 2018, 1:53 PM Danvader389 <notifications@github.com wrote:

Hello,

I am building an homebrew version of FX-SaberOS. I am using the defaullt DIYino_Prime_SDCard_soundfonts When I press the button to activate the lightsaber It is like the power-on sound is shorter that needed or too fast. However the power-off sound duration is perfect. Is there a way to fix this problem ?

Thanks for helping

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Protonerd/FX-SaberOS/issues/80, or mute the thread https://github.com/notifications/unsubscribe-auth/ATdCMEQjRsHkacgYCs5coZtl90Nf4sNfks5u2rlFgaJpZM4ZI96b .

Danvader389 commented 5 years ago

Thanks jbkuma for your answer I have another question: Is the resistor between gate and source of mosfet optionnal or mandatory? I am using FQP30N06L mosfet

Protonerd commented 5 years ago

No, they aren't necessary, the code takes care about controlling the gates in sleep/idle modes, so they are never undefined. The Stardusts do not have them either any more.

StrangeD0s commented 5 years ago

I also have a question about the power on sound that might fit in here. Will changing the duration in soundfont.h also affect the lighting up speed of the neopixel? I am currently trying to make a power on sound that is fast an snappy but has some additional sizzling going on right after the blade has extended. But I never seem to be able to align the length of the sound with the speed of the neopixel ignition. If I make the duration in soundfont.h shorter, it seems to cut the power on sound off and go straight to hum.

jbkuma commented 5 years ago

The duration controls the speed of the animation, and the hum does begin immediately at the end of the animation. Originally it didn't cut the sound off, but I'm not sure what changed.

There are 2 factors that will affect this: HUM_RELAUNCH and PowerOnTime. HUM_RELAUNCH defaults to 2000ms, and PowerOnTime is the timing of the animation. What is supposed to happen is that the hum relaunch is suppressed for PowerOnTime+1000 which should be plenty of time.

This is the vital part to relaunch the hum in the main .ino [image: image.png]

I don't have something I can test this with at the moment, but you could try changing the if statement to if (((millis() - sndSuppress > HUM_RELAUNCH) && !(hum_playing))) {

Jason "Kuma" Brinkerhoff Mad Science Workshoppe, proprietor http://jbkuma.com/workshoppe

On Thu, Mar 21, 2019 at 10:28 AM StrangeD0s notifications@github.com wrote:

I also have a question about the power on sound that might fit in here. Will changing the duration in soundfont.h also affect the lighting up speed of the neopixel? I am currently trying to make a power on sound that is fast an snappy but has some additional sizzling going on right after the blade has extended. But I never seem to be able to align the length of the sound with the speed of the neopixel ignition. If I make the duration in soundfont.h shorter, it seems to cut the power on sound off and go straight to hum.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Protonerd/FX-SaberOS/issues/80#issuecomment-475251692, or mute the thread https://github.com/notifications/unsubscribe-auth/ATdCMJ940_AfG93F1uqRL22sZlKCTdJYks5vY5cdgaJpZM4ZI96b .

StrangeD0s commented 5 years ago

Thanks for your answer. Your linked image is not showing up, but I think I understand it better now.