Csound Csound-dev Csound-tekno Search About

[Csnd] Csound6 Lua API: illegal gen number

Date2013-08-30 14:47
Fromfrancesco
Subject[Csnd] Csound6 Lua API: illegal gen number
Hello All,
i'm doing this but i have illegal gen number error.
What i'm doing wrong?

Thanks,
ciao,
francesco.

PS: it is ok in Csound5.


require "luaCsnd6"

local ORC = [[
sr = 44100
ksmps = 1
nchnls = 2
0dbfs = 1

instr 1
iamp = p4
ifrq = cpsmidinn(p5)
ipos = 1
imass = 2
istiff = 3
idamp = 4
ivel = 5
a1 scantable iamp, ifrq, ipos, imass, istiff, idamp, ivel
a1 dcblock2 a1
outs a1, a1
endin
]]

local SCOH = [[
f1 0 128 10 1
f2 0 128 -7 1 128 1
f3 0 128 -7 50 64 100 64 0
f4 0 128 -7 1 128 1
f5 0 128 -7 0 128 0
]]

local SCO = [[
i 1 0 4 0.5 60
i 100 0 -1
]]

local cs = luaCsnd6.Csound()
local pt = luaCsnd6.CsoundPerformanceThread(cs)

cs:SetOption("-m0")
cs:SetOption("-d")
cs:SetOption("-odac")

cs:Start()
pt:Play()

cs:CompileOrc(ORC)

cs:ReadScore(SCOH)
cs:CompileOrc(ORC)

pt:Join()

--cs:Cleanup()






--
View this message in context: http://csound.1045644.n5.nabble.com/Csound6-Lua-API-illegal-gen-number-tp5727258.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2013-08-30 16:32
FromMichael Gogins
SubjectRe: [Csnd] Csound6 Lua API: illegal gen number
Attachmentstest.lua  
You are not doing anything wrong. The attached version of your Lua script does work though. This implies there is some sort of a bug in the score parser.

Hope this helps,
Mike


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


On Fri, Aug 30, 2013 at 9:47 AM, francesco <ilterzouomo@fastwebnet.it> wrote:
Hello All,
i'm doing this but i have illegal gen number error.
What i'm doing wrong?

Thanks,
ciao,
francesco.

PS: it is ok in Csound5.


require "luaCsnd6"

local ORC = [[
sr = 44100
ksmps = 1
nchnls = 2
0dbfs = 1

instr 1
iamp = p4
ifrq = cpsmidinn(p5)
ipos = 1
imass = 2
istiff = 3
idamp = 4
ivel = 5
a1 scantable iamp, ifrq, ipos, imass, istiff, idamp, ivel
a1 dcblock2 a1
outs a1, a1
endin
]]

local SCOH = [[
f1 0 128 10 1
f2 0 128 -7 1 128 1
f3 0 128 -7 50 64 100 64 0
f4 0 128 -7 1 128 1
f5 0 128 -7 0 128 0
]]

local SCO = [[
i 1 0 4 0.5 60
i 100 0 -1
]]

local cs = luaCsnd6.Csound()
local pt = luaCsnd6.CsoundPerformanceThread(cs)

cs:SetOption("-m0")
cs:SetOption("-d")
cs:SetOption("-odac")

cs:Start()
pt:Play()

cs:CompileOrc(ORC)

cs:ReadScore(SCOH)
cs:CompileOrc(ORC)

pt:Join()

--cs:Cleanup()






--
View this message in context: http://csound.1045644.n5.nabble.com/Csound6-Lua-API-illegal-gen-number-tp5727258.html
Sent from the Csound - General mailing list archive at Nabble.com.


Send bugs reports to the Sourceforge bug trackers
csound6:
            https://sourceforge.net/p/csound/tickets/
csound5:
            https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




Date2013-09-16 17:42
FromSteven Yi
SubjectRe: [Cs-dev] [Csnd] Csound6 Lua API: illegal gen number
Attachmentstest.py  None  None  
(Moving this thread to Csound-dev)

I took a look at this and something is certainly off.  I rewrote the
example as a python script (attached) as that'll run with "gdb --args
python test.py" and debug alright.  I did a breakpoint on hfgens and
found the EVTBLK looked suspicious, showing 6 pfields instead of 5 for
the first f1 statement:

Breakpoint 1, hfgens (csound=0x1008cc000, ftpp=0x101eacc50,
evtblkp=0x100964810, mode=0) at fgens.c:107
107    int nonpowof2_flag=0; /* gab: fixed for non-powoftwo function tables*/
(gdb) print *evtblkp
$5 = {
  scnt = 0,
  strarg = 0x0,
  opcod = 102 'f',
  pcnt = 6,
  p2orig = 0.040362811791383332,
  p3orig = 128,
  p = {0, 1, 0.040362811791383221, 128, 128, 10, 1, 0 },
  c = {
    extra = 0x0,
    p = {0, 0}
  }
}

