Csound Csound-dev Csound-tekno Search About

[Csnd] Csound6 RC3 Android - sending values from Csound error

Date2013-06-21 04:16
Fromhcenteno
Subject[Csnd] Csound6 RC3 Android - sending values from Csound error
Hello,

I couldn't find an example of sending values from Csound for Android among
the included examples so I'm not sure if I'm doing something wrong. 

In my app code I have:

@Override
public void updateValuesFromCsound() {
      csPosition = csChannels[7].GetValue(0);
     csFileLength = csChannels[8].GetValue(0);
}

Where csChannels is initialized in setup() like this:

csChannels[7] = csoundObj.getInputChannelPtr("position");
csChannels[8] = csoundObj.getInputChannelPtr("fileLength");

In my orquestra I have:

ilen filelen SFile
kpos line 0, ilen, ilen

chnsend ilen, "fileLength"
chnsend kpos, "position"

but I'm getting the following error in logcat:

06-20 23:01:46.051: D/CsoundObj(1047): UnifiedCSD: 
/data/data/net.hcenteno.ambiexplorer/cache/temp1478716580.csd
06-20 23:01:46.051: D/CsoundObj(1047): STARTING FILE
06-20 23:01:46.051: D/CsoundObj(1047): Creating options
06-20 23:01:46.051: D/CsoundObj(1047): Creating orchestra
06-20 23:01:46.051: D/CsoundObj(1047): Creating score
06-20 23:01:46.061: D/CsoundObj(1047): error: syntax error, unexpected
T_IDENT  (token "ilen")
06-20 23:01:46.061: D/CsoundObj(1047):  line 32:
06-20 23:01:46.061: D/CsoundObj(1047): >>>
06-20 23:01:46.061: D/CsoundObj(1047): 	
06-20 23:01:46.061: D/CsoundObj(1047): c
06-20 23:01:46.061: D/CsoundObj(1047): h
06-20 23:01:46.071: D/CsoundObj(1047): n
06-20 23:01:46.071: D/CsoundObj(1047): s
06-20 23:01:46.071: D/CsoundObj(1047): e
06-20 23:01:46.071: D/CsoundObj(1047): n
06-20 23:01:46.071: D/CsoundObj(1047): d
06-20 23:01:46.071: D/CsoundObj(1047):  
06-20 23:01:46.071: D/CsoundObj(1047): i
06-20 23:01:46.071: D/CsoundObj(1047): l
06-20 23:01:46.071: D/CsoundObj(1047): e
06-20 23:01:46.071: D/CsoundObj(1047): n
06-20 23:01:46.071: D/CsoundObj(1047):  <<<
06-20 23:01:46.071: D/CsoundObj(1047): Unexpected untyped word chnsend when
expecting a variable
06-20 23:01:46.071: D/CsoundObj(1047): Parsing failed due to invalid input!
06-20 23:01:46.071: D/CsoundObj(1047): WARNING: 
06-20 23:01:46.071: D/CsoundObj(1047): Stopping on parser failure
06-20 23:01:46.071: D/CsoundObj(1047): cannot compile orchestra 
06-20 23:01:46.071: D/CsoundObj(1047): Return Value2: -1

Sorry if I'm missing something obvious.

Thanks.




--
View this message in context: http://csound.1045644.n5.nabble.com/Csound6-RC3-Android-sending-values-from-Csound-error-tp5724711.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2013-06-21 15:08
FromJacques Leplat
SubjectRe: [Csnd] Csound6 RC3 Android - sending values from Csound error
Hello hcento,

I use channels in my instrument, and have a line like

chnsend p6, "currtime"

So I am not sure where you have your "chnsend ilen, "fileLength"", is it in the score or the instr declaration? I have only ever done this in the instr.

If you could post a small cad, maybe someone can have a better look.

All the best,

Jacques

On 21 Jun 2013, at 04:16, hcenteno  wrote:

> Hello,
> 
> I couldn't find an example of sending values from Csound for Android among
> the included examples so I'm not sure if I'm doing something wrong. 
> 
> In my app code I have:
> 
> @Override
> public void updateValuesFromCsound() {
>      csPosition = csChannels[7].GetValue(0);
>     csFileLength = csChannels[8].GetValue(0);
> }
> 
> Where csChannels is initialized in setup() like this:
> 
> csChannels[7] = csoundObj.getInputChannelPtr("position");
> csChannels[8] = csoundObj.getInputChannelPtr("fileLength");
> 
> In my orquestra I have:
> 
> ilen filelen SFile
> kpos line 0, ilen, ilen
> 
> chnsend ilen, "fileLength"
> chnsend kpos, "position"
> 
> but I'm getting the following error in logcat:
> 
> 06-20 23:01:46.051: D/CsoundObj(1047): UnifiedCSD: 
> /data/data/net.hcenteno.ambiexplorer/cache/temp1478716580.csd
> 06-20 23:01:46.051: D/CsoundObj(1047): STARTING FILE
> 06-20 23:01:46.051: D/CsoundObj(1047): Creating options
> 06-20 23:01:46.051: D/CsoundObj(1047): Creating orchestra
> 06-20 23:01:46.051: D/CsoundObj(1047): Creating score
> 06-20 23:01:46.061: D/CsoundObj(1047): error: syntax error, unexpected
> T_IDENT  (token "ilen")
> 06-20 23:01:46.061: D/CsoundObj(1047):  line 32:
> 06-20 23:01:46.061: D/CsoundObj(1047): >>>
> 06-20 23:01:46.061: D/CsoundObj(1047): 	
> 06-20 23:01:46.061: D/CsoundObj(1047): c
> 06-20 23:01:46.061: D/CsoundObj(1047): h
> 06-20 23:01:46.071: D/CsoundObj(1047): n
> 06-20 23:01:46.071: D/CsoundObj(1047): s
> 06-20 23:01:46.071: D/CsoundObj(1047): e
> 06-20 23:01:46.071: D/CsoundObj(1047): n
> 06-20 23:01:46.071: D/CsoundObj(1047): d
> 06-20 23:01:46.071: D/CsoundObj(1047):  
> 06-20 23:01:46.071: D/CsoundObj(1047): i
> 06-20 23:01:46.071: D/CsoundObj(1047): l
> 06-20 23:01:46.071: D/CsoundObj(1047): e
> 06-20 23:01:46.071: D/CsoundObj(1047): n
> 06-20 23:01:46.071: D/CsoundObj(1047):  <<<
> 06-20 23:01:46.071: D/CsoundObj(1047): Unexpected untyped word chnsend when
> expecting a variable
> 06-20 23:01:46.071: D/CsoundObj(1047): Parsing failed due to invalid input!
> 06-20 23:01:46.071: D/CsoundObj(1047): WARNING: 
> 06-20 23:01:46.071: D/CsoundObj(1047): Stopping on parser failure
> 06-20 23:01:46.071: D/CsoundObj(1047): cannot compile orchestra 
> 06-20 23:01:46.071: D/CsoundObj(1047): Return Value2: -1
> 
> Sorry if I'm missing something obvious.
> 
> Thanks.
> 
> 
> 
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Csound6-RC3-Android-sending-values-from-Csound-error-tp5724711.html
> Sent from the Csound - General mailing list archive at Nabble.com.
> 
> 
> 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-06-21 17:24
Fromhcenteno
Subject[Csnd] Re: Csound6 RC3 Android - sending values from Csound error
Hi Jacques,

Thank you for your reply. The chnsend is in the instrument. I actually got
it to work by replacing chnsend with chnset. Maybe chsend is not included in
Csound for Android? Did you use it on Android before?





--
View this message in context: http://csound.1045644.n5.nabble.com/Csound6-RC3-Android-sending-values-from-Csound-error-tp5724711p5724725.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2013-06-21 17:33
FromJacques Leplat
SubjectRe: [Csnd] Re: Csound6 RC3 Android - sending values from Csound error
Hello again,

I just had a good look at my code, and you are correct, chnset is the one I use too. I'm glad the problem is resolved for you.

All the best,

Jacques

On 21 Jun 2013, at 17:24, hcenteno  wrote:

> Hi Jacques,
> 
> Thank you for your reply. The chnsend is in the instrument. I actually got
> it to work by replacing chnsend with chnset. Maybe chsend is not included in
> Csound for Android? Did you use it on Android before?
> 
> 
> 
> 
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Csound6-RC3-Android-sending-values-from-Csound-error-tp5724711p5724725.html
> Sent from the Csound - General mailing list archive at Nabble.com.
> 
> 
> 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-06-22 11:16
FromRory Walsh
SubjectRe: [Csnd] Re: Csound6 RC3 Android - sending values from Csound error
If you're looking for examples that use Java/Android, check out the
source for Csoundo for Android here:

https://github.com/rorywalsh/Csoundo

Rory.

On 21 June 2013 17:33, Jacques Leplat  wrote:
> Hello again,
>
> I just had a good look at my code, and you are correct, chnset is the one I use too. I'm glad the problem is resolved for you.
>
> All the best,
>
> Jacques
>
> On 21 Jun 2013, at 17:24, hcenteno  wrote:
>
>> Hi Jacques,
>>
>> Thank you for your reply. The chnsend is in the instrument. I actually got
>> it to work by replacing chnsend with chnset. Maybe chsend is not included in
>> Csound for Android? Did you use it on Android before?
>>
>>
>>
>>
>>
>> --
>> View this message in context: http://csound.1045644.n5.nabble.com/Csound6-RC3-Android-sending-values-from-Csound-error-tp5724711p5724725.html
>> Sent from the Csound - General mailing list archive at Nabble.com.
>>
>>
>> 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"
>>
>
>
>
> 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"
>