Csound Csound-dev Csound-tekno Search About

[Csnd] Help understanding ADSR

Date2020-11-03 18:20
FromJason Hallen
Subject[Csnd] Help understanding ADSR
Hi everyone,

I'm getting the "WARNING: length of ADSR note too short" message, and I think it's because I don't really understand how ADSR works despite reading the documentation in the manual.  I've got a note with duration p3=0.25, and here's my envelope:

kenv adsr 0.001,0.1,0.7,0.1

I would think that the attack and decay time would total 0.101s, then the sustain period would last 0.049 (in order to fill out the overall duration of the note), and then the release period lasts 0.1.  The length of the whole note would come out to 0.25.  I must be wrong.  Can someone explain how ADSR works?

Thanks,
Jason
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-11-03 18:28
FromPeter Burgess
SubjectRe: [Csnd] Help understanding ADSR
How are you creating the score event and (unlikely to be the issue but I'll ask anyway) what kr are you using?

On Tue, 3 Nov 2020, 18:20 Jason Hallen, <hallenj@gmail.com> wrote:
Hi everyone,

I'm getting the "WARNING: length of ADSR note too short" message, and I think it's because I don't really understand how ADSR works despite reading the documentation in the manual.  I've got a note with duration p3=0.25, and here's my envelope:

kenv adsr 0.001,0.1,0.7,0.1

I would think that the attack and decay time would total 0.101s, then the sustain period would last 0.049 (in order to fill out the overall duration of the note), and then the release period lasts 0.1.  The length of the whole note would come out to 0.25.  I must be wrong.  Can someone explain how ADSR works?

Thanks,
Jason
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-11-03 18:40
FromOeyvind Brandtsegg
SubjectRe: [Csnd] Help understanding ADSR
Hmm, I copied your adsr line into a csd here and it runs fine.
Perhaps your p3 is less than 0.25? Just guessing
If I set it to 0.2 in the score I get the warning you get.

all best
Øyvind

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

sr = 48000
ksmps = 10
nchnls = 2
0dbfs = 1

instr 1
kenv adsr 0.001,0.1,0.7,0.1
a1 oscili kenv, 200
outs a1, a1
endin

</CsInstruments>
<CsScore>
i1 0 0.25
e
</CsScore>
</CsoundSynthesizer>


tir. 3. nov. 2020 kl. 19:20 skrev Jason Hallen <hallenj@gmail.com>:
Hi everyone,

I'm getting the "WARNING: length of ADSR note too short" message, and I think it's because I don't really understand how ADSR works despite reading the documentation in the manual.  I've got a note with duration p3=0.25, and here's my envelope:

kenv adsr 0.001,0.1,0.7,0.1

I would think that the attack and decay time would total 0.101s, then the sustain period would last 0.049 (in order to fill out the overall duration of the note), and then the release period lasts 0.1.  The length of the whole note would come out to 0.25.  I must be wrong.  Can someone explain how ADSR works?

Thanks,
Jason
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-11-03 19:05
FromJason Hallen
SubjectRe: [Csnd] Help understanding ADSR
Ah, maybe it's because I'm creating the note event in the score and have a fast tempo.  It has a p3=0.25, but the tempo is around 300.  When the tempo is sped up, does the score automatically scale the note length to a much shorter value?  That would explain it.

Thanks,
Jason

On Tue, Nov 3, 2020 at 12:40 PM Oeyvind Brandtsegg <obrandts@gmail.com> wrote:
Hmm, I copied your adsr line into a csd here and it runs fine.
Perhaps your p3 is less than 0.25? Just guessing
If I set it to 0.2 in the score I get the warning you get.

all best
Øyvind

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

sr = 48000
ksmps = 10
nchnls = 2
0dbfs = 1

instr 1
kenv adsr 0.001,0.1,0.7,0.1
a1 oscili kenv, 200
outs a1, a1
endin

</CsInstruments>
<CsScore>
i1 0 0.25
e
</CsScore>
</CsoundSynthesizer>


tir. 3. nov. 2020 kl. 19:20 skrev Jason Hallen <hallenj@gmail.com>:
Hi everyone,

I'm getting the "WARNING: length of ADSR note too short" message, and I think it's because I don't really understand how ADSR works despite reading the documentation in the manual.  I've got a note with duration p3=0.25, and here's my envelope:

kenv adsr 0.001,0.1,0.7,0.1

I would think that the attack and decay time would total 0.101s, then the sustain period would last 0.049 (in order to fill out the overall duration of the note), and then the release period lasts 0.1.  The length of the whole note would come out to 0.25.  I must be wrong.  Can someone explain how ADSR works?

Thanks,
Jason
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-11-03 19:59
Fromjohn
SubjectRe: [Csnd] Help understanding ADSR
Yes, tempo affects p2 and p3 values; if you look at te saved and sorted 
score this is apparent (option -t0)

===JPff

On Tue, 3 Nov 2020, Jason Hallen wrote:

> Ah, maybe it's because I'm creating the note event in the score and have a
> fast tempo.  It has a p3=0.25, but the tempo is around 300.  When the tempo
> is sped up, does the score automatically scale the note length to a much
> shorter value?  That would explain it.
> Thanks,
> Jason
> 
> On Tue, Nov 3, 2020 at 12:40 PM Oeyvind Brandtsegg 
> wrote:
>       Hmm, I copied your adsr line into a csd here and it runs
>       fine.Perhaps your p3 is less than 0.25? Just guessing
> If I set it to 0.2 in the score I get the warning you get.
> 
> all best
> Øyvind
> 
> 
> 
> 
> 
> 
> sr = 48000
> ksmps = 10
> nchnls = 2
> 0dbfs = 1
> 
> instr 1
> kenv adsr 0.001,0.1,0.7,0.1
> a1 oscili kenv, 200
> outs a1, a1
> endin
> 
> 
> 
> i1 0 0.25
> e
> 
> 
> 
> 
> tir. 3. nov. 2020 kl. 19:20 skrev Jason Hallen :
>       Hi everyone,
> I'm getting the "WARNING: length of ADSR note too short" message,
> and I think it's because I don't really understand how ADSR works
> despite reading the documentation in the manual.  I've got a note
> with duration p3=0.25, and here's my envelope:
> 
> kenv adsr 0.001,0.1,0.7,0.1
> 
> I would think that the attack and decay time would total 0.101s,
> then the sustain period would last 0.049 (in order to fill out
> the overall duration of the note), and then the release period
> lasts 0.1.  The length of the whole note would come out to 0.25. 
> I must be wrong.  Can someone explain how ADSR works?
> 
> Thanks,
> Jason
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
> to https://github.com/csound/csound/issues Discussions of bugs
> and features can be posted here
> 
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and
> features can be posted here
> 
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here
>

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-11-03 20:04
FromJason Hallen
SubjectRe: [Csnd] Help understanding ADSR
Great, thanks for the help.  Good to know I was understanding the ADSR opcode correctly but not understanding something more fundamental about the score!  Just to double check, if I were to trigger the note event from the orchestra the note wouldn't be affected by the score tempo and the durations wouldn't be scaled, right?

Jason

On Tue, Nov 3, 2020 at 1:59 PM john <jpff@codemist.co.uk> wrote:
Yes, tempo affects p2 and p3 values; if you look at te saved and sorted
score this is apparent (option -t0)

===JPff

On Tue, 3 Nov 2020, Jason Hallen wrote:

> Ah, maybe it's because I'm creating the note event in the score and have a
> fast tempo.  It has a p3=0.25, but the tempo is around 300.  When the tempo
> is sped up, does the score automatically scale the note length to a much
> shorter value?  That would explain it.
> Thanks,
> Jason
>
> On Tue, Nov 3, 2020 at 12:40 PM Oeyvind Brandtsegg <obrandts@gmail.com>
> wrote:
>       Hmm, I copied your adsr line into a csd here and it runs
>       fine.Perhaps your p3 is less than 0.25? Just guessing
> If I set it to 0.2 in the score I get the warning you get.
>
> all best
> Øyvind
>
> <CsoundSynthesizer>
> <CsOptions>
> </CsOptions>
> <CsInstruments>
>
> sr = 48000
> ksmps = 10
> nchnls = 2
> 0dbfs = 1
>
> instr 1
> kenv adsr 0.001,0.1,0.7,0.1
> a1 oscili kenv, 200
> outs a1, a1
> endin
>
> </CsInstruments>
> <CsScore>
> i1 0 0.25
> e
> </CsScore>
> </CsoundSynthesizer>
>
>
> tir. 3. nov. 2020 kl. 19:20 skrev Jason Hallen <hallenj@gmail.com>:
>       Hi everyone,
> I'm getting the "WARNING: length of ADSR note too short" message,
> and I think it's because I don't really understand how ADSR works
> despite reading the documentation in the manual.  I've got a note
> with duration p3=0.25, and here's my envelope:
>
> kenv adsr 0.001,0.1,0.7,0.1
>
> I would think that the attack and decay time would total 0.101s,
> then the sustain period would last 0.049 (in order to fill out
> the overall duration of the note), and then the release period
> lasts 0.1.  The length of the whole note would come out to 0.25. 
> I must be wrong.  Can someone explain how ADSR works?
>
> Thanks,
> Jason
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
> to https://github.com/csound/csound/issues Discussions of bugs
> and features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and
> features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features can
> be posted here
>

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-11-03 21:47
FromJohn ff
SubjectRe: [Csnd] Help understanding ADSR
That is my belief.  The tempo adjustment is part of score preparation -- timewarp, expanion of ramps and sorting.


⁣Sent from TypeApp ​

On Nov 3, 2020, 20:05, at 20:05, Jason Hallen  wrote:
>Great, thanks for the help.  Good to know I was understanding the ADSR
>opcode correctly but not understanding something more fundamental about
>the
>score!  Just to double check, if I were to trigger the note event from
>the
>orchestra the note wouldn't be affected by the score tempo and the
>durations wouldn't be scaled, right?
>
>Jason
>
>On Tue, Nov 3, 2020 at 1:59 PM john  wrote:
>
>> Yes, tempo affects p2 and p3 values; if you look at te saved and
>sorted
>> score this is apparent (option -t0)
>>
>> ===JPff
>>
>> On Tue, 3 Nov 2020, Jason Hallen wrote:
>>
>> > Ah, maybe it's because I'm creating the note event in the score and
>have
>> a
>> > fast tempo.  It has a p3=0.25, but the tempo is around 300.  When
>the
>> tempo
>> > is sped up, does the score automatically scale the note length to a
>much
>> > shorter value?  That would explain it.
>> > Thanks,
>> > Jason
>> >
>> > On Tue, Nov 3, 2020 at 12:40 PM Oeyvind Brandtsegg
>
>> > wrote:
>> >       Hmm, I copied your adsr line into a csd here and it runs
>> >       fine.Perhaps your p3 is less than 0.25? Just guessing
>> > If I set it to 0.2 in the score I get the warning you get.
>> >
>> > all best
>> > Øyvind
>> >
>> > 
>> > 
>> > 
>> > 
>> >
>> > sr = 48000
>> > ksmps = 10
>> > nchnls = 2
>> > 0dbfs = 1
>> >
>> > instr 1
>> > kenv adsr 0.001,0.1,0.7,0.1
>> > a1 oscili kenv, 200
>> > outs a1, a1
>> > endin
>> >
>> > 
>> > 
>> > i1 0 0.25
>> > e
>> > 
>> > 
>> >
>> >
>> > tir. 3. nov. 2020 kl. 19:20 skrev Jason Hallen :
>> >       Hi everyone,
>> > I'm getting the "WARNING: length of ADSR note too short" message,
>> > and I think it's because I don't really understand how ADSR works
>> > despite reading the documentation in the manual.  I've got a note
>> > with duration p3=0.25, and here's my envelope:
>> >
>> > kenv adsr 0.001,0.1,0.7,0.1
>> >
>> > I would think that the attack and decay time would total 0.101s,
>> > then the sustain period would last 0.049 (in order to fill out
>> > the overall duration of the note), and then the release period
>> > lasts 0.1.  The length of the whole note would come out to 0.25.
>> > I must be wrong.  Can someone explain how ADSR works?
>> >
>> > Thanks,
>> > Jason
>> > Csound mailing list Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>> > to https://github.com/csound/csound/issues Discussions of bugs
>> > and features can be posted here
>> >
>> > Csound mailing list Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>to
>> > https://github.com/csound/csound/issues Discussions of bugs and
>> > features can be posted here
>> >
>> > Csound mailing list Csound@listserv.heanet.ie
>> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports
>to
>> > https://github.com/csound/csound/issues Discussions of bugs and
>> features can
>> > be posted here
>> >
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
>Csound mailing list
>Csound@listserv.heanet.ie
>https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>Send bugs reports to
>        https://github.com/csound/csound/issues
>Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here