Csound Csound-dev Csound-tekno Search About

[Csnd] Bug in -- new parser? csound doubles?

Date2012-05-06 14:31
FromLouis Cohen
Subject[Csnd] Bug in -- new parser? csound doubles?
I discovered a bug in the way csound handles the "power" operator " ^ ".

While this works:

2^2    gives 4

The following does not work:

k1 = 2
2^k1   gives 1

I THINK this bug exists with csound 5.14 (doubles). The workaround is  
to use
pow 2, k1 instead of 2^k1.

I'm a little confused about what version of csound I'm running, so  
I've enclosed console printouts of two runs.

Here's the csd:





instr 1
	ktrig init 1
		if(ktrig==1)then
		k1 = 2^(-1)
		printk 1,k1 ;should be 0.5
		k1 = 2^1
		printk 1,k1,2 ;should be 2
		k1 = 2^0
		printk 1,k1,4 ;should be 1
		kexp = 2
		k1 = 2^kexp
		printk 1,k1,6 ;should be 4
		k1 pow 2, kexp
		printk 1,k1, 8 ;should be 4
		ktrig = 0
	endif
endin


i 1 0 5



Here's output from the csoundQT console, using a special version of  
csoundQT 0.7 made for me by Andres. In this output, 2^kexp gives the  
result of 1, which is incorrect.

********************
* USING NEW PARSER *
********************
Parsing successful!
Creating boolean expression
sorting score ...
	... done
Csound version 5.14 (double samples) Oct 12 2011
0dBFS level = 32768.0
orch now loaded
audio buffered in 1024 sample-frame blocks
CoreAudio module: sr set to 44100 with 1 audio channels
CoreAudio module: device open with 4 buffers of 4096 frames
==========================================================
reading 2048-byte blks of shorts from adc (RAW)
writing 2048-byte blks of shorts to dac
SECTION 1:
  i   1 time     0.00023:     0.50000
  i   1 time     0.00023:       2.00000
  i   1 time     0.00023:         1.00000
  i   1 time     0.00023:           1.00000
  i   1 time     0.00023:             4.00000
Score finished in csoundPerformKsmps().
inactive allocs returned to freespace
end of score.		   overall amps:      0.0
	   overall samples out of range:        0
0 errors in performance
coreaudio module: closing device...

Next is output on the same computer, running the csd from the  
terminal. In this case 2^kexp gives the correct result, namely 4. I  
have no idea why I'm running double samples from csoundQT and float  
samples from terminal.

0dBFS level = 32768.0
Csound version 5.14 (float samples) Oct 10 2011
libsndfile-1.0.21
WARNING: could not open library '/Library/Frameworks/ 
CsoundLib.framework/Versions/5.2/Resources/Opcodes/libjacko.dylib' (-1)
WARNING: could not open library '/Library/Frameworks/ 
CsoundLib.framework/Versions/5.2/Resources/Opcodes/ 
libjackTransport.dylib' (-1)
WARNING: could not open library '/Library/Frameworks/ 
CsoundLib.framework/Versions/5.2/Resources/Opcodes/librtjack.dylib' (-1)
UnifiedCSD:  /Users/louiscohen/Desktop/csoundTemperamentTuner/ 
expTest.csd
STARTING FILE
Creating options
Creating orchestra
Creating score
orchname:  /var/folders/Mn/MnzKOmWZELq8tIchSgNSQ++++TI/-Tmp-//csound- 
WRGpd2.orc
scorename: /var/folders/Mn/MnzKOmWZELq8tIchSgNSQ++++TI/-Tmp-//csound- 
pq9Ihc.sco
graph init
rtaudio: PortAudio module enabled ... using callback interface
rtmidi: PortMIDI module enabled
orch compiler:
	instr	1	
Elapsed time at end of orchestra compile: real: 0.046s, CPU: 0.005s
sorting score ...
	... done
Elapsed time at end of score sort: real: 0.047s, CPU: 0.006s
Csound version 5.14 (float samples) Oct 10 2011
0dBFS level = 32768.0
orch now loaded
audio buffered in 1024 sample-frame blocks
writing 2048-byte blks of shorts to test.aif (AIFF)
SECTION 1:
new alloc for instr 1:
  i   1 time     0.00023:     0.50000
  i   1 time     0.00023:       2.00000
  i   1 time     0.00023:         1.00000
  i   1 time     0.00023:           4.00000
  i   1 time     0.00023:             4.00000
B  0.000 ..  5.000 T  5.000 TT  5.000 M:      0.0
Score finished in csoundPerform().
inactive allocs returned to freespace
end of score.		   overall amps:      0.0
	   overall samples out of range:        0
0 errors in performance
Elapsed time at end of performance: real: 0.074s, CPU: 0.017s
216 2048-byte soundblks of shorts written to test.aif (AIFF)
Macintosh:~ louiscohen$

-Lou


Date2012-05-06 16:06
Fromjpff@cs.bath.ac.uk
SubjectRe: [Csnd] Bug in -- new parser? csound doubles?
It works correctly on 5.17 and the cs6 development

