Csound Csound-dev Csound-tekno Search About

[Csnd] Chnl-set of opcodes

Date2013-07-03 15:41
FromJan Jacob Hofmann
Subject[Csnd] Chnl-set of opcodes
Dear list,

I am just diving for the first time into the chnl-set of opcodes.  
Beeng new to that area, I do wonder what the difference is between  
these opcodes for writing audio data into a channel:

1.
			chnset		adry, Sname		; this one works for me
and
			chnsend		adry, Sname	

...while the latter produces the following error message:
error:  input arg 'Sadry' of type string not allowed when expecting o,  
line 2834:
		chnsend		adry, Sadry

Likewise the opcodes for receiving audio data from a channel seem to  
have a similar behavior:


adry		chnget		Sname			; this one works for me

and

adry		chanrcv		Sname

...while the latter produces the following error message:
error:  illegal no of output args, line 2688:
adry		chnrecv		Sadry		

So why two opcodes, that should do basically the same...and why is  
working only one of them?
Any hints welcome.

All the best,

Jan Jacob



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


Date2013-07-03 16:06
FromMichael Gogins
SubjectRe: [Csnd] Chnl-set of opcodes
Which version of Csound are you talking about?

Regards,
Mike


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


On Wed, Jul 3, 2013 at 10:41 AM, Jan Jacob Hofmann <jjh@sonicarchitecture.de> wrote:
Dear list,

I am just diving for the first time into the chnl-set of opcodes. Beeng new to that area, I do wonder what the difference is between these opcodes for writing audio data into a channel:

1.
                        chnset          adry, Sname             ; this one works for me
and
                        chnsend         adry, Sname    

...while the latter produces the following error message:
error:  input arg 'Sadry' of type string not allowed when expecting o, line 2834:
                chnsend         adry, Sadry

Likewise the opcodes for receiving audio data from a channel seem to have a similar behavior:


adry            chnget          Sname                   ; this one works for me

and

adry            chanrcv         Sname

...while the latter produces the following error message:
error:  illegal no of output args, line 2688:
adry            chnrecv         Sadry          

So why two opcodes, that should do basically the same...and why is working only one of them?
Any hints welcome.

All the best,

Jan Jacob



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



Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2013-07-03 17:18
FromAndres Cabrera
SubjectRe: [Csnd] Chnl-set of opcodes
Hi,

Their difference is how they work internally with a host (which has some implications on how they work with Csound too).

chnset/get will set/get the values directly from the internal channel database, so there is no need for a host here. chnsend/chnrecv (which now work identically to invalue/outvalue) are callback based, so they call a registered callback from the host on every k-pass while the opcode is active.

chnset/chnget will be the most efficient when not using your own host and will allow having the values available directly within Csound.
For callback based opcodes, the host is responsible for setting/getting the channel values, so they won't be immediately available.

Although it seems that chnget/set are sufficient for most applications, I think having callback based methods still serve a useful purpose as they can alert the host when values are read/written in Csound, and can make sure values from the host pass synchronously into the engine, i.e. after a call to chnrecv you will get the current value from the host for opcodes immediately after, but with chnset/chnget the host must asynchronously set the values which doesn't guarantee when they will be received.

Cheers,
Andrés




On Wed, Jul 3, 2013 at 7:41 AM, Jan Jacob Hofmann <jjh@sonicarchitecture.de> wrote:
Dear list,

I am just diving for the first time into the chnl-set of opcodes. Beeng new to that area, I do wonder what the difference is between these opcodes for writing audio data into a channel:

1.
                        chnset          adry, Sname             ; this one works for me
and
                        chnsend         adry, Sname    

...while the latter produces the following error message:
error:  input arg 'Sadry' of type string not allowed when expecting o, line 2834:
                chnsend         adry, Sadry

Likewise the opcodes for receiving audio data from a channel seem to have a similar behavior:


adry            chnget          Sname                   ; this one works for me

and

adry            chanrcv         Sname

...while the latter produces the following error message:
error:  illegal no of output args, line 2688:
adry            chnrecv         Sadry          

So why two opcodes, that should do basically the same...and why is working only one of them?
Any hints welcome.

All the best,

Jan Jacob



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



Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"