Csound Csound-dev Csound-tekno Search About

[Csnd] What is the difference between "sum" and "+"?

Date2022-09-25 19:50
FromJan Jacob Hofmann
Subject[Csnd] What is the difference between "sum" and "+"?
Dear list,

I can not figure out why instr. 1 does sound different to instr. 2?

The only thing I changed is to use "+" instead of "sum" in instr. 2.

My Csound-version is:

6.18 (double samples) May 30 2022 (which I compiled from git-sources on 
Ubuntu 20.4)

Has anyone any idea?

Best,

Jan Jacob









sr = 44100

ksmps = 128

nchnls = 2

0dbfs = 1.0

instr 1

aout = 0

aout0 oscil .2, 220

aout sum aout, aout0

aout1 oscil .2, 440

aout sum aout, aout1

outs aout, aout

endin

instr 2

aout = 0

aout0 oscil .2, 220

aout = aout + aout0

aout1 oscil .2, 440

aout = aout + aout1

outs aout, aout

endin





i1 0 1

i2 1.2 1





-- 
sound      |      movement       |       object      |      space
sonic architecture     |      site: http://www.sonicarchitecture.de
spatial electronic composition    |    higher order ambisonic music

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

Date2022-09-25 20:42
FromST Music
SubjectRe: [Csnd] What is the difference between "sum" and "+"?
Hi Jan, 

   I can neither hear nor see a difference. Perhaps something about the way you are playing this back is not always uniform? 

Anyways, for me - when in doubt, render to file and view in an editor. You'll see both waves are virtually identical.

Here is an image :


On Sun, Sep 25, 2022, 2:53 PM Jan Jacob Hofmann, <jjh@sonicarchitecture.de> wrote:
Dear list,

I can not figure out why instr. 1 does sound different to instr. 2?

The only thing I changed is to use "+" instead of "sum" in instr. 2.

My Csound-version is:

6.18 (double samples) May 30 2022 (which I compiled from git-sources on
Ubuntu 20.4)

Has anyone any idea?

Best,

Jan Jacob

<CsoundSynthesizer>

<CsOptions>

</CsOptions>

<CsInstruments>

sr = 44100

ksmps = 128

nchnls = 2

0dbfs = 1.0

instr 1

aout = 0

aout0 oscil .2, 220

aout sum aout, aout0

aout1 oscil .2, 440

aout sum aout, aout1

outs aout, aout

endin

instr 2

aout = 0

aout0 oscil .2, 220

aout = aout + aout0

aout1 oscil .2, 440

aout = aout + aout1

outs aout, aout

endin

</CsInstruments>

<CsScore>

i1 0 1

i2 1.2 1

</CsScore>

</CsoundSynthesizer>

--
sound      |      movement       |       object      |      space
sonic architecture     |      site: http://www.sonicarchitecture.de
spatial electronic composition    |    higher order ambisonic music

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

Date2022-09-26 00:39
FromJohn ff
SubjectRe: [Csnd] What is the difference between "sum" and "+"?
A bug in sum was fixed recently which could explain this

On 25 Sep 2022, at 20:44, ST Music <stunes6556@gmail.com> wrote:
Hi Jan, 

   I can neither hear nor see a difference. Perhaps something about the way you are playing this back is not always uniform? 

Anyways, for me - when in doubt, render to file and view in an editor. You'll see both waves are virtually identical.

Here is an image :


On Sun, Sep 25, 2022, 2:53 PM Jan Jacob Hofmann, <jjh@sonicarchitecture.de> wrote:
Dear list,

I can not figure out why instr. 1 does sound different to instr. 2?

The only thing I changed is to use "+" instead of "sum" in instr. 2.

My Csound-version is:

6.18 (double samples) May 30 2022 (which I compiled from git-sources on
Ubuntu 20.4)

Has anyone any idea?

Best,

Jan Jacob

<CsoundSynthesizer>

<CsOptions>

</CsOptions>

<CsInstruments>