New parser was not complete in 5.14 which id way old

> I discovered a bug in the way csound handles the "power" operator " ^ ".
>
> While this works:
>
> 2^2    gives 4
>
> The following does not work:
>
> k1 = 2
> 2^k1   gives 1
>
> I THINK this bug exists with csound 5.14 (doubles). The workaround is
> to use
> pow 2, k1 instead of 2^k1.
>
> I'm a little confused about what version of csound I'm running, so
> I've enclosed console printouts of two runs.
>
> Here's the csd:
>
> 
> 
> 
> 
> instr 1
> 	ktrig init 1
> 		if(ktrig==1)then
> 		k1 = 2^(-1)
> 		printk 1,k1 ;should be 0.5
> 		k1 = 2^1
> 		printk 1,k1,2 ;should be 2
> 		k1 = 2^0
> 		printk 1,k1,4 ;should be 1
> 		kexp = 2
> 		k1 = 2^kexp
> 		printk 1,k1,6 ;should be 4
> 		k1 pow 2, kexp
> 		printk 1,k1, 8 ;should be 4
> 		ktrig = 0
> 	endif
> endin
> 
> 
> i 1 0 5
> 
> 
>
> Here's output from the csoundQT console, using a special version of
> csoundQT 0.7 made for me by Andres. In this output, 2^kexp gives the
> result of 1, which is incorrect.
>
> ********************
> * USING NEW PARSER *
> ********************
> Parsing successful!
> Creating boolean expression
> sorting score ...
> 	... done
> Csound version 5.14 (double samples) Oct 12 2011
> 0dBFS level = 32768.0
> orch now loaded
> audio buffered in 1024 sample-frame blocks
> CoreAudio module: sr set to 44100 with 1 audio channels
> CoreAudio module: device open with 4 buffers of 4096 frames
> ==========================================================
> reading 2048-byte blks of shorts from adc (RAW)
> writing 2048-byte blks of shorts to dac
> SECTION 1:
>   i   1 time     0.00023:     0.50000
>   i   1 time     0.00023:       2.00000
>   i   1 time     0.00023:         1.00000
>   i   1 time     0.00023:           1.00000
>   i   1 time     0.00023:             4.00000
> Score finished in csoundPerformKsmps().
> inactive allocs returned to freespace
> end of score.		   overall amps:      0.0
> 	   overall samples out of range:        0
> 0 errors in performance
> coreaudio module: closing device...
>
> Next is output on the same computer, running the csd from the
> terminal. In this case 2^kexp gives the correct result, namely 4. I
> have no idea why I'm running double samples from csoundQT and float
> samples from terminal.
>
> 0dBFS level = 32768.0
> Csound version 5.14 (float samples) Oct 10 2011
> libsndfile-1.0.21
> WARNING: could not open library '/Library/Frameworks/
> CsoundLib.framework/Versions/5.2/Resources/Opcodes/libjacko.dylib' (-1)
> WARNING: could not open library '/Library/Frameworks/
> CsoundLib.framework/Versions/5.2/Resources/Opcodes/
> libjackTransport.dylib' (-1)
> WARNING: could not open library '/Library/Frameworks/
> CsoundLib.framework/Versions/5.2/Resources/Opcodes/librtjack.dylib' (-1)
> UnifiedCSD:  /Users/louiscohen/Desktop/csoundTemperamentTuner/
> expTest.csd
> STARTING FILE
> Creating options
> Creating orchestra
> Creating score
> orchname:  /var/folders/Mn/MnzKOmWZELq8tIchSgNSQ++++TI/-Tmp-//csound-
> WRGpd2.orc
> scorename: /var/folders/Mn/MnzKOmWZELq8tIchSgNSQ++++TI/-Tmp-//csound-
> pq9Ihc.sco
> graph init
> rtaudio: PortAudio module enabled ... using callback interface
> rtmidi: PortMIDI module enabled
> orch compiler:
> 	instr	1
> Elapsed time at end of orchestra compile: real: 0.046s, CPU: 0.005s
> sorting score ...
> 	... done
> Elapsed time at end of score sort: real: 0.047s, CPU: 0.006s
> Csound version 5.14 (float samples) Oct 10 2011
> 0dBFS level = 32768.0
> orch now loaded
> audio buffered in 1024 sample-frame blocks
> writing 2048-byte blks of shorts to test.aif (AIFF)
> SECTION 1:
> new alloc for instr 1:
>   i   1 time     0.00023:     0.50000
>   i   1 time     0.00023:       2.00000
>   i   1 time     0.00023:         1.00000
>   i   1 time     0.00023:           4.00000
>   i   1 time     0.00023:             4.00000
> B  0.000 ..  5.000 T  5.000 TT  5.000 M:      0.0
> Score finished in csoundPerform().
> inactive allocs returned to freespace
> end of score.		   overall amps:      0.0
> 	   overall samples out of range:        0
> 0 errors in performance
> Elapsed time at end of performance: real: 0.074s, CPU: 0.017s
> 216 2048-byte soundblks of shorts written to test.aif (AIFF)
> Macintosh:~ louiscohen$
>
> -Lou
>
>
>
> 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"
>
>
>
>



