Csound Csound-dev Csound-tekno Search About

[Cs-dev] Illegal GEN # on 43 ?

Date2005-10-28 03:58
FromDavid Akbari
Subject[Cs-dev] Illegal GEN # on 43 ?
Hi List,

For the last few days in CVS I've noticed an illegal gen number when 
trying to run GEN 43. Is it still not part of the canonical source tree 
yet? Here's the file I'm using to test followed by the error message:





sr		=	44100
kr		=	441
ksmps	=	100
nchnls	=	2

/*--- ---*/

		instr	1

ilen	=	ftlen(1) * sr

kndx	phasor	(1 / p3)
kndx	=	kndx * ilen

fl	pvsfread	kndx, 1, 0
fr	pvsfread	kndx, 1, 0 ; 1 if stereo

al	pvsynth	fl
ar	pvsynth	fr

	outs	al, ar

		endin

/*--- ---*/


f1	0	43	1024	"sp_adrien.pvx"	0

i1 0 [2.72]
s

i1 0 [2.72 * 2]
s

i1 0 [2.72 * 4]
s

i1 0 [2.72 * 8]

e




ftable 1: illegal gen number
f  1     0.00    43.00  1024.00  "sp_adrien.pvx" ...
new alloc for instr 1:
INIT ERROR in instr 1: Invalid ftable no. 1.000000
#i0     ftlen.i 1
PVOCEX_LoadFile(): error:
     unable to open pvocex file pvoc.1:
pvsys: unable to open file
INIT ERROR in instr 1: Failed to load PVOC-EX file
fl      pvsfread        kndx    1       0
PVOCEX_LoadFile(): error:
     unable to open pvocex file pvoc.1:
pvsys: unable to open file
INIT ERROR in instr 1: Failed to load PVOC-EX file
fr      pvsfread        kndx    1       0
  *** internal error: mcalloc() called with zero nbytes
  *** internal error: mcalloc() called with zero nbytes


-David



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-10-28 09:41
FromIstvan Varga
SubjectRe: [Cs-dev] Illegal GEN # on 43 ?
David Akbari wrote:

> For the last few days in CVS I've noticed an illegal gen number when 
> trying to run GEN 43. Is it still not part of the canonical source tree 
> yet?

I think it is, but there are a few apparent errors in the CSD example.

> fl    pvsfread    kndx, 1, 0
> fr    pvsfread    kndx, 1, 0 ; 1 if stereo

According to the manual, the syntax of pvsfread is

fsig pvsfread ktimpt, ifn [, ichan]

where ifn is the file name.
So the above statements would use strset index #1 as the file name,
and in the absence of that, "pvoc.1", which seems to be not found.
Did you really intend to read "pvoc.1" ?

> f1    0    43    1024    "sp_adrien.pvx"    0

This actually tries to use GEN1024 which does not exist. I assume
you wanted something like

f1    0    1024  43      "sp_adrien.pvx"    0


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-10-28 15:53
FromDavid Akbari
SubjectRe: [Cs-dev] Illegal GEN # on 43 ?
Thanks Istvan, it all works with the following revised csd file (thanks 
for pointing out the errors!)

As a side note, after initiating the csStop command inside of cstclsh, 
and then re running the csCompile, I always get a " *** error 
initialising PortTime
  *** error opening MIDI in device: -1 (Unknown MIDI error)" even when 
the orchestra and score compiles correctly.

Is this still a problem with the example orc?





sr		=	44100
kr		=	441
ksmps	=	100
nchnls	=	2

	strset	1, "adrien_2.pvx"

/*--- ---*/

		instr	1

ilen	filelen	1

kndx	phasor	(1 / p3)
kndx	=	kndx * ilen

fl	pvsfread	kndx, 1, 0
fr	pvsfread	kndx, 1, 0 ; 1 if stereo

al	pvsynth	fl
ar	pvsynth	fr

	outs	al, ar

		endin

/*--- ---*/


f1    0    1024  43      "adrien_2.pvx"    0

i1 0 [2.72]
s

i1 0 [2.72 * 2]
s

i1 0 [2.72 * 4]
s

i1 0 [2.72 * 8]

e





-David



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-10-28 16:06
FromVictor Lazzarini
SubjectRe: [Cs-dev] Illegal GEN # on 43 ?
Are you using the csd in your e-mail?