sr = 44100

ksmps = 128

nchnls = 2

0dbfs = 1.0

instr 1

aout = 0

aout0 oscil .2, 220

aout sum aout, aout0

aout1 oscil .2, 440

aout sum aout, aout1

outs aout, aout

endin

instr 2

aout = 0

aout0 oscil .2, 220

aout = aout + aout0

aout1 oscil .2, 440

aout = aout + aout1

outs aout, aout

endin

</CsInstruments>

<CsScore>

i1 0 1

i2 1.2 1

</CsScore>

</CsoundSynthesizer>

--
sound      |      movement       |       object      |      space
sonic architecture     |      site: http://www.sonicarchitecture.de
spatial electronic composition    |    higher order ambisonic music

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

Date2022-10-01 02:40
FromPartev Sarkissian <0000060b2ef1338e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] What is the difference between "sum" and "+"?

Using sum is convenient as you don't have to bother with 
the "+" sign every time. Very good. 


-PBS 




-----Original Message-----
From: Jan Jacob Hofmann <jjh@SONICARCHITECTURE.DE>
To: CSOUND@LISTSERV.HEANET.IE
Sent: Sun, Sep 25, 2022 7:50 pm
Subject: [Csnd] What is the difference between "sum" and "+"?

Dear list,

I can not figure out why instr. 1 does sound different to instr. 2?

The only thing I changed is to use "+" instead of "sum" in instr. 2.

My Csound-version is:

6.18 (double samples) May 30 2022 (which I compiled from git-sources on
Ubuntu 20.4)

Has anyone any idea?

Best,

Jan Jacob

<CsoundSynthesizer>

<CsOptions>

</CsOptions>

<CsInstruments>

sr = 44100

ksmps = 128

nchnls = 2

0dbfs = 1.0

instr 1

aout = 0

aout0 oscil .2, 220

aout sum aout, aout0

aout1 oscil .2, 440

aout sum aout, aout1

outs aout, aout

endin

instr 2

aout = 0

aout0 oscil .2, 220

aout = aout + aout0

aout1 oscil .2, 440

aout = aout + aout1

outs aout, aout

endin

</CsInstruments>

<CsScore>

i1 0 1

i2 1.2 1

</CsScore>

</CsoundSynthesizer>

--
sound      |      movement      |      object      |      space
sonic architecture    |      site: http://www.sonicarchitecture.de
spatial electronic composition    |    higher order ambisonic music

Csound mailing list
Send bugs reports to
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

Date2022-10-01 02:51
FromST Music
SubjectRe: [Csnd] What is the difference between "sum" and "+"?
I'm a programming noob, so I have to ask this question : 

"sum" requires typing 3 characters, "+" is only one, so in what way is sum more convenient for you

Scott

On Fri, Sep 30, 2022, 9:40 PM Partev Sarkissian, <0000060b2ef1338e-dmarc-request@listserv.heanet.ie> wrote:

Using sum is convenient as you don't have to bother with 
the "+" sign every time. Very good. 


-PBS 




-----Original Message-----
From: Jan Jacob Hofmann <jjh@SONICARCHITECTURE.DE>
To: CSOUND@LISTSERV.HEANET.IE
Sent: Sun, Sep 25, 2022 7:50 pm
Subject: [Csnd] What is the difference between "sum" and "+"?

Dear list,

I can not figure out why instr. 1 does sound different to instr. 2?

The only thing I changed is to use "+" instead of "sum" in instr. 2.

My Csound-version is:

6.18 (double samples) May 30 2022 (which I compiled from git-sources on
Ubuntu 20.4)

Has anyone any idea?

Best,

Jan Jacob

<CsoundSynthesizer>

<CsOptions>

</CsOptions>

<CsInstruments>

sr = 44100

ksmps = 128

nchnls = 2

0dbfs = 1.0

instr 1

aout = 0

aout0 oscil .2, 220

aout sum aout, aout0

aout1 oscil .2, 440