In csoundReadScore, by the time csoundMessageInputInternal is called,
the string is already messed up with p3 duplicated to p4:

#0  csoundInputMessageInternal (csound=0x1008cc000,
message=0x1020bcce0 "f 1 0.000000  128 128 10 1\nf 2 0.000000  128 128
-7 1 128 1\nf 3 0.000000  128 128 -7 50 64 100 64 0\nf 4 0.000000  128
128 -7 1 128 1\nf 5 0.000000  128 128 -7 0 128 0\n") at linevent.c:178

which I assume hfgens is getting and try to create a gen 128 table,
which doesn't exist.

That's about as far as I could take it this morning.  This isn't an
area of code I'm all that familiar with, so assistance here would be
appreciated.

Thanks!
steven

On Fri, Aug 30, 2013 at 11:32 AM, Michael Gogins
 wrote:
> You are not doing anything wrong. The attached version of your Lua script
> does work though. This implies there is some sort of a bug in the score
> parser.
>
> Hope this helps,
> Mike
>
>
> ===========================
> Michael Gogins
> Irreducible Productions
> http://michaelgogins.tumblr.com
> Michael dot Gogins at gmail dot com
>
>
> On Fri, Aug 30, 2013 at 9:47 AM, francesco 
> wrote:
>>
>> Hello All,
>> i'm doing this but i have illegal gen number error.
>> What i'm doing wrong?
>>
>> Thanks,
>> ciao,
>> francesco.
>>
>> PS: it is ok in Csound5.
>>
>>
>> require "luaCsnd6"
>>
>> local ORC = [[
>> sr = 44100
>> ksmps = 1
>> nchnls = 2
>> 0dbfs = 1
>>
>> instr 1
>> iamp = p4
>> ifrq = cpsmidinn(p5)
>> ipos = 1
>> imass = 2
>> istiff = 3
>> idamp = 4
>> ivel = 5
>> a1 scantable iamp, ifrq, ipos, imass, istiff, idamp, ivel
>> a1 dcblock2 a1
>> outs a1, a1
>> endin
>> ]]
>>
>> local SCOH = [[
>> f1 0 128 10 1
>> f2 0 128 -7 1 128 1
>> f3 0 128 -7 50 64 100 64 0
>> f4 0 128 -7 1 128 1
>> f5 0 128 -7 0 128 0
>> ]]
>>
>> local SCO = [[
>> i 1 0 4 0.5 60
>> i 100 0 -1
>> ]]
>>
>> local cs = luaCsnd6.Csound()
>> local pt = luaCsnd6.CsoundPerformanceThread(cs)
>>
>> cs:SetOption("-m0")
>> cs:SetOption("-d")
>> cs:SetOption("-odac")
>>
>> cs:Start()
>> pt:Play()
>>
>> cs:CompileOrc(ORC)
>>
>> cs:ReadScore(SCOH)
>> cs:CompileOrc(ORC)
>>
>> pt:Join()
>>
>> --cs:Cleanup()
>>
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://csound.1045644.n5.nabble.com/Csound6-Lua-API-illegal-gen-number-tp5727258.html
>> Sent from the Csound - General mailing list archive at Nabble.com.
>>
>>
>> Send bugs reports to the Sourceforge bug trackers
>> csound6:
>>             https://sourceforge.net/p/csound/tickets/
>> csound5:
>>             https://sourceforge.net/p/csound/bugs/
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>>
>

Date2013-09-16 18:25
FromVictor Lazzarini
SubjectRe: [Cs-dev] [Csnd] Csound6 Lua API: illegal gen number
It could be something in the score preprocessor, as it does double up some p-fields at some point.
I had fixed that for i-statements, but maybe the same issue is happening with f-statements and causing
the trouble.

I could have a look, but this week is impossible for me, as I have lots of commitments and a trip at the weekend. 
I might be able to follow this up next week, if it has not been fixed by then.

Victor
On 16 Sep 2013, at 17:42, Steven Yi wrote:

> (Moving this thread to Csound-dev)
> 
> I took a look at this and something is certainly off.  I rewrote the
> example as a python script (attached) as that'll run with "gdb --args
> python test.py" and debug alright.  I did a breakpoint on hfgens and
> found the EVTBLK looked suspicious, showing 6 pfields instead of 5 for
> the first f1 statement:
> 
> Breakpoint 1, hfgens (csound=0x1008cc000, ftpp=0x101eacc50,
> evtblkp=0x100964810, mode=0) at fgens.c:107
> 107    int nonpowof2_flag=0; /* gab: fixed for non-powoftwo function tables*/
> (gdb) print *evtblkp
> $5 = {
>  scnt = 0,
>  strarg = 0x0,
>  opcod = 102 'f',
>  pcnt = 6,
>  p2orig = 0.040362811791383332,
>  p3orig = 128,
>  p = {0, 1, 0.040362811791383221, 128, 128, 10, 1, 0 },
>  c = {
>    extra = 0x0,
>    p = {0, 0}
>  }
> }
> 
> In csoundReadScore, by the time csoundMessageInputInternal is called,
> the string is already messed up with p3 duplicated to p4:
> 
> #0  csoundInputMessageInternal (csound=0x1008cc000,
> message=0x1020bcce0 "f 1 0.000000  128 128 10 1\nf 2 0.000000  128 128
> -7 1 128 1\nf 3 0.000000  128 128 -7 50 64 100 64 0\nf 4 0.000000  128
> 128 -7 1 128 1\nf 5 0.000000  128 128 -7 0 128 0\n") at linevent.c:178
> 
> which I assume hfgens is getting and try to create a gen 128 table,
> which doesn't exist.
> 
> That's about as far as I could take it this morning.  This isn't an
> area of code I'm all that familiar with, so assistance here would be
> appreciated.
> 
> Thanks!
> steven
> 
> On Fri, Aug 30, 2013 at 11:32 AM, Michael Gogins
>  wrote:
>> You are not doing anything wrong. The attached version of your Lua script
>> does work though. This implies there is some sort of a bug in the score
>> parser.
>> 
>> Hope this helps,
>> Mike
>> 
>> 
>> ===========================
>> Michael Gogins
>> Irreducible Productions
>> http://michaelgogins.tumblr.com
>> Michael dot Gogins at gmail dot com
>> 
>> 
>> On Fri, Aug 30, 2013 at 9:47 AM, francesco 
>> wrote:
>>> 
>>> Hello All,
>>> i'm doing this but i have illegal gen number error.
>>> What i'm doing wrong?
>>> 
>>> Thanks,
>>> ciao,
>>> francesco.
>>> 
>>> PS: it is ok in Csound5.
>>> 
>>> 
>>> require "luaCsnd6"
>>> 
>>> local ORC = [[
>>> sr = 44100
>>> ksmps = 1
>>> nchnls = 2
>>> 0dbfs = 1
>>> 
>>> instr 1
>>> iamp = p4
>>> ifrq = cpsmidinn(p5)
>>> ipos = 1
>>> imass = 2
>>> istiff = 3
>>> idamp = 4
>>> ivel = 5
>>> a1 scantable iamp, ifrq, ipos, imass, istiff, idamp, ivel
>>> a1 dcblock2 a1
>>> outs a1, a1
>>> endin
>>> ]]
>>> 
>>> local SCOH = [[
>>> f1 0 128 10 1
>>> f2 0 128 -7 1 128 1
>>> f3 0 128 -7 50 64 100 64 0
>>> f4 0 128 -7 1 128 1
>>> f5 0 128 -7 0 128 0
>>> ]]
>>> 
>>> local SCO = [[
>>> i 1 0 4 0.5 60
>>> i 100 0 -1
>>> ]]
>>> 
>>> local cs = luaCsnd6.Csound()
>>> local pt = luaCsnd6.CsoundPerformanceThread(cs)
>>> 
>>> cs:SetOption("-m0")
>>> cs:SetOption("-d")
>>> cs:SetOption("-odac")
>>> 
>>> cs:Start()
>>> pt:Play()
>>> 
>>> cs:CompileOrc(ORC)
>>> 
>>> cs:ReadScore(SCOH)
>>> cs:CompileOrc(ORC)
>>> 
>>> pt:Join()
>>> 
>>> --cs:Cleanup()
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> View this message in context:
>>> http://csound.1045644.n5.nabble.com/Csound6-Lua-API-illegal-gen-number-tp5727258.html
>>> Sent from the Csound - General mailing list archive at Nabble.com.
>>> 
>>> 
>>> Send bugs reports to the Sourceforge bug trackers
>>> csound6:
>>>            https://sourceforge.net/p/csound/tickets/
>>> csound5:
>>>            https://sourceforge.net/p/csound/bugs/
>>> Discussions of bugs and features can be posted here
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>>> csound"
>>> 
>>> 
>> 
> ------------------------------------------------------------------------------
> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk_______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net