[Csnd-dev] Warning: major change

classic Classic list List threaded Threaded
28 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[Csnd-dev] Warning: major change

jpff
I have just committed code that changes spout to be non-interleaved, and
only changed to interleaved in kperf.  Means values in GetSpout are
only updated in kperf but otherwise should perform the same, but
quicker.  Basic testing but not all sample-accurate cases have been
checked.  Please report any oddities to me or this list.

I testing I found a bug in score r opcode which I will start work o
asap.

==John ffitch
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Warning: major change

moguillansky
Works here. On my own tests, now using out or outch has a similar impact as
accumulating on a global var.

Thanks!

On Sonntag, 5. Februar 2017 21:42:51 CET, jpff wrote:

> I have just committed code that changes spout to be non-interleaved, and
> only changed to interleaved in kperf.  Means values in GetSpout are
> only updated in kperf but otherwise should perform the same, but
> quicker.  Basic testing but not all sample-accurate cases have been
> checked.  Please report any oddities to me or this list.
>
> I testing I found a bug in score r opcode which I will start work o
> asap.
>
> ==John ffitch
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Warning: major change

Victor Lazzarini
which leaves us to entertain why it’s still twice the load compared to SC. Do you know if
the SC engine optimises something, like not actually summing audio into the output if it is silence?
It would be good to see if you could send a constant value to the output to (like 0.5) to see if it
performs the same.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 6 Feb 2017, at 10:07, Eduardo Moguillansky <[hidden email]> wrote:
>
> Works here. On my own tests, now using out or outch has a similar impact as accumulating on a global var.
>
> Thanks!
>
> On Sonntag, 5. Februar 2017 21:42:51 CET, jpff wrote:
>> I have just committed code that changes spout to be non-interleaved, and
>> only changed to interleaved in kperf.  Means values in GetSpout are
>> only updated in kperf but otherwise should perform the same, but
>> quicker.  Basic testing but not all sample-accurate cases have been
>> checked.  Please report any oddities to me or this list.
>>
>> I testing I found a bug in score r opcode which I will start work o
>> asap.
>>
>> ==John ffitch
>>
>>

Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Warning: major change

moguillansky
The only thing I could see on the opcode level (I don't have so much
experience with the inner workings of scsynth) is that they optimize the
loops to not use indexing but pointers directly

This is their "Out" opcode

for (int i=0; i<numChannels; ++i, out++) {
  if (firstOutputChannel + i < maxChannel) {
    float *in = IN(i+1);
    ACQUIRE_BUS_CONTROL((int32)fbusChannel + i);
    if (touched[i] == bufCounter)
      *out += *in;
    else {
      *out = *in;
      touched[i] = bufCounter;
    }
    RELEASE_BUS_CONTROL((int32)fbusChannel + i);
  }
}

On Montag, 6. Februar 2017 14:59:53 CET, Victor Lazzarini wrote:

> which leaves us to entertain why it’s still twice the load
> compared to SC. Do you know if
> the SC engine optimises something, like not actually summing
> audio into the output if it is silence?
> It would be good to see if you could send a constant value to
> the output to (like 0.5) to see if it
> performs the same.
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 6 Feb 2017, at 10:07, Eduardo Moguillansky
>> <[hidden email]> wrote:
>>
>> Works here. On my own tests, now using out or outch has a
>> similar impact as accumulating on a global var.
>>
>> Thanks!
>>
>> On Sonntag, 5. Februar 2017 21:42:51 CET, jpff wrote: ...
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Warning: major change

Steven Yi
One thing to point is out that they are using floats and not doubles.
I don't know if that would have a positive or negative effect, but we
should be careful to compares apples to apples when measuring
performance here.

On Mon, Feb 6, 2017 at 10:03 AM, Eduardo Moguillansky
<[hidden email]> wrote:

> The only thing I could see on the opcode level (I don't have so much
> experience with the inner workings of scsynth) is that they optimize the
> loops to not use indexing but pointers directly
>
> This is their "Out" opcode
>
> for (int i=0; i<numChannels; ++i, out++) {
>  if (firstOutputChannel + i < maxChannel) {
>    float *in = IN(i+1);
>    ACQUIRE_BUS_CONTROL((int32)fbusChannel + i);
>    if (touched[i] == bufCounter)
>      *out += *in;
>    else {
>      *out = *in;
>      touched[i] = bufCounter;
>    }
>    RELEASE_BUS_CONTROL((int32)fbusChannel + i);
>  }
> }
> On Montag, 6. Februar 2017 14:59:53 CET, Victor Lazzarini wrote:
>>
>> which leaves us to entertain why it’s still twice the load compared to SC.
>> Do you know if
>> the SC engine optimises something, like not actually summing audio into
>> the output if it is silence?
>> It would be good to see if you could send a constant value to the output
>> to (like 0.5) to see if it
>> performs the same.
>> ========================
>> Prof. Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>>
>>> On 6 Feb 2017, at 10:07, Eduardo Moguillansky
>>> <[hidden email]> wrote:
>>>
>>> Works here. On my own tests, now using out or outch has a similar impact
>>> as accumulating on a global var.
>>>
>>> Thanks!
>>>
>>> On Sonntag, 5. Februar 2017 21:42:51 CET, jpff wrote: ...
>>
>>
>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Warning: major change