aout sum aout, aout1

outs aout, aout

endin

instr 2

aout = 0

aout0 oscil .2, 220

aout = aout + aout0

aout1 oscil .2, 440

aout = aout + aout1

outs aout, aout

endin

</CsInstruments>

<CsScore>

i1 0 1

i2 1.2 1

</CsScore>

</CsoundSynthesizer>

--
sound      |      movement      |      object      |      space
sonic architecture    |      site: http://www.sonicarchitecture.de
spatial electronic composition    |    higher order ambisonic music

Csound mailing list
Send bugs reports to
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

Date2022-10-01 11:31
FromJohn ff
SubjectRe: [Csnd] What is the difference between "sum" and "+"?
Each call to + is an opcode and has a certain amount of overhead. Sum is one opcode do has less overhead of adding many arguments.  The effect marginal
The other answer is to do with coding style/preference



On 1 Oct 2022, at 02:54, ST Music <stunes6556@gmail.com> wrote:
I'm a programming noob, so I have to ask this question : 

"sum" requires typing 3 characters, "+" is only one, so in what way is sum more convenient for you

Scott

On Fri, Sep 30, 2022, 9:40 PM Partev Sarkissian, < 0000060b2ef1338e-dmarc-request@listserv.heanet.ie> wrote:

Using sum is convenient as you don't have to bother with 
the "+" sign every time. Very good. 


-PBS 




-----Original Message-----
From: Jan Jacob Hofmann <jjh@SONICARCHITECTURE.DE>
To: CSOUND@LISTSERV.HEANET.IE
Sent: Sun, Sep 25, 2022 7:50 pm
Subject: [Csnd] What is the difference between "sum" and "+"?

Dear list,

I can not figure out why instr. 1 does sound different to instr. 2?

The only thing I changed is to use "+" instead of "sum" in instr. 2.

My Csound-version is:

6.18 (double samples) May 30 2022 (which I compiled from git-sources on
Ubuntu 20.4)

Has anyone any idea?

Best,

Jan Jacob

<CsoundSynthesizer>

<CsOptions>

</CsOptions>

<CsInstruments>

sr = 44100

ksmps = 128

nchnls = 2

0dbfs = 1.0

instr 1

aout = 0

aout0 oscil .2, 220

aout sum aout, aout0

aout1 oscil .2, 440

aout sum aout, aout1

outs aout, aout

endin

instr 2

aout = 0

aout0 oscil .2, 220

aout = aout + aout0

aout1 oscil .2, 440

aout = aout + aout1

outs aout, aout

endin

</CsInstruments>

<CsScore>

i1 0 1

i2 1.2 1

</CsScore>

</CsoundSynthesizer>

--
sound      |      movement      |      object      |      space
sonic architecture    |      site: http://www.sonicarchitecture.de
spatial electronic composition    |    higher order ambisonic music

Csound mailing list
Send bugs reports to
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