At 15:53 28/10/2005, you wrote:
>As a side note, after initiating the csStop command inside of cstclsh, and 
>then re running the csCompile, I always get a " *** error initialising PortTime
>  *** error opening MIDI in device: -1 (Unknown MIDI error)" even when the 
> orchestra and score compiles correctly.

Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth 



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-10-28 16:21
FromVictor Lazzarini
SubjectRe: [Cs-dev] Illegal GEN # on 43 ?
I just tested tclcsh with examples/trapped.csd and I can't
see any error messages:

 >cstclsh
cstclsh
(c) Victor Lazzarini
  Music Technology Lab
  NUI Maynooth, 2005
Localisation of messages is disabled, using default language.
time resolution is 279.365 ns
% csCompile -odac9 examples/trapped.csd
WARNING: 'd:\csound5\csoundapi~.dll' is not a Csound plugin library
PortMIDI real time MIDI plugin for Csound
PortAudio real-time audio module for Csound
Windows MME real time audio and MIDI module for Csound by Istvan Va
WARNING: 'd:\csound5\tclcsound.dll' is not a Csound plugin library
0dBFS level = 32768.0
Csound version 5.00.0 beta (float samples) Oct 28 2005
libsndfile-1.0.10
UnifiedCSD:  examples/trapped.csd
STARTING FILE
Creating options
Creating orchestra
Creating score
orchname:  C:\DOCUME~1\VLAZZA~1\LOCALS~1\Temp\cs3474.orc
scorename: C:\DOCUME~1\VLAZZA~1\LOCALS~1\Temp\cs3475.sco
rtaudio: PortAudio module enabled ... using callback interface
rtmidi: PortMIDI module enabled
orch compiler:
397 lines read
         instr   1
         instr   2
         instr   3
         instr   4
         instr   5
         instr   6
         instr   7
         instr   8
         instr   9
         instr   10
         instr   11
         instr   12
         instr   13
         instr   98
         instr   99
Elapsed time at end of orchestra compile: real: 0.050s, CPU: 0.047s
sorting score ...
         ... done
Elapsed time at end of score sort: real: 0.069s, CPU: 0.078s
Csound version 5.00.0 beta (float samples) Oct 28 2005
displays suppressed
0dBFS level = 32768.0
orch now loaded
audio buffered in 4096 sample-frame blocks
PortAudio V19-devel
PortAudio: selected output device 'M-Audio Quattro ASIO'
writing 16384-byte blks of shorts to dac9
SECTION 1:
0
% csPlay

...etc

At 16:06 28/10/2005, you wrote:
>Are you using the csd in your e-mail?
>
>At 15:53 28/10/2005, you wrote:
>>As a side note, after initiating the csStop command inside of cstclsh, 
>>and then re running the csCompile, I always get a " *** error 
>>initialising PortTime
>>  *** error opening MIDI in device: -1 (Unknown MIDI error)" even when 
>> the orchestra and score compiles correctly.
>
>Victor Lazzarini
>Music Technology Laboratory
>Music Department
>National University of Ireland, Maynooth
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by the JBoss Inc.
>Get Certified Today * Register for a JBoss Training Course
>Free Certification Exam for All Training Attendees Through End of 2005
>Visit http://www.jboss.com/services/certification for more information
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel

Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth 



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-10-28 16:37
FromIstvan Varga
SubjectRe: [Cs-dev] Illegal GEN # on 43 ?
David Akbari wrote:

> As a side note, after initiating the csStop command inside of cstclsh, 
> and then re running the csCompile, I always get a " *** error 
> initialising PortTime
>  *** error opening MIDI in device: -1 (Unknown MIDI error)" even when 
> the orchestra and score compiles correctly.
> 
> Is this still a problem with the example orc?

Not likely. It is possible that PortMidi does not like to be initialized
more than once on the Mac; to work around that, try not using any -M or
-Q flags, assuming that you do not actually need real time MIDI for this
CSD file.


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-10-28 18:42
FromDavid Akbari
SubjectRe: [Cs-dev] Illegal GEN # on 43 ?
On Oct 28, 2005, at 11:37 AM, Istvan Varga wrote:

> It is possible that PortMidi does not like to be initialized
> more than once on the Mac; to work around that, try not using any -M or
> -Q flags, assuming that you do not actually need real time MIDI for 
> this
> CSD file.

