Csound Csound-dev Csound-tekno Search About

why are notes shorter than about 50 ms truncated?

Date2016-04-20 00:28
FromMichael Mossey
Subjectwhy are notes shorter than about 50 ms truncated?
I'm on Windows, writing orchestras that output directly to the dac, taking either MIDI input or i statements. Depending on what output device I select, I'm experiencing truncation of short notes, some of them in the middle of the score. The truncation diminishes with smaller buffer sizes but is still present. Anyone know why this is happening?

I'm using a USB DAC, namely the iFi Nano. When I use csound to list the available devices, I see the iFi listed three times with slightly different descriptions. I may have a solution--the truncation seems to be gone with one of those, but I'm not sure yet. 

Mike

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

Date2016-04-20 06:21
FromFfanci Silvain
SubjectRe: why are notes shorter than about 50 ms truncated?
Hey hey Mike,
I'm not sure myself, but I think I have something. So what's your ksmps or kr in the orchestra header. 50ms is just about 2205 samples at 44.1kHz or the other way round, it will fit 20 times into one second. Could that conflict with your specs? Just an idea, I'm no Csound expert!

Ta-ta
----
Ffanci
* Homepage: https://freeshell.de/~silvain
* Twitter:  http://twitter.com/ffanci_silvain
* GitHub:   https://github.com/fsilvain

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

Date2016-04-20 08:32
FromMichael Mossey
SubjectRe: why are notes shorter than about 50 ms truncated?


On Tue, Apr 19, 2016 at 10:21 PM, Ffanci Silvain <silvain@freeshell.de> wrote:
Hey hey Mike,
I'm not sure myself, but I think I have something. So what's your ksmps or kr in the orchestra header. 50ms is just about 2205 samples at 44.1kHz or the other way round, it will fit 20 times into one second. Could that conflict with your specs? Just an idea, I'm no Csound expert!

Ta-ta

Thanks, but it's not always 50 ms. Some notes shorter than that *aren't* truncated, while some longer than that *are*. And the amount varies. I read the manual for any indication that certain -b, -B, or ksmps values are incompatible, and it looks to me like there are some combinations that allow synchronous running, and sometimes they are necessary, but I don't see any reason that instrument timing or duration should be affected with my setup. There is something going on. I tried a number of combinations of -b and -B. It improves as they get smaller but doesn't disappear (meanwhile I start getting pops when they are too small).

Mike

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

Date2016-04-20 08:42
FromOeyvind Brandtsegg
SubjectRe: why are notes shorter than about 50 ms truncated?
Does it happen with any instrument?
Any difference with the use of different sound generators, filters,
envelopes etc?

2016-04-20 9:32 GMT+02:00 Michael Mossey :
>
>
> On Tue, Apr 19, 2016 at 10:21 PM, Ffanci Silvain 
> wrote:
>>
>> Hey hey Mike,
>> I'm not sure myself, but I think I have something. So what's your ksmps or
>> kr in the orchestra header. 50ms is just about 2205 samples at 44.1kHz or
>> the other way round, it will fit 20 times into one second. Could that
>> conflict with your specs? Just an idea, I'm no Csound expert!
>>
>> Ta-ta
>
>
> Thanks, but it's not always 50 ms. Some notes shorter than that *aren't*
> truncated, while some longer than that *are*. And the amount varies. I read
> the manual for any indication that certain -b, -B, or ksmps values are
> incompatible, and it looks to me like there are some combinations that allow
> synchronous running, and sometimes they are necessary, but I don't see any
> reason that instrument timing or duration should be affected with my setup.
> There is something going on. I tried a number of combinations of -b and -B.
> It improves as they get smaller but doesn't disappear (meanwhile I start
> getting pops when they are too small).
>
> Mike
>
> 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


Date2016-04-20 09:15
FromMichael Mossey
SubjectRe: why are notes shorter than about 50 ms truncated?
It happens with two instruments. The first one is complicated and uses a waveguide and plays portions of table it reads from disk, so just in case it was some of that stuff, I made a simpler instrument that just has an oscili and an envelope, and it was still happening.

Wait! I think I may have left some of the other units in the simpler instrument. Let me try a truly stripped down instrument.

Thanks,
Mike