Date2022-10-01 13:25
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] What is the difference between "sum" and "+"?
I’d say for a very large number of arguments, there may be some gain in using sum. Part of the trouble with this opcode in recent releases is that it was updated
to be more efficient, but some bugs were introduced as part of this. Now it should be good.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 1 Oct 2022, at 11:31, John ff  wrote:
> 
> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> Each call to + is an opcode and has a certain amount of overhead. Sum is one opcode do has less overhead of adding many arguments.  The effect marginal
> The other answer is to do with coding style/preference
> 
> 
> 
> Get TypeApp for Android
> On 1 Oct 2022, at 02:54, ST Music  wrote:
> I'm a programming noob, so I have to ask this question : 
> 
> "sum" requires typing 3 characters, "+" is only one, so in what way is sum more convenient for you 
> 
> Scott
> 
> ST Music 
> https://soundcloud.com/stoons-1 
> 
> https://youtube.com/channel/UCGhwmkS1uWmX6mhTIQ0IDsg
> 
> On Fri, Sep 30, 2022, 9:40 PM Partev Sarkissian, < 0000060b2ef1338e-dmarc-request@listserv.heanet.ie> wrote: 
> 
> Using sum is convenient as you don't have to bother with 
> the "+" sign every time. Very good. 
> 
> 
> -PBS 
> 
> 
> 
> 
> -----Original Message-----
> From: Jan Jacob Hofmann 
> To: CSOUND@LISTSERV.HEANET.IE
> Sent: Sun, Sep 25, 2022 7:50 pm
> Subject: [Csnd] What is the difference between "sum" and "+"?
> 
> Dear list, 
> 
> I can not figure out why instr. 1 does sound different to instr. 2? 
> 
> The only thing I changed is to use "+" instead of "sum" in instr. 2. 
> 
> My Csound-version is: 
> 
> 6.18 (double samples) May 30 2022 (which I compiled from git-sources on 
> Ubuntu 20.4) 
> 
> Has anyone any idea? 
> 
> Best, 
> 
> Jan Jacob 
> 
>  
> 
>  
> 
>  
> 
>  
> 
> sr = 44100 
> 
> ksmps = 128 
> 
> nchnls = 2 
> 
> 0dbfs = 1.0 
> 
> instr 1 
> 
> aout = 0 
> 
> aout0 oscil .2, 220 
> 
> aout sum aout, aout0 
> 
> aout1 oscil .2, 440 
> 
> aout sum aout, aout1 
> 
> outs aout, aout 
> 
> endin 
> 
> instr 2 
> 
> aout = 0 
> 
> aout0 oscil .2, 220 
> 
> aout = aout + aout0 
> 
> aout1 oscil .2, 440 
> 
> aout = aout + aout1 
> 
> outs aout, aout 
> 
> endin 
> 
>  
> 
>  
> 
> i1 0 1 
> 
> i2 1.2 1 
> 
>  
> 
>  
> 
> -- 
> sound      |      movement      |      object      |      space 
> sonic architecture    |      site: http://www.sonicarchitecture.de 
> spatial electronic composition    |    higher order ambisonic music 
> 
> 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

Date2022-10-01 14:35
FromEduardo Moguillansky
SubjectRe: [Csnd] [EXTERNAL] [Csnd] What is the difference between "sum" and "+"?
The gains of using sum depend on the number of inputs. With 16 inputs I 
see a speedup of ~2.6x when using sum, with 8 inputs, ~1.9x and with 4 
the speedup is reduced to 1.2x. With 3 or less there is no measurable 
speedup. This is with -mavx

