That does look straightforward to have the source wrapped in an envelope, 
but it might be a bit difficult with how the procedural sources are 
currently implemented. They are subclasses of the sound Source, which 
return AudioData is consumed directly by a Player. Wrapping them in an 
envelope class would mean having to convert their output back into an 
intermediate format, modifying it with the envelope, and then converting it 
back into AudioData packets. This would likely be prohibitively slow... It 
might be an interesting thing to try in another branch though, at some 
point. 

For a start, I think I'll try to implement my previous idea in my fork, and 
see how it works out.


On Sunday, December 11, 2016 at 12:05:34 PM UTC+9, [email protected] wrote:
>
> Hmm, or maybe you could try the opposite. Instead of having the envelope 
> be added to a source which then passes its own parameters back before 
> playing, you could add the source to the envelope class and play it from 
> there instead acting as a filter. Something like:
>
> adsr_envelope = procedural.ADSREnvelope(attack=0.05, decay=0.1, 
> sustain_amplitude=0.7, release=0.3)
> sine_wave = procedural.Sine(duration=1, frequency=220)
> adsr_envelope.bind(sine_wave)
> adsr_envelope.play()
>
> So if you wanted to change envelopes you could unbind/rebind it to a 
> different envelope instance, or change existing parameters, etc.
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to