Here's an example of using the cstclsh command to run Csound5 with 
realtime MIDI. I run the following CSD file with the following 
commandline and it plays great, with no errors. However, while running 
the cstclsh shell, it would seem that when running the exact same 
command for the second time in the same shell, Port MIDI fails to 
initialize. I noticed also the DigiCoreAudioManger.app is still active 
suggesting that the CoreAudio driver has not been terminated.

If the -M and -Q flags are omitted how does Csound know where to look 
for realtime MIDI? Also are there more methods for cstclsh than just 
csOpcodedir such as csIncdir, csSadir, or csSfdir at present ?

This shell idea is amazing, I've already set it as the default shell. I 
feel that this is an amazing solution to realtime algorithmic 
composition using TCL as a wrapper language to Csound. Honestly this 
seems like the new functional equivalent for MacCsound on OSX as you 
can just write a syntax coloring text editor in TCL!

Here's the CSD file I used (which is != the previously posted one, 
apologies for confusion related to that) assuming no environment 
variables set other than OPCODEDIR (as indicated by absolute paths 
where necessary).





sr		=	44100
kr		=	441
ksmps	=	100
nchnls	=	2

	strset	1, "/Users/daveakbari/Desktop/adrien_2.pvx"

/*--- ---*/

		instr	1

ilen	filelen	1

kscl	ctrl7	1, 1, -12, 12
ksc	=	(2 ^ (kscl / 12))

kndx	phasor	(1 / p3)
kndx	=	kndx * ilen

fl	pvsfread	kndx, 1, 0
fr	pvsfread	kndx, 1, 0 ; 1 if stereo source

;	printk2	ksc
fscl	pvscale	fl, ksc
fscr	pvscale	fr, ksc

al	pvsynth	fscl
ar	pvsynth	fscr

	outs	al, ar

		endin

/*--- ---*/


f1    0    1024  43      "/Users/daveakbari/Desktop/adrien_2.pvx"    0

i1 0 [2.72]
s

i1 0 [2.72 * 2]
s

i1 0 [2.72 * 4]
s

i1 0 [2.72 * 8]

e




|--- FIRST RUN, as expected

cstclsh
(c) Victor Lazzarini
  Music Technology Lab
  NUI Maynooth, 2005
Localisation of messages is disabled, using default language.
time resolution is 1000.000 ns
% csCompile -odac:1 -idevaudio:1 -M0 -d -+rtaudio=CoreAudio 
-+noninterleaved=1 /Users/daveakbari/gen43.csd
PortMIDI real time MIDI plugin for Csound
CoreAudio real-time audio module for Csound
by Victor Lazzarini
PortAudio real-time audio module for Csound
0dBFS level = 32768.0
Csound version 5.00.0 beta (double samples) Oct 27 2005
libsndfile-1.0.11
UnifiedCSD:  /Users/daveakbari/Desktop/gen43.csd
STARTING FILE
Creating orchestra
Creating score
orchname:  /var/tmp/tmp.orc
scorename: /var/tmp/tmp.sco
rtaudio: CoreAudio module enabled
rtmidi: PortMIDI module enabled
**** OSC: liblo started ****
orch compiler:
36 lines read
         instr   1
Elapsed time at end of orchestra compile: real: 0.017s, CPU: 0.010s
sorting score ...
         ... done