On 01.10.22 14:25, Victor Lazzarini wrote:
> I’d say for a very large number of arguments, there may be some gain in using sum. Part of the trouble with this opcode in recent releases is that it was updated
> to be more efficient, but some bugs were introduced as part of this. Now it should be good.
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 1 Oct 2022, at 11:31, John ff  wrote:
>>
>> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
>> Each call to + is an opcode and has a certain amount of overhead. Sum is one opcode do has less overhead of adding many arguments.  The effect marginal
>> The other answer is to do with coding style/preference
>>
>>
>>
>> Get TypeApp for Android
>> On 1 Oct 2022, at 02:54, ST Music  wrote:
>> I'm a programming noob, so I have to ask this question :
>>
>> "sum" requires typing 3 characters, "+" is only one, so in what way is sum more convenient for you
>>
>> Scott
>>
>> ST Music
>> https://soundcloud.com/stoons-1
>>
>> https://youtube.com/channel/UCGhwmkS1uWmX6mhTIQ0IDsg
>>
>> On Fri, Sep 30, 2022, 9:40 PM Partev Sarkissian, < 0000060b2ef1338e-dmarc-request@listserv.heanet.ie> wrote:
>>
>> Using sum is convenient as you don't have to bother with
>> the "+" sign every time. Very good.
>>
>>
>> -PBS
>>
>>
>>
>>
>> -----Original Message-----
>> From: Jan Jacob Hofmann 
>> To: CSOUND@LISTSERV.HEANET.IE
>> Sent: Sun, Sep 25, 2022 7:50 pm
>> Subject: [Csnd] What is the difference between "sum" and "+"?
>>
>> Dear list,
>>
>> I can not figure out why instr. 1 does sound different to instr. 2?
>>
>> The only thing I changed is to use "+" instead of "sum" in instr. 2.
>>
>> My Csound-version is:
>>
>> 6.18 (double samples) May 30 2022 (which I compiled from git-sources on
>> Ubuntu 20.4)
>>
>> Has anyone any idea?
>>
>> Best,
>>
>> Jan Jacob
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> sr = 44100
>>
>> ksmps = 128
>>
>> nchnls = 2
>>
>> 0dbfs = 1.0
>>
>> instr 1
>>
>> aout = 0
>>
>> aout0 oscil .2, 220
>>
>> aout sum aout, aout0
>>
>> aout1 oscil .2, 440
>>
>> aout sum aout, aout1
>>
>> outs aout, aout
>>
>> endin
>>
>> instr 2
>>
>> aout = 0
>>
>> aout0 oscil .2, 220
>>
>> aout = aout + aout0
>>
>> aout1 oscil .2, 440
>>
>> aout = aout + aout1
>>
>> outs aout, aout
>>
>> endin
>>
>> 
>>
>> 
>>
>> i1 0 1
>>
>> i2 1.2 1
>>
>> 
>>
>> 
>>
>> -- 
>> sound      |      movement      |      object      |      space
>> sonic architecture    |      site: http://www.sonicarchitecture.de
>> spatial electronic composition    |    higher order ambisonic music
>>
>> 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

Date2022-10-01 21:18
FromPartev Sarkissian <0000060b2ef1338e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] What is the difference between "sum" and "+"?

Line of code is shorter. I don't use it all the time though. 
Sometimes I just like seeing the "+" as part of it all, overall 
sense of the look of it all. But that's just me. 


-PBS 




-----Original Message-----
From: ST Music <stunes6556@GMAIL.COM>
To: CSOUND@LISTSERV.HEANET.IE
Sent: Sat, Oct 1, 2022 2:51 am
Subject: Re: [Csnd] What is the difference between "sum" and "+"?

I'm a programming noob, so I have to ask this question : 

"sum" requires typing 3 characters, "+" is only one, so in what way is sum more convenient for you

Scott

On Fri, Sep 30, 2022, 9:40 PM Partev Sarkissian, <0000060b2ef1338e-dmarc-request@listserv.heanet.ie> wrote:

Using sum is convenient as you don't have to bother with 
the "+" sign every time. Very good. 


-PBS 




-----Original Message-----
From: Jan Jacob Hofmann <jjh@SONICARCHITECTURE.DE>
To: CSOUND@LISTSERV.HEANET.IE
Sent: Sun, Sep 25, 2022 7:50 pm
Subject: [Csnd] What is the difference between "sum" and "+"?

Dear list,

I can not figure out why instr. 1 does sound different to instr. 2?

The only thing I changed is to use "+" instead of "sum" in instr. 2.

My Csound-version is:

6.18 (double samples) May 30 2022 (which I compiled from git-sources on
Ubuntu 20.4)

Has anyone any idea?

Best,

Jan Jacob

<CsoundSynthesizer>

<CsOptions>

</CsOptions>

<CsInstruments>

sr = 44100

ksmps = 128

nchnls = 2

0dbfs = 1.0

instr 1

aout = 0

aout0 oscil .2, 220

aout sum aout, aout0

aout1 oscil .2, 440

aout sum aout, aout1

outs aout, aout

endin

instr 2

aout = 0

aout0 oscil .2, 220

aout = aout + aout0

aout1 oscil .2, 440

aout = aout + aout1

outs aout, aout

endin

</CsInstruments>

<CsScore>

i1 0 1

i2 1.2 1

</CsScore>

</CsoundSynthesizer>