On Wed, Apr 20, 2016 at 12:42 AM, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:
Does it happen with any instrument?
Any difference with the use of different sound generators, filters,
envelopes etc?

2016-04-20 9:32 GMT+02:00 Michael Mossey <michaelmossey@gmail.com>:
>
>
> On Tue, Apr 19, 2016 at 10:21 PM, Ffanci Silvain <silvain@freeshell.de>
> wrote:
>>
>> Hey hey Mike,
>> I'm not sure myself, but I think I have something. So what's your ksmps or
>> kr in the orchestra header. 50ms is just about 2205 samples at 44.1kHz or
>> the other way round, it will fit 20 times into one second. Could that
>> conflict with your specs? Just an idea, I'm no Csound expert!
>>
>> Ta-ta
>
>
> Thanks, but it's not always 50 ms. Some notes shorter than that *aren't*
> truncated, while some longer than that *are*. And the amount varies. I read
> the manual for any indication that certain -b, -B, or ksmps values are
> incompatible, and it looks to me like there are some combinations that allow
> synchronous running, and sometimes they are necessary, but I don't see any
> reason that instrument timing or duration should be affected with my setup.
> There is something going on. I tried a number of combinations of -b and -B.
> It improves as they get smaller but doesn't disappear (meanwhile I start
> getting pops when they are too small).
>
> Mike
>
> 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



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-04-20 09:54
FromMichael Mossey
SubjectRe: why are notes shorter than about 50 ms truncated?
Aha! Thanks for the suggestion to play around with my score and orchestra.

I am using an f table with GEN01 with a fixed size rather than a deferred size, to load a wav file a few minutes long. My instrument picks a portion of the table to play back at the sample rate, at run time. 

I was using a fixed size because I wanted to access the table with oscillators. I figured, why not make the table length the next power of two greater than the wav file length.

Well that causes the problem. After trying a number of table sizes, it appears that the problem appears if the table has more points that are given in the wav. This is true even if my instrument doesn't access the table! The problem is absent if I give few enough points as a fixed size or if I use a deferred size (0).

Does this make sense? Is there a workaround? The design goal is to avoid a deferred size, because to my knowledge the only oscillator that can be used is foscili, and I need features of oscili or tablei. Maybe I'm wrong about that. 

I do not have much flexibility on the wav length, so if I use a power of two size, it can't be smaller than the wav length. However, I could always add some silence at the end of the wav to bring it up to the table length.

Mike



On Wed, Apr 20, 2016 at 1:15 AM, Michael Mossey <michaelmossey@gmail.com> wrote:
It happens with two instruments. The first one is complicated and uses a waveguide and plays portions of table it reads from disk, so just in case it was some of that stuff, I made a simpler instrument that just has an oscili and an envelope, and it was still happening.

Wait! I think I may have left some of the other units in the simpler instrument. Let me try a truly stripped down instrument.

Thanks,
Mike



On Wed, Apr 20, 2016 at 12:42 AM, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:
Does it happen with any instrument?
Any difference with the use of different sound generators, filters,
envelopes etc?

2016-04-20 9:32 GMT+02:00 Michael Mossey <michaelmossey@gmail.com>:
>
>
> On Tue, Apr 19, 2016 at 10:21 PM, Ffanci Silvain <silvain@freeshell.de>
> wrote:
>>
>> Hey hey Mike,
>> I'm not sure myself, but I think I have something. So what's your ksmps or
>> kr in the orchestra header. 50ms is just about 2205 samples at 44.1kHz or
>> the other way round, it will fit 20 times into one second. Could that
>> conflict with your specs? Just an idea, I'm no Csound expert!
>>
>> Ta-ta
>
>
> Thanks, but it's not always 50 ms. Some notes shorter than that *aren't*
> truncated, while some longer than that *are*. And the amount varies. I read
> the manual for any indication that certain -b, -B, or ksmps values are
> incompatible, and it looks to me like there are some combinations that allow
> synchronous running, and sometimes they are necessary, but I don't see any
> reason that instrument timing or duration should be affected with my setup.
> There is something going on. I tried a number of combinations of -b and -B.
> It improves as they get smaller but doesn't disappear (meanwhile I start
> getting pops when they are too small).
>
> Mike
>
> 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



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-04-20 10:05
FromOeyvind Brandtsegg
SubjectRe: why are notes shorter than about 50 ms truncated?
Hm, do you have a stripped down example instr demonstrating the
behaviour? I don't quite understand why this should lead to dropped
notes (only) if the duration is very short.

