[livecode] Re: Vivid: Brief, triggered sounds

From: Alfred Matthews <asm13243546_at_gmail.com>
Date: Sun, 8 Jul 2018 17:16:35 -0400

Send to haskell-art, which is up. Haskell cafe is not interested.

On Sun, Jul 8, 2018, 3:20 PM Jeffrey Brown <jeffbrown.the_at_gmail.com> wrote:

> I spoke a little too soon. I am able to retrigger a "sustainning" envelope
> like ADSR or ASR, but only awkwardly
> <https://github.com/JeffreyBenjaminBrown/vivid/blob/1629a628fc39d67b418f49f3ee5853513ccadcd3/learning/riddles/retrigger-awkward.hs>
> .
>
> Those envelopes take a "gate" argument. (I'm taking these terms from the
> SuperCollider built-in documentation.) When "gate" is positive, the
> envelope is "open", which means that it will not progress past the sustain
> portion of the curve. When the gate signal becomes zero, the gate is
> "closed", and will move from sustain to release.
>
> I can't retrigger an open envelope. I've got to close it by sending a
> gate=0 signal, and then wait about a milisecond, before sending a gate=1
> signal to open it again. This has the desired effect: The envelope value
> rises again as in the attack phase, before the release phase reaches zero.
>
> So I was hoping to be able to do something similar with the "fixed-length"
> envelopes like Env.perc (Vivid's percGen) or Env.linen (Vivid's linen). In
> the SC documentation for Env, it describes the gate parameter in the
> following way: "If the Env is fixed-length (e.g. Env.linen, Env.perc), the
> gate argument is used as a simple trigger. If it is an sustaining envelope
> (e.g. Env.adsr, Env.asr), the envelope is held open until the gate becomes
> 0 ..." That led me to think maybe I can send gate=1 repeatedly to a percGen
> in order to retrigger it before it has gone to zero.
>
> But percGen has no gate argument!
>
> Am I trying to do something that's possible?
>
>
> On Sat, Jul 7, 2018 at 11:15 PM Jeffrey Brown <jeffbrown.the_at_gmail.com>
> wrote:
>
>> Solved
>> <https://github.com/JeffreyBenjaminBrown/vivid/blob/jbb-update/learning/envelope.hs>
>> !
>>
>> On Sat, Jul 7, 2018 at 6:43 PM Jeffrey Brown <jeffbrown.the_at_gmail.com>
>> wrote:
>>
>>> This is awesome!
>>>
>>> What if the voice persisted and you needed to retrigger the envelope
>>> later? I'm imagining a resonating guitar string: It's continuously making
>>> sound, but every now and then the player strikes it again. Or someone
>>> playing monophonic slide violin: They might want to play an F# for a while,
>>> then slide into an A. Or a didgeridoo: The sound is in a steady state, then
>>> the player makes a "pew" noise, and then the didge settles back into
>>> another (usually the same) steady state.
>>>
>>> In the first case there's an amplitude envelope that's (probably) in its
>>> decay portion when it is retriggered. In the second there's a frequency
>>> envelope that's (probably) reached its sustain portion when it is
>>> retriggered to go to a new frequency.
>>>
>>> This might dovetail with an earlier question about sending strings to
>>> synths
>>> <https://we.lurk.org/hyperkitty/list/livecode_at_we.lurk.org/thread/6JD5SHXPQQ25VZH4PVKIR5Y7HEAPXZWL/>.
>>> The synth needs to react not to a parameter change that persists, but
>>> rather to a momentary instruction -- something like what the Max/MSP
>>> community calls a "bang".
>>>
>>> Actually in the slide violin case the synth would also receive a new
>>> frequency value. And I can imagine writing a synth that has a rule like
>>> "when the frequency changes, slide into it logarithmically over the course
>>> of 100 ms". So maybe you wouldn't need bang-like messages in some cases.
>>> But in the case of re-striking a resonating guitar string, or making a
>>> "pew" sound into a didge, it might be that none of the steady-state
>>> parameters needs changing; the envelope just needs to be re-triggered.
>>>
>>> Expressible?
>>>
>>> On Sat, Jul 7, 2018 at 12:36 AM <amindfv_at_gmail.com> wrote:
>>>
>>>> I unfortunately need to log out but here's something to get you started:
>>>>
>>>> foo = sd (1 :: I "gate") $ do
>>>> e <- adsrGen 0.2 0.1 0.6 0.7 (Curve_Curve (-4)) (gate_ (V::V "gate"))
>>>> s <- e ~* sinOsc (freq_ $ midiCPS 50)
>>>> out 0 [s,s]
>>>>
>>>> main = do
>>>> s <- synth foo ()
>>>> wait 1
>>>> release s
>>>>
>>>> El 6 jul 2018, a las 23:03, Jeffrey Brown <jeffbrown.the_at_gmail.com>
>>>> escribió:
>>>>
>>>> So far I'm able from Vivid to create continuously-running signal
>>>> architectures and change their parameters over time. Next I want to create
>>>> a "snare" (some noise with a brief amplitude envelope) and a "kick" (a sine
>>>> wave with a quickly descending frequency).
>>>>
>>>> Is there an idiom for that?
>>>>
>>>>
>>>> --
>>>> Jeff Brown | Jeffrey Benjamin Brown
>>>> Website <https://msu.edu/~brown202/> | Facebook
>>>> <https://www.facebook.com/mejeff.younotjeff> | LinkedIn
>>>> <https://www.linkedin.com/in/jeffreybenjaminbrown>(spammy, so I often
>>>> miss messages here) | Github
>>>> <https://github.com/jeffreybenjaminbrown>
>>>>
>>>> _______________________________________________
>>>> Livecode mailing list -- livecode_at_we.lurk.org
>>>> To unsubscribe send an email to livecode-leave_at_we.lurk.org
>>>>
>>>> _______________________________________________
>>>> Livecode mailing list -- livecode_at_we.lurk.org
>>>> To unsubscribe send an email to livecode-leave_at_we.lurk.org
>>>>
>>>
>>>
>>> --
>>> Jeff Brown | Jeffrey Benjamin Brown
>>> Website <https://msu.edu/~brown202/> | Facebook
>>> <https://www.facebook.com/mejeff.younotjeff> | LinkedIn
>>> <https://www.linkedin.com/in/jeffreybenjaminbrown>(spammy, so I often
>>> miss messages here) | Github
>>> <https://github.com/jeffreybenjaminbrown>
>>>
>>
>>
>> --
>> Jeff Brown | Jeffrey Benjamin Brown
>> Website <https://msu.edu/~brown202/> | Facebook
>> <https://www.facebook.com/mejeff.younotjeff> | LinkedIn
>> <https://www.linkedin.com/in/jeffreybenjaminbrown>(spammy, so I often
>> miss messages here) | Github
>> <https://github.com/jeffreybenjaminbrown>
>>
>
>
> --
> Jeff Brown | Jeffrey Benjamin Brown
> Website <https://msu.edu/~brown202/> | Facebook
> <https://www.facebook.com/mejeff.younotjeff> | LinkedIn
> <https://www.linkedin.com/in/jeffreybenjaminbrown>(spammy, so I often
> miss messages here) | Github <https://github.com/jeffreybenjaminbrown>
>
> _______________________________________________
> Livecode mailing list -- livecode_at_we.lurk.org
> To unsubscribe send an email to livecode-leave_at_we.lurk.org
>
-- 
Alfred.


_______________________________________________
Livecode mailing list -- livecode_at_we.lurk.org
To unsubscribe send an email to livecode-leave_at_we.lurk.org
Received on Sun Jul 08 2018 - 21:16:58 BST

This archive was generated by hypermail 2.4.0 : Sun Aug 20 2023 - 16:02:23 BST