Elapsed time at end of score sort: real: 0.021s, CPU: 0.010s
Csound version 5.00.0 beta (double samples) Oct 27 2005
midi channel 1 using instr 1
midi channel 2 using instr 1
midi channel 3 using instr 1
midi channel 4 using instr 1
midi channel 5 using instr 1
midi channel 6 using instr 1
midi channel 7 using instr 1
midi channel 8 using instr 1
midi channel 9 using instr 1
midi channel 10 using instr 1
midi channel 11 using instr 1
midi channel 12 using instr 1
midi channel 13 using instr 1
midi channel 14 using instr 1
midi channel 15 using instr 1
midi channel 16 using instr 1
displays suppressed
0dBFS level = 32768.0
Strsets[1]: '/Users/daveakbari/Desktop/adrien_2.pvx'
*** malloc[672]: error for object 0x511530: Double free
*** malloc[672]: error for object 0x511530: Double free
PortMIDI: selected input device 0: 'Oxygen 8: Port 1' (CoreMIDI)
orch now loaded
audio buffered in 1024 sample-frame blocks
==========================================================
CoreAudio Module: found 4 device(s):
=> CoreAudio device 0: Built-in Audio
=> CoreAudio device 1: Digidesign HW ( MBox )
=> CoreAudio device 2: Soundflower (2ch)
=> CoreAudio device 3: Soundflower (16ch)
selected device: 1
CoreAudio module: opening Digidesign HW ( MBox )
CoreAudio module: sr set to 44100 with 2 audio channels
CoreAudio module: device open with 4 buffers of 1024 frames
==========================================================
reading 4096-byte blks of shorts from devaudio:1 (RAW)
writing 4096-byte blks of shorts to dac:1
SECTION 1:
0
% csPlay
0
% ftable 1:
file /Users/daveakbari/Desktop/adrien_2.pvx (1986336 bytes) loaded into 
memory
new alloc for instr 1:
B  0.000 ..  2.720 T  2.720 TT  2.720 M:  12023.4  12023.4
end of section 1         sect peak amps:  12023.4  12023.4
inactive allocs returned to freespace
SECTION 2:

...etc

csStop
inactive allocs returned to freespace
end of score.              overall amps:  18521.9  18521.9
            overall samples out of range:        0        0
0 errors in performance
Elapsed time at end of performance: real: 58.428s, CPU: 4.760s
coreaudio module: closing device...
coreaudio module: device closed
513 4096-byte soundblks of shorts written to dac:1
Removing temporary file /var/tmp/tmp.2.eqwYNS ...
Removing temporary file /var/tmp/tmp.sco ...
Removing temporary file /var/tmp/tmp.orc ...

|--- SECOND RUN, "Fails to initialize Port MIDI" ?

% csCompile -odac:1 -idevaudio:1 -M0 -d -+rtaudio=CoreAudio 
-+noninterleaved=1 /Users/daveakbari/Desktop/gen43.csd
PortMIDI real time MIDI plugin for Csound
CoreAudio real-time audio module for Csound
by Victor Lazzarini
PortAudio real-time audio module for Csound
0dBFS level = 32768.0
Csound version 5.00.0 beta (double samples) Oct 27 2005
libsndfile-1.0.11
UnifiedCSD:  /Users/daveakbari/Desktop/gen43.csd
STARTING FILE
Creating orchestra
Creating score
orchname:  /var/tmp/tmp.orc
scorename: /var/tmp/tmp.sco
rtaudio: CoreAudio module enabled
rtmidi: PortMIDI module enabled
**** OSC: liblo started ****
orch compiler:
36 lines read
         instr   1
Elapsed time at end of orchestra compile: real: 0.018s, CPU: 0.020s
sorting score ...
         ... done
Elapsed time at end of score sort: real: 0.020s, CPU: 0.020s
Csound version 5.00.0 beta (double samples) Oct 27 2005
midi channel 1 using instr 1
midi channel 2 using instr 1
midi channel 3 using instr 1
midi channel 4 using instr 1
midi channel 5 using instr 1
midi channel 6 using instr 1
midi channel 7 using instr 1
midi channel 8 using instr 1
midi channel 9 using instr 1
midi channel 10 using instr 1
midi channel 11 using instr 1
midi channel 12 using instr 1
midi channel 13 using instr 1
midi channel 14 using instr 1
midi channel 15 using instr 1
midi channel 16 using instr 1
displays suppressed
0dBFS level = 32768.0
Strsets[1]: '/Users/daveakbari/Desktop/adrien_2.pvx'
*** malloc[672]: error for object 0x520b70: Double free
*** malloc[672]: error for object 0x520b10: Double free
  *** error initialising PortTime
  *** error opening MIDI in device: -1 (Unknown MIDI error)
inactive allocs returned to freespace
end of score.              overall amps:      0.0      0.0
            overall samples out of range:        0        0
0 errors in performance
Elapsed time at end of performance: real: 0.031s, CPU: 0.030s
Removing temporary file /var/tmp/tmp.5.EOCHKM ...
Removing temporary file /var/tmp/tmp.sco ...
Removing temporary file /var/tmp/tmp.orc ...
-1


-David



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net