--
sound      |      movement      |      object      |      space
sonic architecture    |      site: http://www.sonicarchitecture.de
spatial electronic composition    |    higher order ambisonic music

Csound mailing list
Send bugs reports to
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

Date2022-10-01 21:20
FromPartev Sarkissian <0000060b2ef1338e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] What is the difference between "sum" and "+"?

Oh, now that's even better. I like that. 


-PBS 



-----Original Message-----
From: John ff <jpff@CODEMIST.CO.UK>
To: CSOUND@LISTSERV.HEANET.IE
Sent: Sat, Oct 1, 2022 11:31 am
Subject: Re: [Csnd] What is the difference between "sum" and "+"?

Each call to + is an opcode and has a certain amount of overhead. Sum is one opcode do has less overhead of adding many arguments.  The effect marginal
The other answer is to do with coding style/preference



On 1 Oct 2022, at 02:54, ST Music <stunes6556@gmail.com> wrote:
I'm a programming noob, so I have to ask this question : 

"sum" requires typing 3 characters, "+" is only one, so in what way is sum more convenient for you

Scott

On Fri, Sep 30, 2022, 9:40 PM Partev Sarkissian, < 0000060b2ef1338e-dmarc-request@listserv.heanet.ie> wrote:

Using sum is convenient as you don't have to bother with 
the "+" sign every time. Very good. 


-PBS 




-----Original Message-----
From: Jan Jacob Hofmann <jjh@SONICARCHITECTURE.DE>
To: CSOUND@LISTSERV.HEANET.IE
Sent: Sun, Sep 25, 2022 7:50 pm
Subject: [Csnd] What is the difference between "sum" and "+"?

Dear list,

I can not figure out why instr. 1 does sound different to instr. 2?

The only thing I changed is to use "+" instead of "sum" in instr. 2.

My Csound-version is:

6.18 (double samples) May 30 2022 (which I compiled from git-sources on
Ubuntu 20.4)

Has anyone any idea?

Best,

Jan Jacob

<CsoundSynthesizer>

<CsOptions>

</CsOptions>

<CsInstruments>

sr = 44100

ksmps = 128

nchnls = 2

0dbfs = 1.0

instr 1

aout = 0

aout0 oscil .2, 220

aout sum aout, aout0

aout1 oscil .2, 440

aout sum aout, aout1

outs aout, aout

endin

instr 2

aout = 0

aout0 oscil .2, 220

aout = aout + aout0

aout1 oscil .2, 440

aout = aout + aout1

outs aout, aout

endin

</CsInstruments>

<CsScore>

i1 0 1

i2 1.2 1

</CsScore>

</CsoundSynthesizer>

--
sound      |      movement      |      object      |      space
sonic architecture    |      site: http://www.sonicarchitecture.de
spatial electronic composition    |    higher order ambisonic music

Csound mailing list
Send bugs reports to
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

Date2022-10-01 21:35
FromPartev Sarkissian <0000060b2ef1338e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] What is the difference between "sum" and "+"?

Yes. I did a 32 band Fourier sum where I used that. It was very handy. 


-PBS 



-----Original Message-----
From: Eduardo Moguillansky <eduardo.moguillansky@GMAIL.COM>
To: CSOUND@LISTSERV.HEANET.IE
Sent: Sat, Oct 1, 2022 2:35 pm
Subject: Re: [Csnd] [EXTERNAL] [Csnd] What is the difference between "sum" and "+"?

The gains of using sum depend on the number of inputs. With 16 inputs I
see a speedup of ~2.6x when using sum, with 8 inputs, ~1.9x and with 4
the speedup is reduced to 1.2x. With 3 or less there is no measurable
speedup. This is with -mavx