2016-04-20 10:54 GMT+02:00 Michael Mossey :
> Aha! Thanks for the suggestion to play around with my score and orchestra.
>
> I am using an f table with GEN01 with a fixed size rather than a deferred
> size, to load a wav file a few minutes long. My instrument picks a portion
> of the table to play back at the sample rate, at run time.
>
> I was using a fixed size because I wanted to access the table with
> oscillators. I figured, why not make the table length the next power of two
> greater than the wav file length.
>
> Well that causes the problem. After trying a number of table sizes, it
> appears that the problem appears if the table has more points that are given
> in the wav. This is true even if my instrument doesn't access the table! The
> problem is absent if I give few enough points as a fixed size or if I use a
> deferred size (0).
>
> Does this make sense? Is there a workaround? The design goal is to avoid a
> deferred size, because to my knowledge the only oscillator that can be used
> is foscili, and I need features of oscili or tablei. Maybe I'm wrong about
> that.
>
> I do not have much flexibility on the wav length, so if I use a power of two
> size, it can't be smaller than the wav length. However, I could always add
> some silence at the end of the wav to bring it up to the table length.
>
> Mike
>
>
>
> On Wed, Apr 20, 2016 at 1:15 AM, Michael Mossey 
> wrote:
>>
>> It happens with two instruments. The first one is complicated and uses a
>> waveguide and plays portions of table it reads from disk, so just in case it
>> was some of that stuff, I made a simpler instrument that just has an oscili
>> and an envelope, and it was still happening.
>>
>> Wait! I think I may have left some of the other units in the simpler
>> instrument. Let me try a truly stripped down instrument.
>>
>> Thanks,
>> Mike
>>
>>
>>
>> On Wed, Apr 20, 2016 at 12:42 AM, Oeyvind Brandtsegg
>>  wrote:
>>>
>>> Does it happen with any instrument?
>>> Any difference with the use of different sound generators, filters,
>>> envelopes etc?
>>>
>>> 2016-04-20 9:32 GMT+02:00 Michael Mossey :
>>> >
>>> >
>>> > On Tue, Apr 19, 2016 at 10:21 PM, Ffanci Silvain 
>>> > wrote:
>>> >>
>>> >> Hey hey Mike,
>>> >> I'm not sure myself, but I think I have something. So what's your
>>> >> ksmps or
>>> >> kr in the orchestra header. 50ms is just about 2205 samples at 44.1kHz
>>> >> or
>>> >> the other way round, it will fit 20 times into one second. Could that
>>> >> conflict with your specs? Just an idea, I'm no Csound expert!
>>> >>
>>> >> Ta-ta
>>> >
>>> >
>>> > Thanks, but it's not always 50 ms. Some notes shorter than that
>>> > *aren't*
>>> > truncated, while some longer than that *are*. And the amount varies. I
>>> > read
>>> > the manual for any indication that certain -b, -B, or ksmps values are
>>> > incompatible, and it looks to me like there are some combinations that
>>> > allow
>>> > synchronous running, and sometimes they are necessary, but I don't see
>>> > any
>>> > reason that instrument timing or duration should be affected with my
>>> > setup.
>>> > There is something going on. I tried a number of combinations of -b and
>>> > -B.
>>> > It improves as they get smaller but doesn't disappear (meanwhile I
>>> > start
>>> > getting pops when they are too small).
>>> >
>>> > Mike
>>> >
>>> > 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
>>>
>>>
>>>
>>> --
>>>
>>> Oeyvind Brandtsegg
>>> Professor of Music Technology
>>> NTNU
>>> 7491 Trondheim
>>> Norway
>>> Cell: +47 92 203 205
>>>
>>> http://www.partikkelaudio.com/
>>> http://soundcloud.com/brandtsegg
>>> http://flyndresang.no/
>>> http://soundcloud.com/t-emp
>>>
>>> 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


Date2016-04-21 01:51
FromMichael Mossey
SubjectRe: why are notes shorter than about 50 ms truncated?
I found it's related to a specific UDO. I will start a new thread for this because I have other questions about this UDO, Victor Lazzarini's waveguide model, and it might be of general interest.

