Csound Csound-dev Csound-tekno Search About

[Csnd] i() and arrays

Date2014-06-02 12:56
FromPierre Clisson
Subject[Csnd] i() and arrays
Hi all,

I need to init a variable with a value taken from a k-array.
In a perfect world, this would have worked:

ivalue = i(gkarray[p4][p5])

But unfortunately, it produces a parsing error ("Use of i() with expression not permitted"). Is it the intended behavior or a bug?
In my specific case, I can rely on a workaround with the reinit opcode, but it is very ugly and verbose.

--
Pierre

Date2014-06-02 13:14
FromTarmo Johannes
SubjectRe: [Csnd] i() and arrays
Hi,

It was recently fixed it in git. If you can pull and build the develop branch, 
it should be OK. (well I tested with one dimentional array and it worked, I 
think two dimentions should be OK as well).

best!
tarmo

On Monday 02 June 2014 13:56:59 Pierre Clisson wrote:
> Hi all,
> 
> I need to init a variable with a value taken from a k-array.
> In a perfect world, this would have worked:
> 
> ivalue = i(gkarray[p4][p5])
> 
> But unfortunately, it produces a parsing error ("Use of i() with expression
> not permitted"). Is it the intended behavior or a bug? In my specific case,
> I can rely on a workaround with the reinit opcode, but it is very ugly and
> verbose.
> 
> --
> Pierre
> 
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"


Date2014-06-02 13:23
Fromjpff@cs.bath.ac.uk
Subject[Csnd] Re:
AttachmentsNone  

Date2014-06-02 13:59
Frommesca
Subject[Csnd] Re:
Just built the latest devel branch. It now works with simple arrays but not with multi-dimensional ones.

Le 2 juin 2014 à 14:23, jpff [via Csound] <[hidden email]> a écrit :

I have not checked 2-d arrays.  May not work. 

This is a real can of worms 

Quoting Tarmo Johannes <<a href="x-msg://2/user/SendEmail.jtp?type=node&amp;node=5735644&amp;i=0" target="_top" rel="nofollow" link="external">[hidden email]>: 

> Hi, 
> 
> It was recently fixed it in git. If you can pull and build the   
> develop branch, 
> it should be OK. (well I tested with one dimentional array and it worked, I 
> think two dimentions should be OK as well). 
> 
> best! 
> tarmo 
> 
> On Monday 02 June 2014 13:56:59 Pierre Clisson wrote: 
>> Hi all, 
>> 
>> I need to init a variable with a value taken from a k-array. 
>> In a perfect world, this would have worked: 
>> 
>> ivalue = i(gkarray[p4][p5]) 
>> 
>> But unfortunately, it produces a parsing error ("Use of i() with expression 
>> not permitted"). Is it the intended behavior or a bug? In my specific case, 
>> I can rely on a workaround with the reinit opcode, but it is very ugly and 
>> verbose. 
>> 
>> -- 
>> Pierre 



View this message in context: Re:
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-06-02 14:34
Fromjpff@cs.bath.ac.uk
Subject[Csnd] Re:
AttachmentsNone  

Date2014-06-02 15:33
Frommesca
Subject[Csnd] Re:
The bug appears when one of the index is a variable, whatever its rate and whatever the number of dimensions:

<CsoundSynthesizer>
<CsOptions>
-o dac
</CsOptions>
<CsInstruments>

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

gkarr1[] init 2
gkarr2[][] init 2, 2

instr set
  gkarr1[0] = 1
  gkarr2[0][0] = 1
endin

instr get
  i1 = i(gkarr1[0]) ; ok
  i2 = i(gkarr2[0][0]) ; ok
  i3 = i(gkarr1[p4]) ; fail
  i4 = i(gkarr2[p4][p4]) ; fail
  print i1
  print i2
  print i3
  print i4
endin

</CsInstruments>
<CsScore>

i "set" 0 1
i "get" 1 1 0

e

</CsScore>
</CsoundSynthesizer>

Le 2 juin 2014 à 15:35, jpff [via Csound] <[hidden email]> a écrit :

Hummmm.  I just tried it and it worked for 2d array (although there is  
a bug if second index is k-rate).  Can you send me a csd file that  
demonstrates your failure as it was OK here
==John ff

Quoting mesca <<a href="x-msg://4/user/SendEmail.jtp?type=node&amp;node=5735646&amp;i=0" target="_top" rel="nofollow" link="external">[hidden email]>:

> Just built the latest devel branch. It now works with simple arrays  
> but not with multi-dimensional ones.
>
> Le 2 juin 2014 à 14:23, jpff [via Csound]  
> <<a href="x-msg://4/user/SendEmail.jtp?type=node&amp;node=5735646&amp;i=1" target="_top" rel="nofollow" link="external">[hidden email]> a écrit :
>
>> I have not checked 2-d arrays.  May not work.
>>
>> This is a real can of worms
>>
>> Quoting Tarmo Johannes <[hidden email]>:
>>
>> > Hi,
>> >
>> > It was recently fixed it in git. If you can pull and build the
>> > develop branch,
>> > it should be OK. (well I tested with one dimentional array and it  
>> worked, I
>> > think two dimentions should be OK as well).
>> >
>> > best!
>> > tarmo
>> >
>> > On Monday 02 June 2014 13:56:59 Pierre Clisson wrote:
>> >> Hi all,
>> >>
>> >> I need to init a variable with a value taken from a k-array.
>> >> In a perfect world, this would have worked:
>> >>
>> >> ivalue = i(gkarray[p4][p5])
>> >>
>> >> But unfortunately, it produces a parsing error ("Use of i() with  
>> expression
>> >> not permitted"). Is it the intended behavior or a bug? In my  
>> specific case,
>> >> I can rely on a workaround with the reinit opcode, but it is  
>> very ugly and
>> >> verbose.
>> >>
>> >> --
>> >> Pierre
>
>
>
>
>
> --
> View this message in context:  
> http://csound.1045644.n5.nabble.com/i-and-arrays-tp5735642p5735645.html
> Sent from the Csound - General mailing list archive at Nabble.com.
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> To unsubscribe, send email <a href="x-msg://4/user/SendEmail.jtp?type=node&amp;node=5735646&amp;i=2" target="_top" rel="nofollow" link="external">[hidden email] with body  
> "unsubscribe csound"




Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
To unsubscribe, send email <a href="x-msg://4/user/SendEmail.jtp?type=node&amp;node=5735646&amp;i=3" target="_top" rel="nofollow" link="external">[hidden email] with body "unsubscribe csound"






If you reply to this email, your message will be added to the discussion below:
http://csound.1045644.n5.nabble.com/i-and-arrays-tp5735642p5735646.html
To unsubscribe from i() and arrays, click here.
NAML



View this message in context: Re:
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-06-02 17:54
Fromjpff@cs.bath.ac.uk
Subject[Csnd] Re:
AttachmentsNone  

Date2014-06-02 18:01
Fromjoachim heintz
SubjectRe: [Csnd] Re:
it works for me as well (linux).
	joachim


Am 02.06.2014 18:54, schrieb jpff@cs.bath.ac.uk:
> works for me; all run with what looks like correct result. (results at end)
>
> I did tidy/improve the code; still will fail on i(kk[ii[0]]) I suspect
>   As I said this is a can of worms.  Can you re-oull, build and try to
> see if I somehow fixed it by mistake
>
> Quoting mesca :
>
>> The bug appears when one of the index is a variable, whatever its rate
>> and whatever the number of dimensions:
>>
>> 
>> 
>> -o dac
>> 
>> 
>>
>> sr = 44100
>> ksmps = 128
>> nchnls = 2
>> 0dbfs = 1
>>
>> gkarr1[] init 2
>> gkarr2[][] init 2, 2
>>
>> instr set
>>   gkarr1[0] = 1
>>   gkarr2[0][0] = 1
>> endin
>>
>> instr get
>>   i1 = i(gkarr1[0]) ; ok
>>   i2 = i(gkarr2[0][0]) ; ok
>>   i3 = i(gkarr1[p4]) ; fail
>>   i4 = i(gkarr2[p4][p4]) ; fail
>>   print i1
>>   print i2
>>   print i3
>>   print i4
>> endin
>>
>> 
>> 
>>
>> i "set" 0 1
>> i "get" 1 1 0
>>
>> e
>>
>> 
>> 
>>
> ....
> STARTING FILE
> Creating options
> Creating orchestra
> Creating score
> rtaudio: ALSA module enabled
> rtmidi: ALSA Raw MIDI module enabled
> instr set uses instrument number 1
> instr get uses instrument number 2
> Elapsed time at end of orchestra compile: real: 0.003s, CPU: 0.003s
> sorting score ...
>          ... done
> Elapsed time at end of score sort: real: 0.003s, CPU: 0.003s
> --Csound version 6.03.2 (double samples) May 31 2014
> graphics suppressed, ascii substituted
> 0dBFS level = 1.0
> orch now loaded
> audio buffered in 256 sample-frame blocks
> not writing to sound disk
> SECTION 1:
> new alloc for instr set:
> B  0.000 ..  1.000 T  1.001 TT  1.001 M:  0.00000  0.00000
> new alloc for instr get:
> instr 2:  i1 = 1.000
> instr 2:  i2 = 1.000
> instr 2:  i3 = 1.000
> instr 2:  i4 = 1.000
> B  1.000 ..  2.000 T  2.000 TT  2.000 M:  0.00000  0.00000
> Score finished in csoundPerform().
> inactive allocs returned to freespace
> end of score.              overall amps:  0.00000  0.00000
>             overall samples out of range:        0        0
> 0 errors in performance
> Elapsed time at end of performance: real: 0.004s, CPU: 0.004s
>
>
>
>
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>
>
>

Date2014-06-02 19:55
Frommesca
Subject[Csnd] Re:

I am on Mac OS X and updated csound via homebrew with "brew -v install --devel csound"

But I did not notice --devel was actually pointing to sourceforge and not github, so I was not actually building the develop branch.
Unfortunately, "brew -v uninstall csound && brew -v install --HEAD csound" seems to be broken. Probably on my side, I will look into it.
Anyway, sorry for the noise, will try to fix my homebrew mess or build csound on a Linux box.

Thanks

Le 2 juin 2014 à 19:03, joachim-3 [via Csound] <[hidden email]> a écrit :

it works for me as well (linux). 
        joachim 


Am 02.06.2014 18:54, schrieb <a href="x-msg://12/user/SendEmail.jtp?type=node&amp;node=5735650&amp;i=0" target="_top" rel="nofollow" link="external">[hidden email]:

> works for me; all run with what looks like correct result. (results at end) 
> 
> I did tidy/improve the code; still will fail on i(kk[ii[0]]) I suspect 
>   As I said this is a can of worms.  Can you re-oull, build and try to 
> see if I somehow fixed it by mistake 
> 
> Quoting mesca <<a href="x-msg://12/user/SendEmail.jtp?type=node&amp;node=5735650&amp;i=1" target="_top" rel="nofollow" link="external">[hidden email]>: 
> 
>> The bug appears when one of the index is a variable, whatever its rate 
>> and whatever the number of dimensions: 
>> 
>> <CsoundSynthesizer> 
>> <CsOptions> 
>> -o dac 
>> </CsOptions> 
>> <CsInstruments> 
>> 
>> sr = 44100 
>> ksmps = 128 
>> nchnls = 2 
>> 0dbfs = 1 
>> 
>> gkarr1[] init 2 
>> gkarr2[][] init 2, 2 
>> 
>> instr set 
>>   gkarr1[0] = 1 
>>   gkarr2[0][0] = 1 
>> endin 
>> 
>> instr get 
>>   i1 = i(gkarr1[0]) ; ok 
>>   i2 = i(gkarr2[0][0]) ; ok 
>>   i3 = i(gkarr1[p4]) ; fail 
>>   i4 = i(gkarr2[p4][p4]) ; fail 
>>   print i1 
>>   print i2 
>>   print i3 
>>   print i4 
>> endin 
>> 
>> </CsInstruments> 
>> <CsScore> 
>> 
>> i "set" 0 1 
>> i "get" 1 1 0 
>> 
>> e 
>> 
>> </CsScore> 
>> </CsoundSynthesizer> 
>> 
> .... 
> STARTING FILE 
> Creating options 
> Creating orchestra 
> Creating score 
> rtaudio: ALSA module enabled 
> rtmidi: ALSA Raw MIDI module enabled 
> instr set uses instrument number 1 
> instr get uses instrument number 2 
> Elapsed time at end of orchestra compile: real: 0.003s, CPU: 0.003s 
> sorting score ... 
>          ... done 
> Elapsed time at end of score sort: real: 0.003s, CPU: 0.003s 
> --Csound version 6.03.2 (double samples) May 31 2014 
> graphics suppressed, ascii substituted 
> 0dBFS level = 1.0 
> orch now loaded 
> audio buffered in 256 sample-frame blocks 
> not writing to sound disk 
> SECTION 1: 
> new alloc for instr set: 
> B  0.000 ..  1.000 T  1.001 TT  1.001 M:  0.00000  0.00000 
> new alloc for instr get: 
> instr 2:  i1 = 1.000 
> instr 2:  i2 = 1.000 
> instr 2:  i3 = 1.000 
> instr 2:  i4 = 1.000 
> B  1.000 ..  2.000 T  2.000 TT  2.000 M:  0.00000  0.00000 
> Score finished in csoundPerform(). 
> inactive allocs returned to freespace 
> end of score.              overall amps:  0.00000  0.00000 
>             overall samples out of range:        0        0 
> 0 errors in performance 
> Elapsed time at end of performance: real: 0.004s, CPU: 0.004s 
> 
> 
> 
> 
> Send bugs reports to 
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here 
> To unsubscribe, send email <a href="x-msg://12/user/SendEmail.jtp?type=node&amp;node=5735650&amp;i=2" target="_top" rel="nofollow" link="external">[hidden email] with body "unsubscribe 
> csound" 
> 
> 
> 
>

Send bugs reports to 
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here 
To unsubscribe, send email <a href="x-msg://12/user/SendEmail.jtp?type=node&amp;node=5735650&amp;i=3" target="_top" rel="nofollow" link="external">[hidden email] with body "unsubscribe csound" 






If you reply to this email, your message will be added to the discussion below:
http://csound.1045644.n5.nabble.com/i-and-arrays-tp5735642p5735650.html
To unsubscribe from i() and arrays, click here.
NAML



View this message in context: Re:
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-06-02 20:18
Fromjpff@cs.bath.ac.uk
Subject[Csnd] Re:
AttachmentsNone  

Date2014-06-02 20:59
Frommesca
Subject[Csnd] Re:
Build fails on Mac OS X. I wasn't seeing anything with the -j cmake flag so I removed it. Now I have:


[ 70%] Building CXX object interfaces/CMakeFiles/libcsnd6.dir/csPerfThread.cpp.o
cd /tmp/csound-KMJH/interfaces && /usr/local/Library/ENV/4.3/clang++   -DCS_DEFAULT_PLUGINDIR=\"/Users/mesca/Library/Frameworks/CsoundLib64.framework/Versions/6.0/Resources/Opcodes64\" -DHAVE_SOCKETS -DHAVE_SPRINTF_L -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DMACOSX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -Dlibcsnd6_EXPORTS -ffast-math -msse2 -fomit-frame-pointer -DHAVE_ATOMIC_BUILTIN -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/ -mmacosx-version-min=10.7 -fPIC -I/usr/local/include -I/tmp/csound-KMJH/./H -I/tmp/csound-KMJH/./include -I/tmp/csound-KMJH/./Engine -I/tmp/csound-KMJH/. -I/tmp/csound-KMJH -I/tmp/csound-KMJH/include -I/tmp/csound-KMJH/interfaces -I/usr/include/python2.7 -I/System/Library/Frameworks/JavaVM.framework/Headers -I/usr/local/include/luajit-2.0    -o CMakeFiles/libcsnd6.dir/csPerfThread.cpp.o -c /tmp/csound-KMJH/interfaces/csPerfThread.cpp
/tmp/csound-KMJH/interfaces/csPerfThread.cpp:480:24: error: expected expression
    recordData.mutex = PTHREAD_MUTEX_INITIALIZER;
                       ^
/usr/include/pthread.h:177:35: note: expanded from macro 'PTHREAD_MUTEX_INITIALIZER'
#define PTHREAD_MUTEX_INITIALIZER {_PTHREAD_MUTEX_SIG_init, {0}}
                                  ^
/tmp/csound-KMJH/interfaces/csPerfThread.cpp:481:26: error: expected expression
    recordData.condvar = PTHREAD_COND_INITIALIZER;
                         ^
/usr/include/pthread.h:195:34: note: expanded from macro 'PTHREAD_COND_INITIALIZER'
#define PTHREAD_COND_INITIALIZER {_PTHREAD_COND_SIG_init, {0}}
                                 ^
2 errors generated.
make[2]: *** [interfaces/CMakeFiles/libcsnd6.dir/csPerfThread.cpp.o] Error 1
make[1]: *** [interfaces/CMakeFiles/libcsnd6.dir/all] Error 2
make: *** [all] Error 2




Le 2 juin 2014 à 21:19, jpff [via Csound] <[hidden email]> a écrit :

> ~I think I forgot p variables as i-rate.  Will fix later -- busy now
> ==John ff
>
> Quoting mesca <[hidden email]>:
>
> > I am on Mac OS X and updated csound via homebrew with "brew -v  
> > install --devel csound"
> > But I did not notice --devel was actually pointing to sourceforge  
> > and not github, so I was not actually building the develop branch.
> > Unfortunately, "brew -v uninstall csound && brew -v install --HEAD  
> > csound" seems to be broken. Probably on my side, I will look into it.
> > Anyway, sorry for the noise, will try to fix my homebrew mess or  
> > build csound on a Linux box.
> >
> > Thanks
> >
> > Le 2 juin 2014 à 19:03, joachim-3 [via Csound]  
> > <[hidden email]> a écrit :
> >
> >> it works for me as well (linux).
> >>         joachim
> >>
> >>
> >> Am 02.06.2014 18:54, schrieb [hidden email]:
> >>
> >> > works for me; all run with what looks like correct result.  
> >> (results at end)
> >> >
> >> > I did tidy/improve the code; still will fail on i(kk[ii[0]]) I suspect
> >> >   As I said this is a can of worms.  Can you re-oull, build and try to
> >> > see if I somehow fixed it by mistake
> >> >
> >> > Quoting mesca <[hidden email]>:
> >> >
> >> >> The bug appears when one of the index is a variable, whatever its rate
> >> >> and whatever the number of dimensions:
> >> >>
> >> >> <CsoundSynthesizer>
> >> >> <CsOptions>
> >> >> -o dac
> >> >> </CsOptions>
> >> >> <CsInstruments>
> >> >>
> >> >> sr = 44100
> >> >> ksmps = 128
> >> >> nchnls = 2
> >> >> 0dbfs = 1
> >> >>
> >> >> gkarr1[] init 2
> >> >> gkarr2[][] init 2, 2
> >> >>
> >> >> instr set
> >> >>   gkarr1[0] = 1
> >> >>   gkarr2[0][0] = 1
> >> >> endin
> >> >>
> >> >> instr get
> >> >>   i1 = i(gkarr1[0]) ; ok
> >> >>   i2 = i(gkarr2[0][0]) ; ok
> >> >>   i3 = i(gkarr1[p4]) ; fail
> >> >>   i4 = i(gkarr2[p4][p4]) ; fail
> >> >>   print i1
> >> >>   print i2
> >> >>   print i3
> >> >>   print i4
> >> >> endin
> >> >>
> >> >> </CsInstruments>
> >> >> <CsScore>
> >> >>
> >> >> i "set" 0 1
> >> >> i "get" 1 1 0
> >> >>
> >> >> e
> >> >>
> >> >> </CsScore>
> >> >> </CsoundSynthesizer>
> >> >>
> >> > ....
> >> > STARTING FILE
> >> > Creating options
> >> > Creating orchestra
> >> > Creating score
> >> > rtaudio: ALSA module enabled
> >> > rtmidi: ALSA Raw MIDI module enabled
> >> > instr set uses instrument number 1
> >> > instr get uses instrument number 2
> >> > Elapsed time at end of orchestra compile: real: 0.003s, CPU: 0.003s
> >> > sorting score ...
> >> >          ... done
> >> > Elapsed time at end of score sort: real: 0.003s, CPU: 0.003s
> >> > --Csound version 6.03.2 (double samples) May 31 2014
> >> > graphics suppressed, ascii substituted
> >> > 0dBFS level = 1.0
> >> > orch now loaded
> >> > audio buffered in 256 sample-frame blocks
> >> > not writing to sound disk
> >> > SECTION 1:
> >> > new alloc for instr set:
> >> > B  0.000 ..  1.000 T  1.001 TT  1.001 M:  0.00000  0.00000
> >> > new alloc for instr get:
> >> > instr 2:  i1 = 1.000
> >> > instr 2:  i2 = 1.000
> >> > instr 2:  i3 = 1.000
> >> > instr 2:  i4 = 1.000
> >> > B  1.000 ..  2.000 T  2.000 TT  2.000 M:  0.00000  0.00000
> >> > Score finished in csoundPerform().
> >> > inactive allocs returned to freespace
> >> > end of score.              overall amps:  0.00000  0.00000
> >> >             overall samples out of range:        0        0
> >> > 0 errors in performance
> >> > Elapsed time at end of performance: real: 0.004s, CPU: 0.004s



View this message in context: Re:
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-06-02 21:12
FromVictor Lazzarini
Subject[Csnd] failed to build
Looks like some new code by Andres from Friday. It doesn’t build here either.
========================
Dr Victor Lazzarini
Senior Lecturer
NUI Maynooth, Ireland
victor dot lazzarini at nuim dot ie




On 2 Jun 2014, at 20:59, mesca  wrote:

> Build fails on Mac OS X. I wasn't seeing anything with the -j cmake flag so I removed it. Now I have: 
> 
> 
> [ 70%] Building CXX object interfaces/CMakeFiles/libcsnd6.dir/csPerfThread.cpp.o 
> cd /tmp/csound-KMJH/interfaces && /usr/local/Library/ENV/4.3/clang++   -DCS_DEFAULT_PLUGINDIR=\"/Users/mesca/Library/Frameworks/CsoundLib64.framework/Versions/6.0/Resources/Opcodes64\" -DHAVE_SOCKETS -DHAVE_SPRINTF_L -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DMACOSX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -Dlibcsnd6_EXPORTS -ffast-math -msse2 -fomit-frame-pointer -DHAVE_ATOMIC_BUILTIN -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/ -mmacosx-version-min=10.7 -fPIC -I/usr/local/include -I/tmp/csound-KMJH/./H -I/tmp/csound-KMJH/./include -I/tmp/csound-KMJH/./Engine -I/tmp/csound-KMJH/. -I/tmp/csound-KMJH -I/tmp/csound-KMJH/include -I/tmp/csound-KMJH/interfaces -I/usr/include/python2.7 -I/System/Library/Frameworks/JavaVM.framework/Headers -I/usr/local/include/luajit-2.0    -o CMakeFiles/libcsnd6.dir/csPerfThread.cpp.o -c /tmp/csound-KMJH/interfaces/csPerfThread.cpp 
> /tmp/csound-KMJH/interfaces/csPerfThread.cpp:480:24: error: expected expression 
>     recordData.mutex = PTHREAD_MUTEX_INITIALIZER; 
>                        ^ 
> /usr/include/pthread.h:177:35: note: expanded from macro 'PTHREAD_MUTEX_INITIALIZER' 
> #define PTHREAD_MUTEX_INITIALIZER {_PTHREAD_MUTEX_SIG_init, {0}} 
>                                   ^ 
> /tmp/csound-KMJH/interfaces/csPerfThread.cpp:481:26: error: expected expression 
>     recordData.condvar = PTHREAD_COND_INITIALIZER; 
>                          ^ 
> /usr/include/pthread.h:195:34: note: expanded from macro 'PTHREAD_COND_INITIALIZER' 
> #define PTHREAD_COND_INITIALIZER {_PTHREAD_COND_SIG_init, {0}} 
>                                  ^ 
> 2 errors generated. 
> make[2]: *** [interfaces/CMakeFiles/libcsnd6.dir/csPerfThread.cpp.o] Error 1 
> make[1]: *** [interfaces/CMakeFiles/libcsnd6.dir/all] Error 2 
> make: *** [all] Error 2 
> 
> 
> 
> 
> Le 2 juin 2014 à 21:19, jpff [via Csound] <[hidden email]> a écrit : 
> 
> > ~I think I forgot p variables as i-rate.  Will fix later -- busy now 
> > ==John ff 
> > 
> > Quoting mesca <[hidden email]>: 
> > 
> > > I am on Mac OS X and updated csound via homebrew with "brew -v   
> > > install --devel csound" 
> > > But I did not notice --devel was actually pointing to sourceforge   
> > > and not github, so I was not actually building the develop branch. 
> > > Unfortunately, "brew -v uninstall csound && brew -v install --HEAD   
> > > csound" seems to be broken. Probably on my side, I will look into it. 
> > > Anyway, sorry for the noise, will try to fix my homebrew mess or   
> > > build csound on a Linux box. 
> > > 
> > > Thanks 
> > > 
> > > Le 2 juin 2014 à 19:03, joachim-3 [via Csound]   
> > > <[hidden email]> a écrit : 
> > > 
> > >> it works for me as well (linux). 
> > >>         joachim 
> > >> 
> > >> 
> > >> Am 02.06.2014 18:54, schrieb [hidden email]: 
> > >> 
> > >> > works for me; all run with what looks like correct result.   
> > >> (results at end) 
> > >> > 
> > >> > I did tidy/improve the code; still will fail on i(kk[ii[0]]) I suspect 
> > >> >   As I said this is a can of worms.  Can you re-oull, build and try to 
> > >> > see if I somehow fixed it by mistake 
> > >> > 
> > >> > Quoting mesca <[hidden email]>: 
> > >> > 
> > >> >> The bug appears when one of the index is a variable, whatever its rate 
> > >> >> and whatever the number of dimensions: 
> > >> >> 
> > >> >>  
> > >> >>  
> > >> >> -o dac 
> > >> >>  
> > >> >>  
> > >> >> 
> > >> >> sr = 44100 
> > >> >> ksmps = 128 
> > >> >> nchnls = 2 
> > >> >> 0dbfs = 1 
> > >> >> 
> > >> >> gkarr1[] init 2 
> > >> >> gkarr2[][] init 2, 2 
> > >> >> 
> > >> >> instr set 
> > >> >>   gkarr1[0] = 1 
> > >> >>   gkarr2[0][0] = 1 
> > >> >> endin 
> > >> >> 
> > >> >> instr get 
> > >> >>   i1 = i(gkarr1[0]) ; ok 
> > >> >>   i2 = i(gkarr2[0][0]) ; ok 
> > >> >>   i3 = i(gkarr1[p4]) ; fail 
> > >> >>   i4 = i(gkarr2[p4][p4]) ; fail 
> > >> >>   print i1 
> > >> >>   print i2 
> > >> >>   print i3 
> > >> >>   print i4 
> > >> >> endin 
> > >> >> 
> > >> >>  
> > >> >>  
> > >> >> 
> > >> >> i "set" 0 1 
> > >> >> i "get" 1 1 0 
> > >> >> 
> > >> >> e 
> > >> >> 
> > >> >>  
> > >> >>  
> > >> >> 
> > >> > .... 
> > >> > STARTING FILE 
> > >> > Creating options 
> > >> > Creating orchestra 
> > >> > Creating score 
> > >> > rtaudio: ALSA module enabled 
> > >> > rtmidi: ALSA Raw MIDI module enabled 
> > >> > instr set uses instrument number 1 
> > >> > instr get uses instrument number 2 
> > >> > Elapsed time at end of orchestra compile: real: 0.003s, CPU: 0.003s 
> > >> > sorting score ... 
> > >> >          ... done 
> > >> > Elapsed time at end of score sort: real: 0.003s, CPU: 0.003s 
> > >> > --Csound version 6.03.2 (double samples) May 31 2014 
> > >> > graphics suppressed, ascii substituted 
> > >> > 0dBFS level = 1.0 
> > >> > orch now loaded 
> > >> > audio buffered in 256 sample-frame blocks 
> > >> > not writing to sound disk 
> > >> > SECTION 1: 
> > >> > new alloc for instr set: 
> > >> > B  0.000 ..  1.000 T  1.001 TT  1.001 M:  0.00000  0.00000 
> > >> > new alloc for instr get: 
> > >> > instr 2:  i1 = 1.000 
> > >> > instr 2:  i2 = 1.000 
> > >> > instr 2:  i3 = 1.000 
> > >> > instr 2:  i4 = 1.000 
> > >> > B  1.000 ..  2.000 T  2.000 TT  2.000 M:  0.00000  0.00000 
> > >> > Score finished in csoundPerform(). 
> > >> > inactive allocs returned to freespace 
> > >> > end of score.              overall amps:  0.00000  0.00000 
> > >> >             overall samples out of range:        0        0 
> > >> > 0 errors in performance 
> > >> > Elapsed time at end of performance: real: 0.004s, CPU: 0.004s
> 
> 
> View this message in context: Re:
> Sent from the Csound - General mailing list archive at Nabble.com.



Date2014-06-02 21:26
FromVictor Lazzarini
SubjectRe: [Csnd] Re:
I fixed the build.

========================
Dr Victor Lazzarini
Senior Lecturer
NUI Maynooth, Ireland
victor dot lazzarini at nuim dot ie




On 2 Jun 2014, at 20:59, mesca  wrote:

> Build fails on Mac OS X. I wasn't seeing anything with the -j cmake flag so I removed it. Now I have: 
> 
> 
> [ 70%] Building CXX object interfaces/CMakeFiles/libcsnd6.dir/csPerfThread.cpp.o 
> cd /tmp/csound-KMJH/interfaces && /usr/local/Library/ENV/4.3/clang++   -DCS_DEFAULT_PLUGINDIR=\"/Users/mesca/Library/Frameworks/CsoundLib64.framework/Versions/6.0/Resources/Opcodes64\" -DHAVE_SOCKETS -DHAVE_SPRINTF_L -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DMACOSX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -Dlibcsnd6_EXPORTS -ffast-math -msse2 -fomit-frame-pointer -DHAVE_ATOMIC_BUILTIN -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/ -mmacosx-version-min=10.7 -fPIC -I/usr/local/include -I/tmp/csound-KMJH/./H -I/tmp/csound-KMJH/./include -I/tmp/csound-KMJH/./Engine -I/tmp/csound-KMJH/. -I/tmp/csound-KMJH -I/tmp/csound-KMJH/include -I/tmp/csound-KMJH/interfaces -I/usr/include/python2.7 -I/System/Library/Frameworks/JavaVM.framework/Headers -I/usr/local/include/luajit-2.0    -o CMakeFiles/libcsnd6.dir/csPerfThread.cpp.o -c /tmp/csound-KMJH/interfaces/csPerfThread.cpp 
> /tmp/csound-KMJH/interfaces/csPerfThread.cpp:480:24: error: expected expression 
>     recordData.mutex = PTHREAD_MUTEX_INITIALIZER; 
>                        ^ 
> /usr/include/pthread.h:177:35: note: expanded from macro 'PTHREAD_MUTEX_INITIALIZER' 
> #define PTHREAD_MUTEX_INITIALIZER {_PTHREAD_MUTEX_SIG_init, {0}} 
>                                   ^ 
> /tmp/csound-KMJH/interfaces/csPerfThread.cpp:481:26: error: expected expression 
>     recordData.condvar = PTHREAD_COND_INITIALIZER; 
>                          ^ 
> /usr/include/pthread.h:195:34: note: expanded from macro 'PTHREAD_COND_INITIALIZER' 
> #define PTHREAD_COND_INITIALIZER {_PTHREAD_COND_SIG_init, {0}} 
>                                  ^ 
> 2 errors generated. 
> make[2]: *** [interfaces/CMakeFiles/libcsnd6.dir/csPerfThread.cpp.o] Error 1 
> make[1]: *** [interfaces/CMakeFiles/libcsnd6.dir/all] Error 2 
> make: *** [all] Error 2 
> 
> 
> 
> 
> Le 2 juin 2014 à 21:19, jpff [via Csound] <[hidden email]> a écrit : 
> 
> > ~I think I forgot p variables as i-rate.  Will fix later -- busy now 
> > ==John ff 
> > 
> > Quoting mesca <[hidden email]>: 
> > 
> > > I am on Mac OS X and updated csound via homebrew with "brew -v   
> > > install --devel csound" 
> > > But I did not notice --devel was actually pointing to sourceforge   
> > > and not github, so I was not actually building the develop branch. 
> > > Unfortunately, "brew -v uninstall csound && brew -v install --HEAD   
> > > csound" seems to be broken. Probably on my side, I will look into it. 
> > > Anyway, sorry for the noise, will try to fix my homebrew mess or   
> > > build csound on a Linux box. 
> > > 
> > > Thanks 
> > > 
> > > Le 2 juin 2014 à 19:03, joachim-3 [via Csound]   
> > > <[hidden email]> a écrit : 
> > > 
> > >> it works for me as well (linux). 
> > >>         joachim 
> > >> 
> > >> 
> > >> Am 02.06.2014 18:54, schrieb [hidden email]: 
> > >> 
> > >> > works for me; all run with what looks like correct result.   
> > >> (results at end) 
> > >> > 
> > >> > I did tidy/improve the code; still will fail on i(kk[ii[0]]) I suspect 
> > >> >   As I said this is a can of worms.  Can you re-oull, build and try to 
> > >> > see if I somehow fixed it by mistake 
> > >> > 
> > >> > Quoting mesca <[hidden email]>: 
> > >> > 
> > >> >> The bug appears when one of the index is a variable, whatever its rate 
> > >> >> and whatever the number of dimensions: 
> > >> >> 
> > >> >>  
> > >> >>  
> > >> >> -o dac 
> > >> >>  
> > >> >>  
> > >> >> 
> > >> >> sr = 44100 
> > >> >> ksmps = 128 
> > >> >> nchnls = 2 
> > >> >> 0dbfs = 1 
> > >> >> 
> > >> >> gkarr1[] init 2 
> > >> >> gkarr2[][] init 2, 2 
> > >> >> 
> > >> >> instr set 
> > >> >>   gkarr1[0] = 1 
> > >> >>   gkarr2[0][0] = 1 
> > >> >> endin 
> > >> >> 
> > >> >> instr get 
> > >> >>   i1 = i(gkarr1[0]) ; ok 
> > >> >>   i2 = i(gkarr2[0][0]) ; ok 
> > >> >>   i3 = i(gkarr1[p4]) ; fail 
> > >> >>   i4 = i(gkarr2[p4][p4]) ; fail 
> > >> >>   print i1 
> > >> >>   print i2 
> > >> >>   print i3 
> > >> >>   print i4 
> > >> >> endin 
> > >> >> 
> > >> >>  
> > >> >>  
> > >> >> 
> > >> >> i "set" 0 1 
> > >> >> i "get" 1 1 0 
> > >> >> 
> > >> >> e 
> > >> >> 
> > >> >>  
> > >> >>  
> > >> >> 
> > >> > .... 
> > >> > STARTING FILE 
> > >> > Creating options 
> > >> > Creating orchestra 
> > >> > Creating score 
> > >> > rtaudio: ALSA module enabled 
> > >> > rtmidi: ALSA Raw MIDI module enabled 
> > >> > instr set uses instrument number 1 
> > >> > instr get uses instrument number 2 
> > >> > Elapsed time at end of orchestra compile: real: 0.003s, CPU: 0.003s 
> > >> > sorting score ... 
> > >> >          ... done 
> > >> > Elapsed time at end of score sort: real: 0.003s, CPU: 0.003s 
> > >> > --Csound version 6.03.2 (double samples) May 31 2014 
> > >> > graphics suppressed, ascii substituted 
> > >> > 0dBFS level = 1.0 
> > >> > orch now loaded 
> > >> > audio buffered in 256 sample-frame blocks 
> > >> > not writing to sound disk 
> > >> > SECTION 1: 
> > >> > new alloc for instr set: 
> > >> > B  0.000 ..  1.000 T  1.001 TT  1.001 M:  0.00000  0.00000 
> > >> > new alloc for instr get: 
> > >> > instr 2:  i1 = 1.000 
> > >> > instr 2:  i2 = 1.000 
> > >> > instr 2:  i3 = 1.000 
> > >> > instr 2:  i4 = 1.000 
> > >> > B  1.000 ..  2.000 T  2.000 TT  2.000 M:  0.00000  0.00000 
> > >> > Score finished in csoundPerform(). 
> > >> > inactive allocs returned to freespace 
> > >> > end of score.              overall amps:  0.00000  0.00000 
> > >> >             overall samples out of range:        0        0 
> > >> > 0 errors in performance 
> > >> > Elapsed time at end of performance: real: 0.004s, CPU: 0.004s
> 
> 
> View this message in context: Re:
> Sent from the Csound - General mailing list archive at Nabble.com.



Date2014-06-02 21:36
Frommesca
Subject[Csnd] Re:

Yep, build succeed. And now, i() works with arrays (nearly) as expected.

Thanks everyone!

Le 2 juin 2014 à 22:27, Victor Lazzarini [via Csound] <[hidden email]> a écrit :

I fixed the build. 

======================== 
Dr Victor Lazzarini 
Senior Lecturer 
NUI Maynooth, Ireland 
victor dot lazzarini at nuim dot ie 




On 2 Jun 2014, at 20:59, mesca <<a href="x-msg://21/user/SendEmail.jtp?type=node&amp;node=5735662&amp;i=0" target="_top" rel="nofollow" link="external">[hidden email]> wrote: 

> Build fails on Mac OS X. I wasn't seeing anything with the -j cmake flag so I removed it. Now I have: 
> 
> 
> [ 70%] Building CXX object interfaces/CMakeFiles/libcsnd6.dir/csPerfThread.cpp.o 
> cd /tmp/csound-KMJH/interfaces && /usr/local/Library/ENV/4.3/clang++   -DCS_DEFAULT_PLUGINDIR=\"/Users/mesca/Library/Frameworks/CsoundLib64.framework/Versions/6.0/Resources/Opcodes64\" -DHAVE_SOCKETS -DHAVE_SPRINTF_L -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DMACOSX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -Dlibcsnd6_EXPORTS -ffast-math -msse2 -fomit-frame-pointer -DHAVE_ATOMIC_BUILTIN -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/ -mmacosx-version-min=10.7 -fPIC -I/usr/local/include -I/tmp/csound-KMJH/./H -I/tmp/csound-KMJH/./include -I/tmp/csound-KMJH/./Engine -I/tmp/csound-KMJH/. -I/tmp/csound-KMJH -I/tmp/csound-KMJH/include -I/tmp/csound-KMJH/interfaces -I/usr/include/python2.7 -I/System/Library/Frameworks/JavaVM.framework/Headers -I/usr/local/include/luajit-2.0    -o CMakeFiles/libcsnd6.dir/csPerfThread.cpp.o -c /tmp/csound-KMJH/interfaces/csPerfThread.cpp 
> /tmp/csound-KMJH/interfaces/csPerfThread.cpp:480:24: error: expected expression 
>     recordData.mutex = PTHREAD_MUTEX_INITIALIZER; 
>                        ^ 
> /usr/include/pthread.h:177:35: note: expanded from macro 'PTHREAD_MUTEX_INITIALIZER' 
> #define PTHREAD_MUTEX_INITIALIZER {_PTHREAD_MUTEX_SIG_init, {0}} 
>                                   ^ 
> /tmp/csound-KMJH/interfaces/csPerfThread.cpp:481:26: error: expected expression 
>     recordData.condvar = PTHREAD_COND_INITIALIZER; 
>                          ^ 
> /usr/include/pthread.h:195:34: note: expanded from macro 'PTHREAD_COND_INITIALIZER' 
> #define PTHREAD_COND_INITIALIZER {_PTHREAD_COND_SIG_init, {0}} 
>                                  ^ 
> 2 errors generated. 
> make[2]: *** [interfaces/CMakeFiles/libcsnd6.dir/csPerfThread.cpp.o] Error 1 
> make[1]: *** [interfaces/CMakeFiles/libcsnd6.dir/all] Error 2 
> make: *** [all] Error 2 
> 
> 
> 
> 
> Le 2 juin 2014 à 21:19, jpff [via Csound] <[hidden email]> a écrit : 
> 
> > ~I think I forgot p variables as i-rate.  Will fix later -- busy now 
> > ==John ff 
> > 
> > Quoting mesca <[hidden email]>: 
> > 
> > > I am on Mac OS X and updated csound via homebrew with "brew -v   
> > > install --devel csound" 
> > > But I did not notice --devel was actually pointing to sourceforge   
> > > and not github, so I was not actually building the develop branch. 
> > > Unfortunately, "brew -v uninstall csound && brew -v install --HEAD   
> > > csound" seems to be broken. Probably on my side, I will look into it. 
> > > Anyway, sorry for the noise, will try to fix my homebrew mess or   
> > > build csound on a Linux box. 
> > > 
> > > Thanks 
> > > 
> > > Le 2 juin 2014 à 19:03, joachim-3 [via Csound]   
> > > <[hidden email]> a écrit : 
> > > 
> > >> it works for me as well (linux). 
> > >>         joachim 
> > >> 
> > >> 
> > >> Am 02.06.2014 18:54, schrieb [hidden email]: 
> > >> 
> > >> > works for me; all run with what looks like correct result.   
> > >> (results at end) 
> > >> > 
> > >> > I did tidy/improve the code; still will fail on i(kk[ii[0]]) I suspect 
> > >> >   As I said this is a can of worms.  Can you re-oull, build and try to 
> > >> > see if I somehow fixed it by mistake 
> > >> > 
> > >> > Quoting mesca <[hidden email]>: 
> > >> > 
> > >> >> The bug appears when one of the index is a variable, whatever its rate 
> > >> >> and whatever the number of dimensions: 
> > >> >> 
> > >> >> <CsoundSynthesizer> 
> > >> >> <CsOptions> 
> > >> >> -o dac 
> > >> >> </CsOptions> 
> > >> >> <CsInstruments> 
> > >> >> 
> > >> >> sr = 44100 
> > >> >> ksmps = 128 
> > >> >> nchnls = 2 
> > >> >> 0dbfs = 1 
> > >> >> 
> > >> >> gkarr1[] init 2 
> > >> >> gkarr2[][] init 2, 2 
> > >> >> 
> > >> >> instr set 
> > >> >>   gkarr1[0] = 1 
> > >> >>   gkarr2[0][0] = 1 
> > >> >> endin 
> > >> >> 
> > >> >> instr get 
> > >> >>   i1 = i(gkarr1[0]) ; ok 
> > >> >>   i2 = i(gkarr2[0][0]) ; ok 
> > >> >>   i3 = i(gkarr1[p4]) ; fail 
> > >> >>   i4 = i(gkarr2[p4][p4]) ; fail 
> > >> >>   print i1 
> > >> >>   print i2 
> > >> >>   print i3 
> > >> >>   print i4 
> > >> >> endin 
> > >> >> 
> > >> >> </CsInstruments> 
> > >> >> <CsScore> 
> > >> >> 
> > >> >> i "set" 0 1 
> > >> >> i "get" 1 1 0 
> > >> >> 
> > >> >> e 
> > >> >> 
> > >> >> </CsScore> 
> > >> >> </CsoundSynthesizer> 
> > >> >> 
> > >> > .... 
> > >> > STARTING FILE 
> > >> > Creating options 
> > >> > Creating orchestra 
> > >> > Creating score 
> > >> > rtaudio: ALSA module enabled 
> > >> > rtmidi: ALSA Raw MIDI module enabled 
> > >> > instr set uses instrument number 1 
> > >> > instr get uses instrument number 2 
> > >> > Elapsed time at end of orchestra compile: real: 0.003s, CPU: 0.003s 
> > >> > sorting score ... 
> > >> >          ... done 
> > >> > Elapsed time at end of score sort: real: 0.003s, CPU: 0.003s 
> > >> > --Csound version 6.03.2 (double samples) May 31 2014 
> > >> > graphics suppressed, ascii substituted 
> > >> > 0dBFS level = 1.0 
> > >> > orch now loaded 
> > >> > audio buffered in 256 sample-frame blocks 
> > >> > not writing to sound disk 
> > >> > SECTION 1: 
> > >> > new alloc for instr set: 
> > >> > B  0.000 ..  1.000 T  1.001 TT  1.001 M:  0.00000  0.00000 
> > >> > new alloc for instr get: 
> > >> > instr 2:  i1 = 1.000 
> > >> > instr 2:  i2 = 1.000 
> > >> > instr 2:  i3 = 1.000 
> > >> > instr 2:  i4 = 1.000 
> > >> > B  1.000 ..  2.000 T  2.000 TT  2.000 M:  0.00000  0.00000 
> > >> > Score finished in csoundPerform(). 
> > >> > inactive allocs returned to freespace 
> > >> > end of score.              overall amps:  0.00000  0.00000 
> > >> >             overall samples out of range:        0        0 
> > >> > 0 errors in performance 
> > >> > Elapsed time at end of performance: real: 0.004s, CPU: 0.004s 
> 
> 
> View this message in context: Re: 
> Sent from the Csound - General mailing list archive at Nabble.com.


Send bugs reports to 
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here 
To unsubscribe, send email <a href="x-msg://21/user/SendEmail.jtp?type=node&amp;node=5735662&amp;i=1" target="_top" rel="nofollow" link="external">[hidden email] with body "unsubscribe csound" 






If you reply to this email, your message will be added to the discussion below:
http://csound.1045644.n5.nabble.com/i-and-arrays-tp5735642p5735662.html
To unsubscribe from i() and arrays, click here.
NAML



View this message in context: Re:
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-06-03 05:41
FromAndres Cabrera
SubjectRe: [Csnd] failed to build
Sorry about that. I've changed the initialization of the pthread stuff to be dynamic to avoid issues, I was still getting a compiler warning with the fixes.

Cheers,
Andrés


On Mon, Jun 2, 2014 at 1:12 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
Looks like some new code by Andres from Friday. It doesn’t build here either.
========================
Dr Victor Lazzarini
Senior Lecturer
NUI Maynooth, Ireland
victor dot lazzarini at nuim dot ie




On 2 Jun 2014, at 20:59, mesca <nabble@clisson.org> wrote:

> Build fails on Mac OS X. I wasn't seeing anything with the -j cmake flag so I removed it. Now I have:
>
>
> [ 70%] Building CXX object interfaces/CMakeFiles/libcsnd6.dir/csPerfThread.cpp.o
> cd /tmp/csound-KMJH/interfaces && /usr/local/Library/ENV/4.3/clang++   -DCS_DEFAULT_PLUGINDIR=\"/Users/mesca/Library/Frameworks/CsoundLib64.framework/Versions/6.0/Resources/Opcodes64\" -DHAVE_SOCKETS -DHAVE_SPRINTF_L -DHAVE_STRTOD_L -DHAVE_STRTOK_R -DMACOSX -DNO_FLTK_THREADS -DPIPES -DUSE_LRINT -D_CSOUND_RELEASE_ -Dlibcsnd6_EXPORTS -ffast-math -msse2 -fomit-frame-pointer -DHAVE_ATOMIC_BUILTIN -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/ -mmacosx-version-min=10.7 -fPIC -I/usr/local/include -I/tmp/csound-KMJH/./H -I/tmp/csound-KMJH/./include -I/tmp/csound-KMJH/./Engine -I/tmp/csound-KMJH/. -I/tmp/csound-KMJH -I/tmp/csound-KMJH/include -I/tmp/csound-KMJH/interfaces -I/usr/include/python2.7 -I/System/Library/Frameworks/JavaVM.framework/Headers -I/usr/local/include/luajit-2.0    -o CMakeFiles/libcsnd6.dir/csPerfThread.cpp.o -c /tmp/csound-KMJH/interfaces/csPerfThread.cpp
> /tmp/csound-KMJH/interfaces/csPerfThread.cpp:480:24: error: expected expression
>     recordData.mutex = PTHREAD_MUTEX_INITIALIZER;
>                        ^
> /usr/include/pthread.h:177:35: note: expanded from macro 'PTHREAD_MUTEX_INITIALIZER'
> #define PTHREAD_MUTEX_INITIALIZER {_PTHREAD_MUTEX_SIG_init, {0}}
>                                   ^
> /tmp/csound-KMJH/interfaces/csPerfThread.cpp:481:26: error: expected expression
>     recordData.condvar = PTHREAD_COND_INITIALIZER;
>                          ^
> /usr/include/pthread.h:195:34: note: expanded from macro 'PTHREAD_COND_INITIALIZER'
> #define PTHREAD_COND_INITIALIZER {_PTHREAD_COND_SIG_init, {0}}
>                                  ^
> 2 errors generated.
> make[2]: *** [interfaces/CMakeFiles/libcsnd6.dir/csPerfThread.cpp.o] Error 1
> make[1]: *** [interfaces/CMakeFiles/libcsnd6.dir/all] Error 2
> make: *** [all] Error 2
>
>
>
>
> Le 2 juin 2014 à 21:19, jpff [via Csound] <[hidden email]> a écrit :
>
> > ~I think I forgot p variables as i-rate.  Will fix later -- busy now
> > ==John ff
> >
> > Quoting mesca <[hidden email]>:
> >
> > > I am on Mac OS X and updated csound via homebrew with "brew -v
> > > install --devel csound"
> > > But I did not notice --devel was actually pointing to sourceforge
> > > and not github, so I was not actually building the develop branch.
> > > Unfortunately, "brew -v uninstall csound && brew -v install --HEAD
> > > csound" seems to be broken. Probably on my side, I will look into it.
> > > Anyway, sorry for the noise, will try to fix my homebrew mess or
> > > build csound on a Linux box.
> > >
> > > Thanks
> > >
> > > Le 2 juin 2014 à 19:03, joachim-3 [via Csound]
> > > <[hidden email]> a écrit :
> > >
> > >> it works for me as well (linux).
> > >>         joachim
> > >>
> > >>
> > >> Am 02.06.2014 18:54, schrieb [hidden email]:
> > >>
> > >> > works for me; all run with what looks like correct result.
> > >> (results at end)
> > >> >
> > >> > I did tidy/improve the code; still will fail on i(kk[ii[0]]) I suspect
> > >> >   As I said this is a can of worms.  Can you re-oull, build and try to
> > >> > see if I somehow fixed it by mistake
> > >> >
> > >> > Quoting mesca <[hidden email]>:
> > >> >
> > >> >> The bug appears when one of the index is a variable, whatever its rate
> > >> >> and whatever the number of dimensions:
> > >> >>
> > >> >> <CsoundSynthesizer>
> > >> >> <CsOptions>
> > >> >> -o dac
> > >> >> </CsOptions>
> > >> >> <CsInstruments>
> > >> >>
> > >> >> sr = 44100
> > >> >> ksmps = 128
> > >> >> nchnls = 2
> > >> >> 0dbfs = 1
> > >> >>
> > >> >> gkarr1[] init 2
> > >> >> gkarr2[][] init 2, 2
> > >> >>
> > >> >> instr set
> > >> >>   gkarr1[0] = 1
> > >> >>   gkarr2[0][0] = 1
> > >> >> endin
> > >> >>
> > >> >> instr get
> > >> >>   i1 = i(gkarr1[0]) ; ok
> > >> >>   i2 = i(gkarr2[0][0]) ; ok
> > >> >>   i3 = i(gkarr1[p4]) ; fail
> > >> >>   i4 = i(gkarr2[p4][p4]) ; fail
> > >> >>   print i1
> > >> >>   print i2
> > >> >>   print i3
> > >> >>   print i4
> > >> >> endin
> > >> >>
> > >> >> </CsInstruments>
> > >> >> <CsScore>
> > >> >>
> > >> >> i "set" 0 1
> > >> >> i "get" 1 1 0
> > >> >>
> > >> >> e
> > >> >>
> > >> >> </CsScore>
> > >> >> </CsoundSynthesizer>
> > >> >>
> > >> > ....
> > >> > STARTING FILE
> > >> > Creating options
> > >> > Creating orchestra
> > >> > Creating score
> > >> > rtaudio: ALSA module enabled
> > >> > rtmidi: ALSA Raw MIDI module enabled
> > >> > instr set uses instrument number 1
> > >> > instr get uses instrument number 2
> > >> > Elapsed time at end of orchestra compile: real: 0.003s, CPU: 0.003s
> > >> > sorting score ...
> > >> >          ... done
> > >> > Elapsed time at end of score sort: real: 0.003s, CPU: 0.003s
> > >> > --Csound version 6.03.2 (double samples) May 31 2014
> > >> > graphics suppressed, ascii substituted
> > >> > 0dBFS level = 1.0
> > >> > orch now loaded
> > >> > audio buffered in 256 sample-frame blocks
> > >> > not writing to sound disk
> > >> > SECTION 1:
> > >> > new alloc for instr set:
> > >> > B  0.000 ..  1.000 T  1.001 TT  1.001 M:  0.00000  0.00000
> > >> > new alloc for instr get:
> > >> > instr 2:  i1 = 1.000
> > >> > instr 2:  i2 = 1.000
> > >> > instr 2:  i3 = 1.000
> > >> > instr 2:  i4 = 1.000
> > >> > B  1.000 ..  2.000 T  2.000 TT  2.000 M:  0.00000  0.00000
> > >> > Score finished in csoundPerform().
> > >> > inactive allocs returned to freespace
> > >> > end of score.              overall amps:  0.00000  0.00000
> > >> >             overall samples out of range:        0        0
> > >> > 0 errors in performance
> > >> > Elapsed time at end of performance: real: 0.004s, CPU: 0.004s
>
>
> View this message in context: Re:
> Sent from the Csound - General mailing list archive at Nabble.com.



Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"





Date2014-06-03 17:53
Fromjpff@cs.bath.ac.uk
SubjectRe: [Csnd] i() and arrays
AttachmentsNone  

Date2014-06-03 18:47
Frommesca
SubjectRe: [Csnd] i() and arrays
Great! I rebuilt and did not notice any problem (although I didn't run extensive tests).

I realize I still need my reinit workaround in the get instrument though, just to stay in sync with the setter. This bug has already been discussed (https://github.com/csound/csound/issues/336), but I was wondering if you had any idea of when it could be resolved?

<CsoundSynthesizer>
<CsInstruments>

gkarray[] init 2

instr set
  gkarray[p4] init p5 ; this runs at k-rate
endin

instr get
  ivalue = i(gkarray[p4])
  print ivalue
endin

</CsInstruments>
<CsScore>

i "set" 0 1 1 1
i "get" 0 1 1 ; prints 0 instead of 1 because gkarray[1] not yet set

</CsScore>
</CsoundSynthesizer>

Le 3 juin 2014 à 18:53, jpff [via Csound] <[hidden email]> a écrit :

I have recoded all this area and it seems complete now, including  
multi-dimensional arrays and arrays as indexes to arrays.  No  
expressions though
==John ff


Quoting Pierre Clisson <<a href="x-msg://9/user/SendEmail.jtp?type=node&amp;node=5735691&amp;i=0" target="_top" rel="nofollow" link="external">[hidden email]>:

> Hi all,
>
> I need to init a variable with a value taken from a k-array.
> In a perfect world, this would have worked:
>
> ivalue = i(gkarray[p4][p5])
>
> But unfortunately, it produces a parsing error ("Use of i() with  
> expression not permitted"). Is it the intended behavior or a bug?
> In my specific case, I can rely on a workaround with the reinit  
> opcode, but it is very ugly and verbose.
>
> --
> Pierre


View this message in context: Re: [Csnd] i() and arrays
Sent from the Csound - General mailing list archive at Nabble.com.