On 01.10.22 14:25, Victor Lazzarini wrote:
> I’d say for a very large number of arguments, there may be some gain in using sum. Part of the trouble with this opcode in recent releases is that it was updated
> to be more efficient, but some bugs were introduced as part of this. Now it should be good.
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 1 Oct 2022, at 11:31, John ff <jpff@CODEMIST.CO.UK> wrote:
>>
>> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
>> Each call to + is an opcode and has a certain amount of overhead. Sum is one opcode do has less overhead of adding many arguments.  The effect marginal
>> The other answer is to do with coding style/preference
>>
>>
>>
>> Get TypeApp for Android
>> On 1 Oct 2022, at 02:54, ST Music <stunes6556@gmail.com> wrote:
>> I'm a programming noob, so I have to ask this question :
>>
>> "sum" requires typing 3 characters, "+" is only one, so in what way is sum more convenient for you
>>
>> Scott
>>
>> ST Music
>> https://soundcloud.com/stoons-1
>>
>> https://youtube.com/channel/UCGhwmkS1uWmX6mhTIQ0IDsg
>>
>> On Fri, Sep 30, 2022, 9:40 PM Partev Sarkissian, < 0000060b2ef1338e-dmarc-request@listserv.heanet.ie> wrote:
>>
>> Using sum is convenient as you don't have to bother with
>> the "+" sign every time. Very good.
>>
>>
>> -PBS
>>
>>
>>
>>
>> -----Original Message-----
>> From: Jan Jacob Hofmann <jjh@SONICARCHITECTURE.DE>
>> To: CSOUND@LISTSERV.HEANET.IE
>> Sent: Sun, Sep 25, 2022 7:50 pm
>> Subject: [Csnd] What is the difference between "sum" and "+"?
>>
>> Dear list,
>>
>> I can not figure out why instr. 1 does sound different to instr. 2?
>>
>> The only thing I changed is to use "+" instead of "sum" in instr. 2.
>>
>> My Csound-version is:
>>
>> 6.18 (double samples) May 30 2022 (which I compiled from git-sources on
>> Ubuntu 20.4)
>>
>> Has anyone any idea?
>>
>> Best,
>>
>> Jan Jacob
>>
>> <CsoundSynthesizer>
>>
>> <CsOptions>
>>
>> </CsOptions>
>>
>> <CsInstruments>
>>
>> sr = 44100
>>
>> ksmps = 128
>>
>> nchnls = 2
>>
>> 0dbfs = 1.0
>>
>> instr 1
>>
>> aout = 0
>>
>> aout0 oscil .2, 220
>>
>> aout sum aout, aout0
>>
>> aout1 oscil .2, 440
>>
>> aout sum aout, aout1
>>
>> outs aout, aout
>>
>> endin
>>
>> instr 2
>>
>> aout = 0
>>
>> aout0 oscil .2, 220
>>
>> aout = aout + aout0
>>
>> aout1 oscil .2, 440
>>
>> aout = aout + aout1
>>
>> outs aout, aout
>>
>> endin
>>
>> </CsInstruments>
>>
>> <CsScore>
>>
>> i1 0 1
>>
>> i2 1.2 1
>>
>> </CsScore>
>>
>> </CsoundSynthesizer>
>>
>> --
>> sound      |      movement      |      object      |      space
>> sonic architecture    |      site: http://www.sonicarchitecture.de
>> spatial electronic composition    |    higher order ambisonic music
>>
>> 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
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

Date2022-10-01 22:08
FromST Music
SubjectRe: [Csnd] [EXTERNAL] [Csnd] What is the difference between "sum" and "+"?
Noob here again with another quick question. 

So, if I'm understanding this correctly, adding two things together like asig + asig is fine, whether + or sum the opcode is getting called once. 

However, if adding multiple things together, in general sum is preferred since the opcode only has to be called once. 

Is that the basic idea?

On Sat, Oct 1, 2022, 4:35 PM Partev Sarkissian, <0000060b2ef1338e-dmarc-request@listserv.heanet.ie> wrote:

Yes. I did a 32 band Fourier sum where I used that. It was very handy. 


-PBS 