Mike




On Wed, Apr 20, 2016 at 2:05 AM, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:
Hm, do you have a stripped down example instr demonstrating the
behaviour? I don't quite understand why this should lead to dropped
notes (only) if the duration is very short.

2016-04-20 10:54 GMT+02:00 Michael Mossey <michaelmossey@gmail.com>:
> Aha! Thanks for the suggestion to play around with my score and orchestra.
>
> I am using an f table with GEN01 with a fixed size rather than a deferred
> size, to load a wav file a few minutes long. My instrument picks a portion
> of the table to play back at the sample rate, at run time.
>
> I was using a fixed size because I wanted to access the table with
> oscillators. I figured, why not make the table length the next power of two
> greater than the wav file length.
>
> Well that causes the problem. After trying a number of table sizes, it
> appears that the problem appears if the table has more points that are given
> in the wav. This is true even if my instrument doesn't access the table! The
> problem is absent if I give few enough points as a fixed size or if I use a
> deferred size (0).
>
> Does this make sense? Is there a workaround? The design goal is to avoid a
> deferred size, because to my knowledge the only oscillator that can be used
> is foscili, and I need features of oscili or tablei. Maybe I'm wrong about
> that.
>
> I do not have much flexibility on the wav length, so if I use a power of two
> size, it can't be smaller than the wav length. However, I could always add
> some silence at the end of the wav to bring it up to the table length.
>
> Mike
>
>
>
> On Wed, Apr 20, 2016 at 1:15 AM, Michael Mossey <michaelmossey@gmail.com>
> wrote:
>>
>> It happens with two instruments. The first one is complicated and uses a
>> waveguide and plays portions of table it reads from disk, so just in case it
>> was some of that stuff, I made a simpler instrument that just has an oscili
>> and an envelope, and it was still happening.
>>
>> Wait! I think I may have left some of the other units in the simpler
>> instrument. Let me try a truly stripped down instrument.
>>
>> Thanks,
>> Mike
>>
>>
>>
>> On Wed, Apr 20, 2016 at 12:42 AM, Oeyvind Brandtsegg
>> <oyvind.brandtsegg@ntnu.no> wrote:
>>>
>>> Does it happen with any instrument?
>>> Any difference with the use of different sound generators, filters,
>>> envelopes etc?
>>>
>>> 2016-04-20 9:32 GMT+02:00 Michael Mossey <michaelmossey@gmail.com>:
>>> >
>>> >
>>> > On Tue, Apr 19, 2016 at 10:21 PM, Ffanci Silvain <silvain@freeshell.de>
>>> > wrote:
>>> >>
>>> >> Hey hey Mike,
>>> >> I'm not sure myself, but I think I have something. So what's your
>>> >> ksmps or
>>> >> kr in the orchestra header. 50ms is just about 2205 samples at 44.1kHz
>>> >> or
>>> >> the other way round, it will fit 20 times into one second. Could that
>>> >> conflict with your specs? Just an idea, I'm no Csound expert!
>>> >>
>>> >> Ta-ta
>>> >
>>> >
>>> > Thanks, but it's not always 50 ms. Some notes shorter than that
>>> > *aren't*
>>> > truncated, while some longer than that *are*. And the amount varies. I
>>> > read
>>> > the manual for any indication that certain -b, -B, or ksmps values are
>>> > incompatible, and it looks to me like there are some combinations that
>>> > allow
>>> > synchronous running, and sometimes they are necessary, but I don't see
>>> > any
>>> > reason that instrument timing or duration should be affected with my
>>> > setup.
>>> > There is something going on. I tried a number of combinations of -b and
>>> > -B.
>>> > It improves as they get smaller but doesn't disappear (meanwhile I
>>> > start
>>> > getting pops when they are too small).
>>> >
>>> > Mike
>>> >
>>> > 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
>>>
>>>
>>>
>>> --
>>>
>>> Oeyvind Brandtsegg
>>> Professor of Music Technology
>>> NTNU
>>> 7491 Trondheim
>>> Norway
>>> Cell: +47 92 203 205
>>>
>>> http://www.partikkelaudio.com/
>>> http://soundcloud.com/brandtsegg
>>> http://flyndresang.no/
>>> http://soundcloud.com/t-emp
>>>
>>> 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



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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