Date2012-05-06 17:07
FromLouis Cohen
SubjectRe: [Csnd] Bug in -- new parser? csound doubles?
Thanks, John,

I suppose that the reason I'm using is the parser with 5.14 is because  
of how Andres configured csoundQT for me.

I would very much like to be up to date with csound, but I'm stuck  
between a rock and hard place. I use MacCsound a great deal, and that  
keeps me at OSX10.5.8 (or maybe 10.6, I'm not sure.) But the recent  
downloads of csound seem only to run with 10.6 and above.

I would like to switch to csoundQT, which would solve the version  
problems, but I need a way of evaluating it before completely changing  
my environment. Andres is helping me by providing me with a version of  
csoundQT that runs on OSX10.5.8. Apparently this version uses the new  
parser. There's nothing I can do about that.

If you have any suggestions about a path I might take to move into the  
modern world, I'd appreciate it.

best,
Lou Cohen

On May 6, 2012, at 11:06 AM, jpff@cs.bath.ac.uk wrote:

> It works correctly on 5.17 and the cs6 development
>
> New parser was not complete in 5.14 which id way old
>
>> I discovered a bug in the way csound handles the "power" operator "  
>> ^ ".
>>
>> While this works:
>>
>> 2^2    gives 4
>>
>> The following does not work:
>>
>> k1 = 2
>> 2^k1   gives 1
>>
>> I THINK this bug exists with csound 5.14 (doubles). The workaround is
>> to use
>> pow 2, k1 instead of 2^k1.
>>
>> I'm a little confused about what version of csound I'm running, so
>> I've enclosed console printouts of two runs.
>>
>> Here's the csd:
>>
>> 
>> 
>> 
>> 
>> instr 1
>> 	ktrig init 1
>> 		if(ktrig==1)then
>> 		k1 = 2^(-1)
>> 		printk 1,k1 ;should be 0.5
>> 		k1 = 2^1
>> 		printk 1,k1,2 ;should be 2
>> 		k1 = 2^0
>> 		printk 1,k1,4 ;should be 1
>> 		kexp = 2
>> 		k1 = 2^kexp
>> 		printk 1,k1,6 ;should be 4
>> 		k1 pow 2, kexp
>> 		printk 1,k1, 8 ;should be 4
>> 		ktrig = 0
>> 	endif
>> endin
>> 
>> 
>> i 1 0 5
>> 
>> 
>>
>> Here's output from the csoundQT console, using a special version of
>> csoundQT 0.7 made for me by Andres. In this output, 2^kexp gives the
>> result of 1, which is incorrect.
>>
>> ********************
>> * USING NEW PARSER *
>> ********************
>> Parsing successful!
>> Creating boolean expression
>> sorting score ...
>> 	... done
>> Csound version 5.14 (double samples) Oct 12 2011
>> 0dBFS level = 32768.0
>> orch now loaded
>> audio buffered in 1024 sample-frame blocks
>> CoreAudio module: sr set to 44100 with 1 audio channels
>> CoreAudio module: device open with 4 buffers of 4096 frames
>> ==========================================================
>> reading 2048-byte blks of shorts from adc (RAW)
>> writing 2048-byte blks of shorts to dac
>> SECTION 1:
>>  i   1 time     0.00023:     0.50000
>>  i   1 time     0.00023:       2.00000
>>  i   1 time     0.00023:         1.00000
>>  i   1 time     0.00023:           1.00000
>>  i   1 time     0.00023:             4.00000
>> Score finished in csoundPerformKsmps().
>> inactive allocs returned to freespace
>> end of score.		   overall amps:      0.0
>> 	   overall samples out of range:        0
>> 0 errors in performance
>> coreaudio module: closing device...
>>
>> Next is output on the same computer, running the csd from the
>> terminal. In this case 2^kexp gives the correct result, namely 4. I
>> have no idea why I'm running double samples from csoundQT and float
>> samples from terminal.
>>
>> 0dBFS level = 32768.0
>> Csound version 5.14 (float samples) Oct 10 2011
>> libsndfile-1.0.21
>> WARNING: could not open library '/Library/Frameworks/
>> CsoundLib.framework/Versions/5.2/Resources/Opcodes/ 
>> libjacko.dylib' (-1)
>> WARNING: could not open library '/Library/Frameworks/
>> CsoundLib.framework/Versions/5.2/Resources/Opcodes/
>> libjackTransport.dylib' (-1)
>> WARNING: could not open library '/Library/Frameworks/
>> CsoundLib.framework/Versions/5.2/Resources/Opcodes/ 
>> librtjack.dylib' (-1)
>> UnifiedCSD:  /Users/louiscohen/Desktop/csoundTemperamentTuner/
>> expTest.csd
>> STARTING FILE
>> Creating options
>> Creating orchestra
>> Creating score
>> orchname:  /var/folders/Mn/MnzKOmWZELq8tIchSgNSQ++++TI/-Tmp-//csound-
>> WRGpd2.orc
>> scorename: /var/folders/Mn/MnzKOmWZELq8tIchSgNSQ++++TI/-Tmp-//csound-
>> pq9Ihc.sco
>> graph init
>> rtaudio: PortAudio module enabled ... using callback interface
>> rtmidi: PortMIDI module enabled
>> orch compiler:
>> 	instr	1
>> Elapsed time at end of orchestra compile: real: 0.046s, CPU: 0.005s
>> sorting score ...
>> 	... done
>> Elapsed time at end of score sort: real: 0.047s, CPU: 0.006s
>> Csound version 5.14 (float samples) Oct 10 2011
>> 0dBFS level = 32768.0
>> orch now loaded
>> audio buffered in 1024 sample-frame blocks
>> writing 2048-byte blks of shorts to test.aif (AIFF)
>> SECTION 1:
>> new alloc for instr 1:
>>  i   1 time     0.00023:     0.50000
>>  i   1 time     0.00023:       2.00000
>>  i   1 time     0.00023:         1.00000
>>  i   1 time     0.00023:           4.00000
>>  i   1 time     0.00023:             4.00000
>> B  0.000 ..  5.000 T  5.000 TT  5.000 M:      0.0
>> Score finished in csoundPerform().
>> inactive allocs returned to freespace
>> end of score.		   overall amps:      0.0
>> 	   overall samples out of range:        0
>> 0 errors in performance
>> Elapsed time at end of performance: real: 0.074s, CPU: 0.017s
>> 216 2048-byte soundblks of shorts written to test.aif (AIFF)
>> Macintosh:~ louiscohen$
>>
>> -Lou
>>
>>
>>
>> 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"
>


Date2012-05-06 17:21
Fromjoachim heintz
SubjectRe: [Csnd] Bug in -- new parser? csound doubles?
hi lou -
aren't you able to uncheck the "Use new parser" box in CsoundQt's
configure>run tab?
	joachim


Am 06.05.2012 18:07, schrieb Louis Cohen:
> Thanks, John,
> 
> I suppose that the reason I'm using is the parser with 5.14 is because
> of how Andres configured csoundQT for me.
> 
> I would very much like to be up to date with csound, but I'm stuck
> between a rock and hard place. I use MacCsound a great deal, and that
> keeps me at OSX10.5.8 (or maybe 10.6, I'm not sure.) But the recent
> downloads of csound seem only to run with 10.6 and above.
> 
> I would like to switch to csoundQT, which would solve the version
> problems, but I need a way of evaluating it before completely changing
> my environment. Andres is helping me by providing me with a version of
> csoundQT that runs on OSX10.5.8. Apparently this version uses the new
> parser. There's nothing I can do about that.
> 
> If you have any suggestions about a path I might take to move into the
> modern world, I'd appreciate it.
> 
> best,
> Lou Cohen
> 
> On May 6, 2012, at 11:06 AM, jpff@cs.bath.ac.uk wrote:
> 
>> It works correctly on 5.17 and the cs6 development
>>
>> New parser was not complete in 5.14 which id way old
>>
>>> I discovered a bug in the way csound handles the "power" operator " ^ ".
>>>
>>> While this works:
>>>
>>> 2^2    gives 4
>>>
>>> The following does not work:
>>>
>>> k1 = 2
>>> 2^k1   gives 1
>>>
>>> I THINK this bug exists with csound 5.14 (doubles). The workaround is
>>> to use
>>> pow 2, k1 instead of 2^k1.
>>>
>>> I'm a little confused about what version of csound I'm running, so
>>> I've enclosed console printouts of two runs.
>>>
>>> Here's the csd:
>>>
>>> 
>>> 
>>> 
>>> 
>>> instr 1
>>>     ktrig init 1
>>>         if(ktrig==1)then
>>>         k1 = 2^(-1)
>>>         printk 1,k1 ;should be 0.5
>>>         k1 = 2^1
>>>         printk 1,k1,2 ;should be 2
>>>         k1 = 2^0
>>>         printk 1,k1,4 ;should be 1
>>>         kexp = 2
>>>         k1 = 2^kexp
>>>         printk 1,k1,6 ;should be 4
>>>         k1 pow 2, kexp
>>>         printk 1,k1, 8 ;should be 4
>>>         ktrig = 0
>>>     endif
>>> endin
>>> 
>>> 
>>> i 1 0 5
>>> 
>>> 
>>>
>>> Here's output from the csoundQT console, using a special version of
>>> csoundQT 0.7 made for me by Andres. In this output, 2^kexp gives the
>>> result of 1, which is incorrect.
>>>
>>> ********************
>>> * USING NEW PARSER *
>>> ********************
>>> Parsing successful!
>>> Creating boolean expression
>>> sorting score ...
>>>     ... done
>>> Csound version 5.14 (double samples) Oct 12 2011
>>> 0dBFS level = 32768.0
>>> orch now loaded
>>> audio buffered in 1024 sample-frame blocks
>>> CoreAudio module: sr set to 44100 with 1 audio channels
>>> CoreAudio module: device open with 4 buffers of 4096 frames
>>> ==========================================================
>>> reading 2048-byte blks of shorts from adc (RAW)
>>> writing 2048-byte blks of shorts to dac
>>> SECTION 1:
>>>  i   1 time     0.00023:     0.50000
>>>  i   1 time     0.00023:       2.00000
>>>  i   1 time     0.00023:         1.00000
>>>  i   1 time     0.00023:           1.00000
>>>  i   1 time     0.00023:             4.00000
>>> Score finished in csoundPerformKsmps().
>>> inactive allocs returned to freespace
>>> end of score.           overall amps:      0.0
>>>        overall samples out of range:        0
>>> 0 errors in performance
>>> coreaudio module: closing device...
>>>
>>> Next is output on the same computer, running the csd from the
>>> terminal. In this case 2^kexp gives the correct result, namely 4. I
>>> have no idea why I'm running double samples from csoundQT and float
>>> samples from terminal.
>>>
>>> 0dBFS level = 32768.0
>>> Csound version 5.14 (float samples) Oct 10 2011
>>> libsndfile-1.0.21
>>> WARNING: could not open library '/Library/Frameworks/
>>> CsoundLib.framework/Versions/5.2/Resources/Opcodes/libjacko.dylib' (-1)
>>> WARNING: could not open library '/Library/Frameworks/
>>> CsoundLib.framework/Versions/5.2/Resources/Opcodes/
>>> libjackTransport.dylib' (-1)
>>> WARNING: could not open library '/Library/Frameworks/
>>> CsoundLib.framework/Versions/5.2/Resources/Opcodes/librtjack.dylib' (-1)
>>> UnifiedCSD:  /Users/louiscohen/Desktop/csoundTemperamentTuner/
>>> expTest.csd
>>> STARTING FILE
>>> Creating options
>>> Creating orchestra
>>> Creating score
>>> orchname:  /var/folders/Mn/MnzKOmWZELq8tIchSgNSQ++++TI/-Tmp-//csound-
>>> WRGpd2.orc
>>> scorename: /var/folders/Mn/MnzKOmWZELq8tIchSgNSQ++++TI/-Tmp-//csound-
>>> pq9Ihc.sco
>>> graph init
>>> rtaudio: PortAudio module enabled ... using callback interface
>>> rtmidi: PortMIDI module enabled
>>> orch compiler:
>>>     instr    1
>>> Elapsed time at end of orchestra compile: real: 0.046s, CPU: 0.005s
>>> sorting score ...
>>>     ... done
>>> Elapsed time at end of score sort: real: 0.047s, CPU: 0.006s
>>> Csound version 5.14 (float samples) Oct 10 2011
>>> 0dBFS level = 32768.0
>>> orch now loaded
>>> audio buffered in 1024 sample-frame blocks
>>> writing 2048-byte blks of shorts to test.aif (AIFF)
>>> SECTION 1:
>>> new alloc for instr 1:
>>>  i   1 time     0.00023:     0.50000
>>>  i   1 time     0.00023:       2.00000
>>>  i   1 time     0.00023:         1.00000
>>>  i   1 time     0.00023:           4.00000
>>>  i   1 time     0.00023:             4.00000
>>> B  0.000 ..  5.000 T  5.000 TT  5.000 M:      0.0
>>> Score finished in csoundPerform().
>>> inactive allocs returned to freespace
>>> end of score.           overall amps:      0.0
>>>        overall samples out of range:        0
>>> 0 errors in performance
>>> Elapsed time at end of performance: real: 0.074s, CPU: 0.017s
>>> 216 2048-byte soundblks of shorts written to test.aif (AIFF)
>>> Macintosh:~ louiscohen$
>>>
>>> -Lou
>>>
>>>
>>>
>>> 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"
>>
> 
> 
> 
> 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"
> 
> 

Date2012-05-06 18:59
FromLouis Cohen
SubjectRe: [Csnd] Bug in -- new parser? csound doubles?
I was not aware of that option. Thanks!
-Lou

On May 6, 2012, at 12:21 PM, joachim heintz wrote:

> hi lou -
> aren't you able to uncheck the "Use new parser" box in CsoundQt's
> configure>run tab?
> 	joachim
>
>
> Am 06.05.2012 18:07, schrieb Louis Cohen:
>> Thanks, John,
>>
>> I suppose that the reason I'm using is the parser with 5.14 is  
>> because
>> of how Andres configured csoundQT for me.
>>
>> I would very much like to be up to date with csound, but I'm stuck
>> between a rock and hard place. I use MacCsound a great deal, and that
>> keeps me at OSX10.5.8 (or maybe 10.6, I'm not sure.) But the recent
>> downloads of csound seem only to run with 10.6 and above.
>>
>> I would like to switch to csoundQT, which would solve the version
>> problems, but I need a way of evaluating it before completely  
>> changing
>> my environment. Andres is helping me by providing me with a version  
>> of
>> csoundQT that runs on OSX10.5.8. Apparently this version uses the new
>> parser. There's nothing I can do about that.
>>
>> If you have any suggestions about a path I might take to move into  
>> the
>> modern world, I'd appreciate it.
>>
>> best,
>> Lou Cohen
>>
>> On May 6, 2012, at 11:06 AM, jpff@cs.bath.ac.uk wrote:
>>
>>> It works correctly on 5.17 and the cs6 development
>>>
>>> New parser was not complete in 5.14 which id way old
>>>
>>>> I discovered a bug in the way csound handles the "power" operator  
>>>> " ^ ".
>>>>
>>>> While this works:
>>>>
>>>> 2^2    gives 4
>>>>
>>>> The following does not work:
>>>>
>>>> k1 = 2
>>>> 2^k1   gives 1
>>>>
>>>> I THINK this bug exists with csound 5.14 (doubles). The  
>>>> workaround is
>>>> to use
>>>> pow 2, k1 instead of 2^k1.
>>>>
>>>> I'm a little confused about what version of csound I'm running, so
>>>> I've enclosed console printouts of two runs.
>>>>
>>>> Here's the csd:
>>>>
>>>> 
>>>> 
>>>> 
>>>> 
>>>> instr 1
>>>>    ktrig init 1
>>>>        if(ktrig==1)then
>>>>        k1 = 2^(-1)
>>>>        printk 1,k1 ;should be 0.5
>>>>        k1 = 2^1
>>>>        printk 1,k1,2 ;should be 2
>>>>        k1 = 2^0
>>>>        printk 1,k1,4 ;should be 1
>>>>        kexp = 2
>>>>        k1 = 2^kexp
>>>>        printk 1,k1,6 ;should be 4
>>>>        k1 pow 2, kexp
>>>>        printk 1,k1, 8 ;should be 4
>>>>        ktrig = 0
>>>>    endif
>>>> endin
>>>> 
>>>> 
>>>> i 1 0 5
>>>> 
>>>> 
>>>>
>>>> Here's output from the csoundQT console, using a special version of
>>>> csoundQT 0.7 made for me by Andres. In this output, 2^kexp gives  
>>>> the
>>>> result of 1, which is incorrect.
>>>>
>>>> ********************
>>>> * USING NEW PARSER *
>>>> ********************
>>>> Parsing successful!
>>>> Creating boolean expression
>>>> sorting score ...
>>>>    ... done
>>>> Csound version 5.14 (double samples) Oct 12 2011
>>>> 0dBFS level = 32768.0
>>>> orch now loaded
>>>> audio buffered in 1024 sample-frame blocks
>>>> CoreAudio module: sr set to 44100 with 1 audio channels
>>>> CoreAudio module: device open with 4 buffers of 4096 frames
>>>> ==========================================================
>>>> reading 2048-byte blks of shorts from adc (RAW)
>>>> writing 2048-byte blks of shorts to dac
>>>> SECTION 1:
>>>> i   1 time     0.00023:     0.50000
>>>> i   1 time     0.00023:       2.00000
>>>> i   1 time     0.00023:         1.00000
>>>> i   1 time     0.00023:           1.00000
>>>> i   1 time     0.00023:             4.00000
>>>> Score finished in csoundPerformKsmps().
>>>> inactive allocs returned to freespace
>>>> end of score.           overall amps:      0.0
>>>>       overall samples out of range:        0
>>>> 0 errors in performance
>>>> coreaudio module: closing device...
>>>>
>>>> Next is output on the same computer, running the csd from the
>>>> terminal. In this case 2^kexp gives the correct result, namely 4. I
>>>> have no idea why I'm running double samples from csoundQT and float
>>>> samples from terminal.
>>>>
>>>> 0dBFS level = 32768.0
>>>> Csound version 5.14 (float samples) Oct 10 2011
>>>> libsndfile-1.0.21
>>>> WARNING: could not open library '/Library/Frameworks/
>>>> CsoundLib.framework/Versions/5.2/Resources/Opcodes/ 
>>>> libjacko.dylib' (-1)
>>>> WARNING: could not open library '/Library/Frameworks/
>>>> CsoundLib.framework/Versions/5.2/Resources/Opcodes/
>>>> libjackTransport.dylib' (-1)
>>>> WARNING: could not open library '/Library/Frameworks/
>>>> CsoundLib.framework/Versions/5.2/Resources/Opcodes/ 
>>>> librtjack.dylib' (-1)
>>>> UnifiedCSD:  /Users/louiscohen/Desktop/csoundTemperamentTuner/
>>>> expTest.csd
>>>> STARTING FILE
>>>> Creating options
>>>> Creating orchestra
>>>> Creating score
>>>> orchname:  /var/folders/Mn/MnzKOmWZELq8tIchSgNSQ++++TI/-Tmp-// 
>>>> csound-
>>>> WRGpd2.orc
>>>> scorename: /var/folders/Mn/MnzKOmWZELq8tIchSgNSQ++++TI/-Tmp-// 
>>>> csound-
>>>> pq9Ihc.sco
>>>> graph init
>>>> rtaudio: PortAudio module enabled ... using callback interface
>>>> rtmidi: PortMIDI module enabled
>>>> orch compiler:
>>>>    instr    1
>>>> Elapsed time at end of orchestra compile: real: 0.046s, CPU: 0.005s
>>>> sorting score ...
>>>>    ... done
>>>> Elapsed time at end of score sort: real: 0.047s, CPU: 0.006s
>>>> Csound version 5.14 (float samples) Oct 10 2011
>>>> 0dBFS level = 32768.0
>>>> orch now loaded
>>>> audio buffered in 1024 sample-frame blocks
>>>> writing 2048-byte blks of shorts to test.aif (AIFF)
>>>> SECTION 1:
>>>> new alloc for instr 1:
>>>> i   1 time     0.00023:     0.50000
>>>> i   1 time     0.00023:       2.00000
>>>> i   1 time     0.00023:         1.00000
>>>> i   1 time     0.00023:           4.00000
>>>> i   1 time     0.00023:             4.00000
>>>> B  0.000 ..  5.000 T  5.000 TT  5.000 M:      0.0
>>>> Score finished in csoundPerform().
>>>> inactive allocs returned to freespace
>>>> end of score.           overall amps:      0.0
>>>>       overall samples out of range:        0
>>>> 0 errors in performance
>>>> Elapsed time at end of performance: real: 0.074s, CPU: 0.017s
>>>> 216 2048-byte soundblks of shorts written to test.aif (AIFF)
>>>> Macintosh:~ louiscohen$
>>>>
>>>> -Lou
>>>>
>>>>
>>>>
>>>> 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"
>>>
>>
>>
>>
>> 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"
>


Date2012-05-06 19:03
FromAndres Cabrera
SubjectRe: [Csnd] Bug in -- new parser? csound doubles?
Hi,

I'm not sure how well it works for 5.14. If it doesn't work, you can
specify --old-parser in the additional command line flags. Hopefully
that should work. However it might not as flags for determining the
parser have changed since then.

Cheers,
Andrés

On Sun, May 6, 2012 at 6:59 PM, Louis Cohen  wrote:
> I was not aware of that option. Thanks!
> -Lou
>
>
> On May 6, 2012, at 12:21 PM, joachim heintz wrote:
>
>> hi lou -
>> aren't you able to uncheck the "Use new parser" box in CsoundQt's
>> configure>run tab?
>>        joachim
>>
>>
>> Am 06.05.2012 18:07, schrieb Louis Cohen:
>>>
>>> Thanks, John,
>>>
>>> I suppose that the reason I'm using is the parser with 5.14 is because
>>> of how Andres configured csoundQT for me.
>>>
>>> I would very much like to be up to date with csound, but I'm stuck
>>> between a rock and hard place. I use MacCsound a great deal, and that
>>> keeps me at OSX10.5.8 (or maybe 10.6, I'm not sure.) But the recent
>>> downloads of csound seem only to run with 10.6 and above.
>>>
>>> I would like to switch to csoundQT, which would solve the version
>>> problems, but I need a way of evaluating it before completely changing
>>> my environment. Andres is helping me by providing me with a version of
>>> csoundQT that runs on OSX10.5.8. Apparently this version uses the new
>>> parser. There's nothing I can do about that.
>>>
>>> If you have any suggestions about a path I might take to move into the
>>> modern world, I'd appreciate it.
>>>
>>> best,
>>> Lou Cohen
>>>
>>> On May 6, 2012, at 11:06 AM, jpff@cs.bath.ac.uk wrote:
>>>
>>>> It works correctly on 5.17 and the cs6 development
>>>>
>>>> New parser was not complete in 5.14 which id way old
>>>>
>>>>> I discovered a bug in the way csound handles the "power" operator " ^
>>>>> ".
>>>>>
>>>>> While this works:
>>>>>
>>>>> 2^2    gives 4
>>>>>
>>>>> The following does not work:
>>>>>
>>>>> k1 = 2
>>>>> 2^k1   gives 1
>>>>>
>>>>> I THINK this bug exists with csound 5.14 (doubles). The workaround is
>>>>> to use
>>>>> pow 2, k1 instead of 2^k1.
>>>>>
>>>>> I'm a little confused about what version of csound I'm running, so
>>>>> I've enclosed console printouts of two runs.
>>>>>
>>>>> Here's the csd:
>>>>>
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> instr 1
>>>>>   ktrig init 1
>>>>>       if(ktrig==1)then
>>>>>       k1 = 2^(-1)
>>>>>       printk 1,k1 ;should be 0.5
>>>>>       k1 = 2^1
>>>>>       printk 1,k1,2 ;should be 2
>>>>>       k1 = 2^0
>>>>>       printk 1,k1,4 ;should be 1
>>>>>       kexp = 2
>>>>>       k1 = 2^kexp
>>>>>       printk 1,k1,6 ;should be 4
>>>>>       k1 pow 2, kexp
>>>>>       printk 1,k1, 8 ;should be 4
>>>>>       ktrig = 0
>>>>>   endif
>>>>> endin
>>>>> 
>>>>> 
>>>>> i 1 0 5
>>>>> 
>>>>> 
>>>>>
>>>>> Here's output from the csoundQT console, using a special version of
>>>>> csoundQT 0.7 made for me by Andres. In this output, 2^kexp gives the
>>>>> result of 1, which is incorrect.
>>>>>
>>>>> ********************
>>>>> * USING NEW PARSER *
>>>>> ********************
>>>>> Parsing successful!
>>>>> Creating boolean expression
>>>>> sorting score ...
>>>>>   ... done
>>>>> Csound version 5.14 (double samples) Oct 12 2011
>>>>> 0dBFS level = 32768.0
>>>>> orch now loaded
>>>>> audio buffered in 1024 sample-frame blocks
>>>>> CoreAudio module: sr set to 44100 with 1 audio channels
>>>>> CoreAudio module: device open with 4 buffers of 4096 frames
>>>>> ==========================================================
>>>>> reading 2048-byte blks of shorts from adc (RAW)
>>>>> writing 2048-byte blks of shorts to dac
>>>>> SECTION 1:
>>>>> i   1 time     0.00023:     0.50000
>>>>> i   1 time     0.00023:       2.00000
>>>>> i   1 time     0.00023:         1.00000
>>>>> i   1 time     0.00023:           1.00000
>>>>> i   1 time     0.00023:             4.00000
>>>>> Score finished in csoundPerformKsmps().
>>>>> inactive allocs returned to freespace
>>>>> end of score.           overall amps:      0.0
>>>>>      overall samples out of range:        0
>>>>> 0 errors in performance
>>>>> coreaudio module: closing device...
>>>>>
>>>>> Next is output on the same computer, running the csd from the
>>>>> terminal. In this case 2^kexp gives the correct result, namely 4. I
>>>>> have no idea why I'm running double samples from csoundQT and float
>>>>> samples from terminal.
>>>>>
>>>>> 0dBFS level = 32768.0
>>>>> Csound version 5.14 (float samples) Oct 10 2011
>>>>> libsndfile-1.0.21
>>>>> WARNING: could not open library '/Library/Frameworks/
>>>>> CsoundLib.framework/Versions/5.2/Resources/Opcodes/libjacko.dylib' (-1)
>>>>> WARNING: could not open library '/Library/Frameworks/
>>>>> CsoundLib.framework/Versions/5.2/Resources/Opcodes/
>>>>> libjackTransport.dylib' (-1)
>>>>> WARNING: could not open library '/Library/Frameworks/
>>>>> CsoundLib.framework/Versions/5.2/Resources/Opcodes/librtjack.dylib'
>>>>> (-1)
>>>>> UnifiedCSD:  /Users/louiscohen/Desktop/csoundTemperamentTuner/
>>>>> expTest.csd
>>>>> STARTING FILE
>>>>> Creating options
>>>>> Creating orchestra
>>>>> Creating score
>>>>> orchname:  /var/folders/Mn/MnzKOmWZELq8tIchSgNSQ++++TI/-Tmp-//csound-
>>>>> WRGpd2.orc
>>>>> scorename: /var/folders/Mn/MnzKOmWZELq8tIchSgNSQ++++TI/-Tmp-//csound-
>>>>> pq9Ihc.sco
>>>>> graph init
>>>>> rtaudio: PortAudio module enabled ... using callback interface
>>>>> rtmidi: PortMIDI module enabled
>>>>> orch compiler:
>>>>>   instr    1
>>>>> Elapsed time at end of orchestra compile: real: 0.046s, CPU: 0.005s
>>>>> sorting score ...
>>>>>   ... done
>>>>> Elapsed time at end of score sort: real: 0.047s, CPU: 0.006s
>>>>> Csound version 5.14 (float samples) Oct 10 2011
>>>>> 0dBFS level = 32768.0
>>>>> orch now loaded
>>>>> audio buffered in 1024 sample-frame blocks
>>>>> writing 2048-byte blks of shorts to test.aif (AIFF)
>>>>> SECTION 1:
>>>>> new alloc for instr 1:
>>>>> i   1 time     0.00023:     0.50000
>>>>> i   1 time     0.00023:       2.00000
>>>>> i   1 time     0.00023:         1.00000
>>>>> i   1 time     0.00023:           4.00000
>>>>> i   1 time     0.00023:             4.00000
>>>>> B  0.000 ..  5.000 T  5.000 TT  5.000 M:      0.0
>>>>> Score finished in csoundPerform().
>>>>> inactive allocs returned to freespace
>>>>> end of score.           overall amps:      0.0
>>>>>      overall samples out of range:        0
>>>>> 0 errors in performance
>>>>> Elapsed time at end of performance: real: 0.074s, CPU: 0.017s
>>>>> 216 2048-byte soundblks of shorts written to test.aif (AIFF)
>>>>> Macintosh:~ louiscohen$
>>>>>
>>>>> -Lou
>>>>>
>>>>>
>>>>>
>>>>> 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"
>>>>
>>>
>>>
>>>
>>> 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"
>>
>
>
>
> 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"
>