-
Notifications
You must be signed in to change notification settings - Fork 228
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
Add fadeout #217
base: master
Are you sure you want to change the base?
Add fadeout #217
Conversation
Updated. Now pins volume to |
A fadeout seems exceptionally situation specific rather then generic. Why not instead have something that just does standard audio envelope manipulation? I.E. it would be defined with an Fade-out and fade-in would both be trivially and efficiently built on that without requiring a specialized multitude of structs for each and every potential sound manipulation that could be done via normal audio envelope's. For example, a fade-out would just be a release (or some step before it, prerelease perhaps? would only work on sources with known lengths though all the others would work on sources with unknown lengths) with the rest set to 0 times and no-ops as is traditional. The code would execute just as efficiently and it would give significant power. You can then define |
That seems beyond my knowledge of audio manipulation (in that I know what those words mean in general, but not in this context). As long as a method for fading out that takes a If you really want to go far, something built on |
@mathstuf Actually it's all really simple things, much more so then most people think. I'd recommend going through this audio tutorial when you get a half hour or hour or so, it's all in-browser but teaches what they are and how they work. The envelope section is directly related here but adding all the traditional audio effects would be very useful: https://learningsynths.ableton.com/ Envelopes aren't fancy enough to use splines either (though it would make for more capabilities). ^.^ |
Finally got some time to go back and look at this :) . So looking at that, I think that's slightly different. Are you suggesting to have a source which applies some envelope to another source? That seems a bit different here where we don't know how long I also have no use case for such features, so I don't want to sink more time into it. |
I can clearly see the advantage of having an envelope based source, but I think it should be a separate source. The fade in/out sources should stay because they are easy to use (if anything, refactored to work on top of the envelope source). Any chance we can get this merged in? I have a project that needs this feature badly. |
My main use case is to fade out a looping piece of music at the end of a level. I suppose you could compute the length of the audio doing something like: if let Some(duration) = source.total_duration() {
let source = source.fadeout(fade_out_duration);
source.periodic_access(duration - fade_out_duration, |s| s.start())
} else {
// Probably Box<Source> to align with the above.
} |
b10961c
to
a7f67b3
Compare
No description provided.