Victor Lazzarini
In reply to this post by moguillansky
I don’t think pointer arithmetic makes it faster. Running single precision probably does in this case.
But does it really use floats? I never realised that.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 6 Feb 2017, at 15:03, Eduardo Moguillansky <[hidden email]> wrote:
>
> The only thing I could see on the opcode level (I don't have so much experience with the inner workings of scsynth) is that they optimize the loops to not use indexing but pointers directly
>
> This is their "Out" opcode
>
> for (int i=0; i<numChannels; ++i, out++) {
> if (firstOutputChannel + i < maxChannel) {
>  float *in = IN(i+1);
>  ACQUIRE_BUS_CONTROL((int32)fbusChannel + i);
>  if (touched[i] == bufCounter)
>    *out += *in;
>  else {
>    *out = *in;
>    touched[i] = bufCounter;
>  }
>  RELEASE_BUS_CONTROL((int32)fbusChannel + i);
> }
> }
> On Montag, 6. Februar 2017 14:59:53 CET, Victor Lazzarini wrote:
>> which leaves us to entertain why it’s still twice the load compared to SC. Do you know if
>> the SC engine optimises something, like not actually summing audio into the output if it is silence?
>> It would be good to see if you could send a constant value to the output to (like 0.5) to see if it
>> performs the same.
>> ========================
>> Prof. Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>> On 6 Feb 2017, at 10:07, Eduardo Moguillansky <[hidden email]> wrote:
>>> Works here. On my own tests, now using out or outch has a similar impact as accumulating on a global var.
>>> Thanks!
>>> On Sonntag, 5. Februar 2017 21:42:51 CET, jpff wrote: ...
>>
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Warning: major change

Michael Gogins-2
Pointer arithmetic, whenever I have compared it directly in timed controlled experiments, never has been faster than array indexing, and often has been a little slower. Plus it is harder to read. 

Gcc and other compilers are written to take simple, standard style code and make it run as fast as possible. 

Best, 
Mike

On Feb 6, 2017 10:42 AM, "Victor Lazzarini" <[hidden email]> wrote:
I don’t think pointer arithmetic makes it faster. Running single precision probably does in this case.
But does it really use floats? I never realised that.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 6 Feb 2017, at 15:03, Eduardo Moguillansky <[hidden email]> wrote:
>
> The only thing I could see on the opcode level (I don't have so much experience with the inner workings of scsynth) is that they optimize the loops to not use indexing but pointers directly
>
> This is their "Out" opcode
>
> for (int i=0; i<numChannels; ++i, out++) {
> if (firstOutputChannel + i < maxChannel) {
>  float *in = IN(i+1);
>  ACQUIRE_BUS_CONTROL((int32)fbusChannel + i);
>  if (touched[i] == bufCounter)
>    *out += *in;
>  else {
>    *out = *in;
>    touched[i] = bufCounter;
>  }
>  RELEASE_BUS_CONTROL((int32)fbusChannel + i);
> }
> }
> On Montag, 6. Februar 2017 14:59:53 CET, Victor Lazzarini wrote:
>> which leaves us to entertain why it’s still twice the load compared to SC. Do you know if
>> the SC engine optimises something, like not actually summing audio into the output if it is silence?
>> It would be good to see if you could send a constant value to the output to (like 0.5) to see if it
>> performs the same.
>> ========================
>> Prof. Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>> On 6 Feb 2017, at 10:07, Eduardo Moguillansky <[hidden email]> wrote:
>>> Works here. On my own tests, now using out or outch has a similar impact as accumulating on a global var.
>>> Thanks!
>>> On Sonntag, 5. Februar 2017 21:42:51 CET, jpff wrote: ...
>>
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Warning: major change

jpff
In reply to this post by moguillansky
When I easured tis it was slower to use pointers tan indexing, which is
why it was mostly changed.
==JPff

On Mon, 6 Feb 2017, Eduardo Moguillansky wrote:

> thing I could see on the opcode level (I don't have so much experience with
> the inner workings of scsynth) is that they optimize the loops to not use
> indexing but pointers directly
>
> This is their "Out" opcode
>
> for (int i=0; i<numChannels; ++i, out++) {
> if (firstOutputChannel + i < maxChannel) {
>   float *in = IN(i+1);
>   ACQUIRE_BUS_CONTROL((int32)fbusChannel + i);
>   if (touched[i] == bufCounter)
>     *out += *in;
>   else {
>     *out = *in;
>     touched[i] = bufCounter;
>   }
>   RELEASE_BUS_CONTROL((int32)fbusChannel + i);
> }
> }
> On Montag, 6. Februar 2017 14:59:53 CET, Victor Lazzarini wrote:
>> which leaves us to entertain why it’s still twice the load compared to SC.
>> Do you know if
>> the SC engine optimises something, like not actually summing audio into the
>> output if it is silence?
>> It would be good to see if you could send a constant value to the output to
>> (like 0.5) to see if it
>> performs the same.
>> ========================
>> Prof. Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>> On 6 Feb 2017, at 10:07, Eduardo Moguillansky
>>> <[hidden email]> wrote:
>>>
>>> Works here. On my own tests, now using out or outch has a similar impact
>>> as accumulating on a global var.
>>>
>>> Thanks!
>>>
>>> On Sonntag, 5. Februar 2017 21:42:51 CET, jpff wrote: ...
>>
>>
>>
>
> From ema
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Warning: major change

Michael Gogins-2
Measuring is great!

Thanks,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Mon, Feb 6, 2017 at 11:37 AM, jpff <[hidden email]> wrote:

> When I easured tis it was slower to use pointers tan indexing, which is why
> it was mostly changed.
> ==JPff
>
>
> On Mon, 6 Feb 2017, Eduardo Moguillansky wrote:
>
>> thing I could see on the opcode level (I don't have so much experience
>> with the inner workings of scsynth) is that they optimize the loops to not
>> use indexing but pointers directly
>>
>> This is their "Out" opcode
>>
>> for (int i=0; i<numChannels; ++i, out++) {
>> if (firstOutputChannel + i < maxChannel) {
>>   float *in = IN(i+1);
>>   ACQUIRE_BUS_CONTROL((int32)fbusChannel + i);
>>   if (touched[i] == bufCounter)
>>     *out += *in;
>>   else {
>>     *out = *in;
>>     touched[i] = bufCounter;
>>   }
>>   RELEASE_BUS_CONTROL((int32)fbusChannel + i);
>> }
>> } On Montag, 6. Februar 2017 14:59:53 CET, Victor Lazzarini wrote:
>>>
>>> which leaves us to entertain why it’s still twice the load compared to
>>> SC. Do you know if
>>> the SC engine optimises something, like not actually summing audio into
>>> the output if it is silence?
>>> It would be good to see if you could send a constant value to the output
>>> to (like 0.5) to see if it
>>> performs the same.
>>> ========================
>>> Prof. Victor Lazzarini
>>> Dean of Arts, Celtic Studies, and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>>>
>>>> On 6 Feb 2017, at 10:07, Eduardo Moguillansky
>>>> <[hidden email]> wrote:
>>>>
>>>> Works here. On my own tests, now using out or outch has a similar impact
>>>> as accumulating on a global var.
>>>>
>>>> Thanks!
>>>>
>>>> On Sonntag, 5. Februar 2017 21:42:51 CET, jpff wrote: ...
>>>
>>>
>>>
>>>
>>
>> From ema
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Warning: major change

jpff
In reply to this post by Victor Lazzarini
On my laptop the test prgram in realtime takes 21% doubles and 12% single
precision

On Mon, 6 Feb 2017, Victor Lazzarini wrote:

> which leaves us to entertain why it’s still twice the load compared to SC. Do you know if
> the SC engine optimises something, like not actually summing audio into the output if it is silence?
> It would be good to see if you could send a constant value to the output to (like 0.5) to see if it
> performs the same.
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 6 Feb 2017, at 10:07, Eduardo Moguillansky <[hidden email]> wrote:
>>
>> Works here. On my own tests, now using out or outch has a similar impact as accumulating on a global var.
>>
>> Thanks!
>>
>> On Sonntag, 5. Februar 2017 21:42:51 CET, jpff wrote:
>>> I have just committed code that changes spout to be non-interleaved, and
>>> only changed to interleaved in kperf.  Means values in GetSpout are
>>> only updated in kperf but otherwise should perform the same, but
>>> quicker.  Basic testing but not all sample-accurate cases have been
>>> checked.  Please report any oddities to me or this list.
>>>
>>> I testing I found a bug in score r opcode which I will start work o
>>> asap.
>>>
>>> ==John ffitch
>>>
>>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Warning: major change

Steven Yi
In reply to this post by Victor Lazzarini
Yes, SC3 uses floats for the signal processing chain, but a number of
the UGens use doubles internally to track certain things like phase. I
haven't looked at SC3's code in a while though, but that was the state
of things last I checked.

On Mon, Feb 6, 2017 at 10:42 AM, Victor Lazzarini
<[hidden email]> wrote:

> I don’t think pointer arithmetic makes it faster. Running single precision probably does in this case.
> But does it really use floats? I never realised that.
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 6 Feb 2017, at 15:03, Eduardo Moguillansky <[hidden email]> wrote:
>>
>> The only thing I could see on the opcode level (I don't have so much experience with the inner workings of scsynth) is that they optimize the loops to not use indexing but pointers directly
>>
>> This is their "Out" opcode
>>
>> for (int i=0; i<numChannels; ++i, out++) {
>> if (firstOutputChannel + i < maxChannel) {
>>  float *in = IN(i+1);
>>  ACQUIRE_BUS_CONTROL((int32)fbusChannel + i);
>>  if (touched[i] == bufCounter)
>>    *out += *in;
>>  else {
>>    *out = *in;
>>    touched[i] = bufCounter;
>>  }
>>  RELEASE_BUS_CONTROL((int32)fbusChannel + i);
>> }
>> }
>> On Montag, 6. Februar 2017 14:59:53 CET, Victor Lazzarini wrote:
>>> which leaves us to entertain why it’s still twice the load compared to SC. Do you know if
>>> the SC engine optimises something, like not actually summing audio into the output if it is silence?
>>> It would be good to see if you could send a constant value to the output to (like 0.5) to see if it
>>> performs the same.
>>> ========================
>>> Prof. Victor Lazzarini
>>> Dean of Arts, Celtic Studies, and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>>> On 6 Feb 2017, at 10:07, Eduardo Moguillansky <[hidden email]> wrote:
>>>> Works here. On my own tests, now using out or outch has a similar impact as accumulating on a global var.
>>>> Thanks!
>>>> On Sonntag, 5. Februar 2017 21:42:51 CET, jpff wrote: ...
>>>
>>>
>>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Warning: major change

Victor Lazzarini
Well, doubles for phase and filter coeffs are sine qua non.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

> On 6 Feb 2017, at 18:33, Steven Yi <[hidden email]> wrote:
>
> Yes, SC3 uses floats for the signal processing chain, but a number of
> the UGens use doubles internally to track certain things like phase. I
> haven't looked at SC3's code in a while though, but that was the state
> of things last I checked.
>
> On Mon, Feb 6, 2017 at 10:42 AM, Victor Lazzarini
> <[hidden email]> wrote:
>> I don’t think pointer arithmetic makes it faster. Running single precision probably does in this case.
>> But does it really use floats? I never realised that.
>> ========================
>> Prof. Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>
>>> On 6 Feb 2017, at 15:03, Eduardo Moguillansky <[hidden email]> wrote:
>>>
>>> The only thing I could see on the opcode level (I don't have so much experience with the inner workings of scsynth) is that they optimize the loops to not use indexing but pointers directly
>>>
>>> This is their "Out" opcode
>>>
>>> for (int i=0; i<numChannels; ++i, out++) {
>>> if (firstOutputChannel + i < maxChannel) {
>>> float *in = IN(i+1);
>>> ACQUIRE_BUS_CONTROL((int32)fbusChannel + i);
>>> if (touched[i] == bufCounter)
>>>   *out += *in;
>>> else {
>>>   *out = *in;
>>>   touched[i] = bufCounter;
>>> }
>>> RELEASE_BUS_CONTROL((int32)fbusChannel + i);
>>> }
>>> }
>>>> On Montag, 6. Februar 2017 14:59:53 CET, Victor Lazzarini wrote:
>>>> which leaves us to entertain why it’s still twice the load compared to SC. Do you know if
>>>> the SC engine optimises something, like not actually summing audio into the output if it is silence?
>>>> It would be good to see if you could send a constant value to the output to (like 0.5) to see if it
>>>> performs the same.
>>>> ========================
>>>> Prof. Victor Lazzarini
>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>> Maynooth University,
>>>> Maynooth, Co Kildare, Ireland
>>>> Tel: 00 353 7086936
>>>> Fax: 00 353 1 7086952
>>>>> On 6 Feb 2017, at 10:07, Eduardo Moguillansky <[hidden email]> wrote:
>>>>> Works here. On my own tests, now using out or outch has a similar impact as accumulating on a global var.
>>>>> Thanks!
>>>>> On Sonntag, 5. Februar 2017 21:42:51 CET, jpff wrote: ...
>>>>
>>>>
>>>>
>>>
>>
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Warning: major change

Victor Lazzarini
In reply to this post by jpff
12% looks like what has been reported.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

> On 6 Feb 2017, at 17:38, jpff <[hidden email]> wrote:
>
> On my laptop the test prgram in realtime takes 21% doubles and 12% single precision
>
> On Mon, 6 Feb 2017, Victor Lazzarini wrote:
>
>> which leaves us to entertain why it’s still twice the load compared to SC. Do you know if
>> the SC engine optimises something, like not actually summing audio into the output if it is silence?
>> It would be good to see if you could send a constant value to the output to (like 0.5) to see if it
>> performs the same.
>> ========================
>> Prof. Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>
>>> On 6 Feb 2017, at 10:07, Eduardo Moguillansky <[hidden email]> wrote:
>>>
>>> Works here. On my own tests, now using out or outch has a similar impact as accumulating on a global var.
>>>
>>> Thanks!
>>>
>>>> On Sonntag, 5. Februar 2017 21:42:51 CET, jpff wrote:
>>>> I have just committed code that changes spout to be non-interleaved, and
>>>> only changed to interleaved in kperf.  Means values in GetSpout are
>>>> only updated in kperf but otherwise should perform the same, but
>>>> quicker.  Basic testing but not all sample-accurate cases have been
>>>> checked.  Please report any oddities to me or this list.
>>>>
>>>> I testing I found a bug in score r opcode which I will start work o
>>>> asap.
>>>>
>>>> ==John ffitch
>>>>
>>>>
>>
T M
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Warning: major change

T M
In reply to this post by Steven Yi
> El 6 feb 2017, a las 12:32, Steven Yi <[hidden email]> escribió:
>
> Yes, SC3 uses floats for the signal processing chain, but a number of
> the UGens use doubles internally to track certain things like phase. I
> haven't looked at SC3's code in a while though, but that was the state
> of things last I checked.
>

Yes, this is still the state of things in SC. Another reason for a performance difference might be that SC uses Single Instruction, Multiple Data (simd) CPU instructions. Maybe CSound does too.

Tom


> On Mon, Feb 6, 2017 at 10:42 AM, Victor Lazzarini
> <[hidden email]> wrote:
>> I don’t think pointer arithmetic makes it faster. Running single precision probably does in this case.
>> But does it really use floats? I never realised that.
>> ========================
>> Prof. Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>
>>> On 6 Feb 2017, at 15:03, Eduardo Moguillansky <[hidden email]> wrote:
>>>
>>> The only thing I could see on the opcode level (I don't have so much experience with the inner workings of scsynth) is that they optimize the loops to not use indexing but pointers directly
>>>
>>> This is their "Out" opcode
>>>
>>> for (int i=0; i<numChannels; ++i, out++) {
>>> if (firstOutputChannel + i < maxChannel) {
>>> float *in = IN(i+1);
>>> ACQUIRE_BUS_CONTROL((int32)fbusChannel + i);
>>> if (touched[i] == bufCounter)
>>>   *out += *in;
>>> else {
>>>   *out = *in;
>>>   touched[i] = bufCounter;
>>> }
>>> RELEASE_BUS_CONTROL((int32)fbusChannel + i);
>>> }
>>> }
>>>> On Montag, 6. Februar 2017 14:59:53 CET, Victor Lazzarini wrote:
>>>> which leaves us to entertain why it’s still twice the load compared to SC. Do you know if
>>>> the SC engine optimises something, like not actually summing audio into the output if it is silence?
>>>> It would be good to see if you could send a constant value to the output to (like 0.5) to see if it
>>>> performs the same.
>>>> ========================
>>>> Prof. Victor Lazzarini
>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>> Maynooth University,
>>>> Maynooth, Co Kildare, Ireland
>>>> Tel: 00 353 7086936
>>>> Fax: 00 353 1 7086952
>>>>> On 6 Feb 2017, at 10:07, Eduardo Moguillansky <[hidden email]> wrote:
>>>>> Works here. On my own tests, now using out or outch has a similar impact as accumulating on a global var.
>>>>> Thanks!
>>>>> On Sonntag, 5. Februar 2017 21:42:51 CET, jpff wrote: ...
>>
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Warning: major change

Michael Gogins-2
It depends on the build configuration. I will look at that on Linux. On Windows it does use SIMD, I think I build for -march=nocona.

Regards,
Mike

On Feb 6, 2017 9:40 PM, "T M" <[hidden email]> wrote:
> El 6 feb 2017, a las 12:32, Steven Yi <[hidden email]> escribió:
>
> Yes, SC3 uses floats for the signal processing chain, but a number of
> the UGens use doubles internally to track certain things like phase. I
> haven't looked at SC3's code in a while though, but that was the state
> of things last I checked.
>

Yes, this is still the state of things in SC. Another reason for a performance difference might be that SC uses Single Instruction, Multiple Data (simd) CPU instructions. Maybe CSound does too.

Tom


> On Mon, Feb 6, 2017 at 10:42 AM, Victor Lazzarini
> <[hidden email]> wrote:
>> I don’t think pointer arithmetic makes it faster. Running single precision probably does in this case.
>> But does it really use floats? I never realised that.
>> ========================
>> Prof. Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>
>>> On 6 Feb 2017, at 15:03, Eduardo Moguillansky <[hidden email]> wrote:
>>>
>>> The only thing I could see on the opcode level (I don't have so much experience with the inner workings of scsynth) is that they optimize the loops to not use indexing but pointers directly
>>>
>>> This is their "Out" opcode
>>>
>>> for (int i=0; i<numChannels; ++i, out++) {
>>> if (firstOutputChannel + i < maxChannel) {
>>> float *in = IN(i+1);
>>> ACQUIRE_BUS_CONTROL((int32)fbusChannel + i);
>>> if (touched[i] == bufCounter)
>>>   *out += *in;
>>> else {
>>>   *out = *in;
>>>   touched[i] = bufCounter;
>>> }
>>> RELEASE_BUS_CONTROL((int32)fbusChannel + i);
>>> }
>>> }
>>>> On Montag, 6. Februar 2017 14:59:53 CET, Victor Lazzarini wrote:
>>>> which leaves us to entertain why it’s still twice the load compared to SC. Do you know if
>>>> the SC engine optimises something, like not actually summing audio into the output if it is silence?
>>>> It would be good to see if you could send a constant value to the output to (like 0.5) to see if it
>>>> performs the same.
>>>> ========================
>>>> Prof. Victor Lazzarini
>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>> Maynooth University,
>>>> Maynooth, Co Kildare, Ireland
>>>> Tel: 00 353 7086936
>>>> Fax: 00 353 1 7086952
>>>>> On 6 Feb 2017, at 10:07, Eduardo Moguillansky <[hidden email]> wrote:
>>>>> Works here. On my own tests, now using out or outch has a similar impact as accumulating on a global var.
>>>>> Thanks!
>>>>> On Sonntag, 5. Februar 2017 21:42:51 CET, jpff wrote: ...
>>
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Warning: major change

moguillansky
In reply to this post by jpff

I did not check the output, only the performance: I get corrupted data with outch.  Did not test the other out opcodes

<CsoundSynthesizer>
<CsOptions>
</CsOptions
<CsInstruments>
sr = 44100
ksmps = 128
nchnls = 2
0dbfs = 1.0
instr 1
  ifreq = 440
  a0 oscili 0.5, ifreq
  outch 1, a0
  ; ** uncomment next line and output gets corrupted **
  ; outch 2, a0
endin
</CsInstruments>
<CsScore>
i 1 0 20
</CsScore>
</CsoundSynthesizer>




On 06.02.2017 18:38, jpff wrote:
On my laptop the test prgram in realtime takes 21% doubles and 12% single precision

On Mon, 6 Feb 2017, Victor Lazzarini wrote:

which leaves us to entertain why it’s still twice the load compared to SC. Do you know if
the SC engine optimises something, like not actually summing audio into the output if it is silence?
It would be good to see if you could send a constant value to the output to (like 0.5) to see if it
performs the same.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

On 6 Feb 2017, at 10:07, Eduardo Moguillansky [hidden email] wrote:

Works here. On my own tests, now using out or outch has a similar impact as accumulating on a global var.

Thanks!

On Sonntag, 5. Februar 2017 21:42:51 CET, jpff wrote:
I have just committed code that changes spout to be non-interleaved, and
only changed to interleaved in kperf.  Means values in GetSpout are
only updated in kperf but otherwise should perform the same, but
quicker.  Basic testing but not all sample-accurate cases have been
checked.  Please report any oddities to me or this list.

I testing I found a bug in score r opcode which I will start work o
asap.

==John ffitch





Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Warning: major change

Victor Lazzarini
out and outs are working fine.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 7 Feb 2017, at 16:45, Eduardo Moguillansky <[hidden email]> wrote:
>
> I did not check the output, only the performance: I get corrupted data with outch.  Did not test the other out opcodes
>
> <CsoundSynthesizer>
> <CsOptions>
> </CsOptions
> <CsInstruments>
>
> sr = 44100
> ksmps = 128
> nchnls = 2
> 0dbfs = 1.0
>
> instr 1
>   ifreq = 440
>   a0 oscili 0.5, ifreq
>   outch 1, a0
>   ; ** uncomment next line and output gets corrupted **
>   ; outch 2, a0
>
> endin
> </CsInstruments>
> <CsScore>
>
> i 1 0 20
> </CsScore>
> </CsoundSynthesizer>
>
>
>
>
> On 06.02.2017 18:38, jpff wrote:
>> On my laptop the test prgram in realtime takes 21% doubles and 12% single precision
>>
>> On Mon, 6 Feb 2017, Victor Lazzarini wrote:
>>
>>> which leaves us to entertain why it’s still twice the load compared to SC. Do you know if
>>> the SC engine optimises something, like not actually summing audio into the output if it is silence?
>>> It would be good to see if you could send a constant value to the output to (like 0.5) to see if it
>>> performs the same.
>>> ========================
>>> Prof. Victor Lazzarini
>>> Dean of Arts, Celtic Studies, and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>>
>>>> On 6 Feb 2017, at 10:07, Eduardo Moguillansky <[hidden email]> wrote:
>>>>
>>>> Works here. On my own tests, now using out or outch has a similar impact as accumulating on a global var.
>>>>
>>>> Thanks!
>>>>
>>>> On Sonntag, 5. Februar 2017 21:42:51 CET, jpff wrote:
>>>>> I have just committed code that changes spout to be non-interleaved, and
>>>>> only changed to interleaved in kperf.  Means values in GetSpout are
>>>>> only updated in kperf but otherwise should perform the same, but
>>>>> quicker.  Basic testing but not all sample-accurate cases have been
>>>>> checked.  Please report any oddities to me or this list.
>>>>>
>>>>> I testing I found a bug in score r opcode which I will start work o
>>>>> asap.
>>>>>
>>>>> ==John ffitch
>>>>>
>>>>>
>>>
>>>
>

Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Warning: major change

jpff
In reply to this post by moguillansky
but te code
   outch 2, a0
   outch 1, a0

works!  Will look closer

On Tue, 7 Feb 2017, Eduardo Moguillansky wrote:

>
> I did not check the output, only the performance: I get corrupted data with
> outch.  Did not test the other out opcodes
>
> <CsoundSynthesizer>
> <CsOptions>
> </CsOptions
> <CsInstruments>
>
> sr = 44100
> ksmps = 128
> nchnls = 2
> 0dbfs = 1.0
>
> instr 1
>
>   ifreq = 440
>   a0 oscili 0.5, ifreq
>   outch 1, a0
>   ; ** uncomment next line and output gets corrupted **
>   ; outch 2, a0
>
> endin
>
> </CsInstruments>
> <CsScore>
>
> i 1 0 20
>
> </CsScore>
> </CsoundSynthesizer>
>
>
>
>
> On 06.02.2017 18:38, jpff wrote:
>       On my laptop the test prgram in realtime takes 21% doubles and 12%
>       single precision
>
>       On Mon, 6 Feb 2017, Victor Lazzarini wrote:
>
>             which leaves us to entertain why it’s still twice the
>             load compared to SC. Do you know if
>             the SC engine optimises something, like not actually
>             summing audio into the output if it is silence?
>             It would be good to see if you could send a constant
>             value to the output to (like 0.5) to see if it
>             performs the same.
>             ========================
>             Prof. Victor Lazzarini
>             Dean of Arts, Celtic Studies, and Philosophy,
>             Maynooth University,
>             Maynooth, Co Kildare, Ireland
>             Tel: 00 353 7086936
>             Fax: 00 353 1 7086952
>
>                   On 6 Feb 2017, at 10:07, Eduardo
>                   Moguillansky
>                   <[hidden email]> wrote:
>
>                   Works here. On my own tests, now using out
>                   or outch has a similar impact as
>                   accumulating on a global var.
>
>                   Thanks!
>
>                   On Sonntag, 5. Februar 2017 21:42:51 CET,
>                   jpff wrote:
>                         I have just committed code
>                         that changes spout to be
>                         non-interleaved, and
>                         only changed to interleaved in
>                         kperf.  Means values in
>                         GetSpout are
>                         only updated in kperf but
>                         otherwise should perform the
>                         same, but
>                         quicker.  Basic testing but
>                         not all sample-accurate cases
>                         have been
>                         checked.  Please report any
>                         oddities to me or this list.
>
>                         I testing I found a bug in
>                         score r opcode which I will
>                         start work o
>                         asap.
>
>                         ==John ffitch
>
>
>
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Warning: major change

jpff
In reply to this post by moguillansky
Fixed in git


On Tue, 7 Feb 2017, Eduardo Moguillansky wrote:

>
> I did not check the output, only the performance: I get corrupted data with
> outch.  Did not test the other out opcodes
>
> <CsoundSynthesizer>
> <CsOptions>
> </CsOptions
> <CsInstruments>
>
> sr = 44100
> ksmps = 128
> nchnls = 2
> 0dbfs = 1.0
>
> instr 1
>
>   ifreq = 440
>   a0 oscili 0.5, ifreq
>   outch 1, a0
>   ; ** uncomment next line and output gets corrupted **
>   ; outch 2, a0
>
> endin
>
> </CsInstruments>
> <CsScore>
>
> i 1 0 20
>
> </CsScore>
> </CsoundSynthesizer>
>
>
>
>
> On 06.02.2017 18:38, jpff wrote:
>       On my laptop the test prgram in realtime takes 21% doubles and 12%
>       single precision
>
>       On Mon, 6 Feb 2017, Victor Lazzarini wrote:
>
>             which leaves us to entertain why it’s still twice the
>             load compared to SC. Do you know if
>             the SC engine optimises something, like not actually
>             summing audio into the output if it is silence?
>             It would be good to see if you could send a constant
>             value to the output to (like 0.5) to see if it
>             performs the same.
>             ========================
>             Prof. Victor Lazzarini
>             Dean of Arts, Celtic Studies, and Philosophy,
>             Maynooth University,
>             Maynooth, Co Kildare, Ireland
>             Tel: 00 353 7086936
>             Fax: 00 353 1 7086952
>
>                   On 6 Feb 2017, at 10:07, Eduardo
>                   Moguillansky
>                   <[hidden email]> wrote:
>
>                   Works here. On my own tests, now using out
>                   or outch has a similar impact as
>                   accumulating on a global var.
>
>                   Thanks!
>
>                   On Sonntag, 5. Februar 2017 21:42:51 CET,
>                   jpff wrote:
>                         I have just committed code
>                         that changes spout to be
>                         non-interleaved, and
>                         only changed to interleaved in
>                         kperf.  Means values in
>                         GetSpout are
>                         only updated in kperf but
>                         otherwise should perform the
>                         same, but
>                         quicker.  Basic testing but
>                         not all sample-accurate cases
>                         have been
>                         checked.  Please report any
>                         oddities to me or this list.
>
>                         I testing I found a bug in
>                         score r opcode which I will
>                         start work o
>                         asap.
>
>                         ==John ffitch
>
>
>
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Warning: major change

rorywalsh
Hi all. I'm kind of late to the party, but do front-end developers using get spout and get spin need to modify their code at all following these changes? 

On 7 Feb 2017 17:22, "jpff" <[hidden email]> wrote:
Fixed in git


On Tue, 7 Feb 2017, Eduardo Moguillansky wrote:


I did not check the output, only the performance: I get corrupted data with
outch.  Did not test the other out opcodes

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

sr = 44100
ksmps = 128
nchnls = 2
0dbfs = 1.0

instr 1

  ifreq = 440
  a0 oscili 0.5, ifreq
  outch 1, a0
  ; ** uncomment next line and output gets corrupted **
  ; outch 2, a0

endin

</CsInstruments>
<CsScore>

i 1 0 20

</CsScore>
</CsoundSynthesizer>




On 06.02.2017 18:38, jpff wrote:
      On my laptop the test prgram in realtime takes 21% doubles and 12%
      single precision

      On Mon, 6 Feb 2017, Victor Lazzarini wrote:

            which leaves us to entertain why it’s still twice the
            load compared to SC. Do you know if
            the SC engine optimises something, like not actually
            summing audio into the output if it is silence?
            It would be good to see if you could send a constant
            value to the output to (like 0.5) to see if it
            performs the same.
            ========================
            Prof. Victor Lazzarini
            Dean of Arts, Celtic Studies, and Philosophy,
            Maynooth University,
            Maynooth, Co Kildare, Ireland
            Tel: 00 353 7086936
            Fax: 00 353 1 7086952

                  On 6 Feb 2017, at 10:07, Eduardo
                  Moguillansky
                  <[hidden email]> wrote:

                  Works here. On my own tests, now using out
                  or outch has a similar impact as
                  accumulating on a global var.

                  Thanks!

                  On Sonntag, 5. Februar 2017 21:42:51 CET,
                  jpff wrote:
                        I have just committed code
                        that changes spout to be
                        non-interleaved, and
                        only changed to interleaved in
                        kperf.  Means values in
                        GetSpout are
                        only updated in kperf but
                        otherwise should perform the
                        same, but
                        quicker.  Basic testing but
                        not all sample-accurate cases
                        have been
                        checked.  Please report any
                        oddities to me or this list.

                        I testing I found a bug in
                        score r opcode which I will
                        start work o
                        asap.

                        ==John ffitch






12