-----Original Message-----
From: Eduardo Moguillansky <eduardo.moguillansky@GMAIL.COM>
To: CSOUND@LISTSERV.HEANET.IE
Sent: Sat, Oct 1, 2022 2:35 pm
Subject: Re: [Csnd] [EXTERNAL] [Csnd] What is the difference between "sum" and "+"?

The gains of using sum depend on the number of inputs. With 16 inputs I
see a speedup of ~2.6x when using sum, with 8 inputs, ~1.9x and with 4
the speedup is reduced to 1.2x. With 3 or less there is no measurable
speedup. This is with -mavx

On 01.10.22 14:25, Victor Lazzarini wrote:
> I’d say for a very large number of arguments, there may be some gain in using sum. Part of the trouble with this opcode in recent releases is that it was updated
> to be more efficient, but some bugs were introduced as part of this. Now it should be good.
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 1 Oct 2022, at 11:31, John ff <jpff@CODEMIST.CO.UK> wrote:
>>
>> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
>> Each call to + is an opcode and has a certain amount of overhead. Sum is one opcode do has less overhead of adding many arguments.  The effect marginal
>> The other answer is to do with coding style/preference
>>
>>
>>
>> Get TypeApp for Android
>> On 1 Oct 2022, at 02:54, ST Music <stunes6556@gmail.com> wrote:
>> I'm a programming noob, so I have to ask this question :
>>
>> "sum" requires typing 3 characters, "+" is only one, so in what way is sum more convenient for you
>>
>> Scott
>>
>> ST Music
>> https://soundcloud.com/stoons-1
>>
>> https://youtube.com/channel/UCGhwmkS1uWmX6mhTIQ0IDsg
>>
>> On Fri, Sep 30, 2022, 9:40 PM Partev Sarkissian, < 0000060b2ef1338e-dmarc-request@listserv.heanet.ie> wrote:
>>
>> Using sum is convenient as you don't have to bother with
>> the "+" sign every time. Very good.
>>
>>
>> -PBS
>>
>>
>>
>>
>> -----Original Message-----
>> From: Jan Jacob Hofmann <jjh@SONICARCHITECTURE.DE>
>> To: CSOUND@LISTSERV.HEANET.IE
>> Sent: Sun, Sep 25, 2022 7:50 pm
>> Subject: [Csnd] What is the difference between "sum" and "+"?
>>
>> Dear list,
>>
>> I can not figure out why instr. 1 does sound different to instr. 2?
>>
>> The only thing I changed is to use "+" instead of "sum" in instr. 2.
>>
>> My Csound-version is:
>>
>> 6.18 (double samples) May 30 2022 (which I compiled from git-sources on
>> Ubuntu 20.4)
>>
>> Has anyone any idea?
>>
>> Best,
>>
>> Jan Jacob
>>
>> <CsoundSynthesizer>
>>
>> <CsOptions>
>>
>> </CsOptions>
>>
>> <CsInstruments>
>>
>> sr = 44100
>>
>> ksmps = 128
>>
>> nchnls = 2
>>
>> 0dbfs = 1.0
>>
>> instr 1
>>
>> aout = 0
>>
>> aout0 oscil .2, 220
>>
>> aout sum aout, aout0
>>
>> aout1 oscil .2, 440
>>
>> aout sum aout, aout1
>>
>> outs aout, aout
>>
>> endin
>>
>> instr 2
>>
>> aout = 0
>>
>> aout0 oscil .2, 220
>>
>> aout = aout + aout0
>>
>> aout1 oscil .2, 440
>>
>> aout = aout + aout1
>>
>> outs aout, aout
>>
>> endin
>>
>> </CsInstruments>
>>
>> <CsScore>
>>
>> i1 0 1
>>
>> i2 1.2 1
>>
>> </CsScore>
>>
>> </CsoundSynthesizer>
>>
>> --
>> sound      |      movement      |      object      |      space
>> sonic architecture    |      site: http://www.sonicarchitecture.de
>> spatial electronic composition    |    higher order ambisonic music
>>
>> 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
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