Csound Csound-dev Csound-tekno Search About

[Csnd] chnexport segfault

Date2013-07-26 08:29
Fromfrancesco
Subject[Csnd] chnexport segfault
Hello All,
my csd using chnexport opcode was working before, but not today with 
Csound6 build yesterday.
If i comment out the line with chnexport opcode the csd work.

Has something changed?

Thanks,
ciao,
francesco.




--
View this message in context: http://csound.1045644.n5.nabble.com/chnexport-segfault-tp5726038.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2013-07-26 15:56
Fromfrancesco
Subject[Csnd] Re: chnexport segfault
Ok with Csound5, not in Csound6. I'm am on Ubuntustudio 12.04 32 bit.

my csd:



-+rtaudio=alsa -dodac


sr = 48000
ksmps = 1
nchnls = 2
0dbfs = 1

giSine ftgen 0, 0, 16384, 10, 1
gaL init 0
gaR init 0

gk1 chnexport "k1", 2
gk1 init 0
gk2 chnexport "k2", 2
gk2 init 0
gk3 chnexport "k3", 2
gk3 init 0
gk4 chnexport "k4", 2
gk4 init 0

instr 10

iAmp = p4
iCps = p5
iPan = p6

aEnv transeg 0, p3*0.3, 3, iAmp, p3*0.5, 0, iAmp, p3*0.2, -2, 0
aSin poscil aEnv, iCps, giSine

k1 port gk1, 0.1
k2 port gk2, 0.1
k3 port gk3, 0.1
k4 port gk4, 0.1

aOut chebyshevpoly aSin, 0, k1, k2, k3, k4
aL, aR pan2 aOut, iPan
gaL = gaL + aL
gaR = gaR + aR
endin

instr 1000

ilev = 0.5
al, ar reverbsc gaL, gaR, 0.7, 20000
aL = al*ilev + gaL*(1-ilev)
aR = ar*ilev + gaR*(1-ilev)
outs aL, aR
gaL = 0
gaR = 0
endin



i 1000 0 30
i10 0 30.000000 0.100000 223.000000 0.5



Thanks,
ciao,
francesco




--
View this message in context: http://csound.1045644.n5.nabble.com/chnexport-segfault-tp5726038p5726049.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2013-07-26 22:00
FromSteven Yi
SubjectRe: [Csnd] Re: chnexport segfault
Hi Franceso,

I've tried this on OSX and got pretty much no audio with both CS5 and
CS6.  I assume you're using this within a host application of some
sort?  If so, what platform are you running this on?

Thanks,
steven

On Fri, Jul 26, 2013 at 10:56 AM, francesco  wrote:
> Ok with Csound5, not in Csound6. I'm am on Ubuntustudio 12.04 32 bit.
>
> my csd:
>
> 
> 
> -+rtaudio=alsa -dodac
> 
> 
> sr = 48000
> ksmps = 1
> nchnls = 2
> 0dbfs = 1
>
> giSine ftgen 0, 0, 16384, 10, 1
> gaL init 0
> gaR init 0
>
> gk1 chnexport "k1", 2
> gk1 init 0
> gk2 chnexport "k2", 2
> gk2 init 0
> gk3 chnexport "k3", 2
> gk3 init 0
> gk4 chnexport "k4", 2
> gk4 init 0
>
> instr 10
>
> iAmp = p4
> iCps = p5
> iPan = p6
>
> aEnv transeg 0, p3*0.3, 3, iAmp, p3*0.5, 0, iAmp, p3*0.2, -2, 0
> aSin poscil aEnv, iCps, giSine
>
> k1 port gk1, 0.1
> k2 port gk2, 0.1
> k3 port gk3, 0.1
> k4 port gk4, 0.1
>
> aOut chebyshevpoly aSin, 0, k1, k2, k3, k4
> aL, aR pan2 aOut, iPan
> gaL = gaL + aL
> gaR = gaR + aR
> endin
>
> instr 1000
>
> ilev = 0.5
> al, ar reverbsc gaL, gaR, 0.7, 20000
> aL = al*ilev + gaL*(1-ilev)
> aR = ar*ilev + gaR*(1-ilev)
> outs aL, aR
> gaL = 0
> gaR = 0
> endin
>
> 
> 
> i 1000 0 30
> i10 0 30.000000 0.100000 223.000000 0.5
> 
> 
>
> Thanks,
> ciao,
> francesco
>
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/chnexport-segfault-tp5726038p5726049.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-07-27 12:17
Fromfrancesco
Subject[Csnd] Re: chnexport segfault
Hello Steven,
yes, You are right i'm controlling this csd from a Lua script,
in Ubuntustudio 12.04 32 bit.
No audio, i guess, because all k parameter for chebyshev (gk1 to gk4)
are set to 0.
It works with Csound5, not with Csound6, although i seem to remember 
that was working a few days ago (not sure now).
Commenting chnexport lines, it works.

Thank You,
ciao,
francesco.



--
View this message in context: http://csound.1045644.n5.nabble.com/chnexport-segfault-tp5726038p5726066.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2013-07-27 21:11
FromSteven Yi
SubjectRe: [Csnd] Re: chnexport segfault
Hi Francesco,

Could you attach a lua script to test this csd with?

Thanks!
steven


On Sat, Jul 27, 2013 at 7:17 AM, francesco  wrote:
> Hello Steven,
> yes, You are right i'm controlling this csd from a Lua script,
> in Ubuntustudio 12.04 32 bit.
> No audio, i guess, because all k parameter for chebyshev (gk1 to gk4)
> are set to 0.
> It works with Csound5, not with Csound6, although i seem to remember
> that was working a few days ago (not sure now).
> Commenting chnexport lines, it works.
>
> Thank You,
> ciao,
> francesco.
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/chnexport-segfault-tp5726038p5726066.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-07-28 07:11
Fromfrancesco
Subject[Csnd] Re: chnexport segfault
Yes, but i will need to adapt it. Give me some time and i will post here.
Anyway if i move gaL and gaR init after the chnexport it works.
i.e.



-+rtaudio=alsa -dodac


sr = 48000
ksmps = 1
nchnls = 2
0dbfs = 1

giSine ftgen 0, 0, 16384, 10, 1

; HERE not working (segfault)
;gaL init 0
;gaR init 0

gk1 chnexport "k1", 2
gk1 init 0.5
gk2 chnexport "k2", 2
gk2 init 0.5
gk3 chnexport "k3", 2
gk3 init 0.5
gk4 chnexport "k4", 2
gk4 init 0.5

; HERE are ok.
gaL init 0
gaR init 0

instr 10

iAmp = p4
iCps = p5
iPan = p6

aEnv transeg 0, p3*0.3, 3, iAmp, p3*0.5, 0, iAmp, p3*0.2, -2, 0
aSin poscil aEnv, iCps, giSine

k1 port gk1, 0.1
k2 port gk2, 0.1
k3 port gk3, 0.1
k4 port gk4, 0.1

aOut chebyshevpoly aSin, 0, k1, k2, k3, k4
aL, aR pan2 aOut, iPan
gaL = gaL + aL
gaR = gaR + aR
endin

instr 1000

ilev = 0.5
al, ar reverbsc gaL, gaR, 0.7, 20000
aL = al*ilev + gaL*(1-ilev)
aR = ar*ilev + gaR*(1-ilev)
outs aL, aR
gaL = 0
gaR = 0
endin



i 1000 0 30
i10 0 30.000000 0.100000 223.000000 0.5



Thank You,
ciao,
francesco.





--
View this message in context: http://csound.1045644.n5.nabble.com/chnexport-segfault-tp5726038p5726087.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2013-07-28 07:41
Fromfrancesco
Subject[Csnd] Re: chnexport segfault
Ok, attached a Lua script, but don't copy my tricks!

Thank You,
ciao,
francesco.

ws2.lua   


-- 28 luglio 2013

require "luaCsnd6"

math.randomseed(os.time())

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

local Dur = 180
local ripetizioni = 90
local step = Dur/ripetizioni

local orc = [[
sr = 44100
ksmps = 16
nchnls = 2
0dbfs = 1

giSine ftgen 0, 0, 16384, 10, 1

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; segfault
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gaL init 0
gaR init 0

gk1 chnexport "k1", 3
gk1 init 0
gk2 chnexport "k2", 3
gk2 init 0
gk3 chnexport "k3", 3
gk3 init 0
gk4 chnexport "k4", 3
gk4 init 0
gk5 chnexport "k5", 3
gk5 init 0
gk6 chnexport "k6", 3
gk6 init 0
gk7 chnexport "k7", 3
gk7 init 0
gk8 chnexport "k8", 3
gk8 init 0

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ok
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;gaL init 0
;gaR init 0

instr 10

iAmp = p4
iCps = p5
iPan = p6

kCps randomh iCps*0.975, iCps*1.025, 0.1
kCps port kCps, 5, iCps

aSin poscil iAmp, kCps, giSine

k1 port gk1, ]] .. step/2 .. "\n" .. [[
k2 port gk2, ]] .. step/2 .. "\n" .. [[
k3 port gk3, ]] .. step/2 .. "\n" .. [[
k4 port gk4, ]] .. step/2 .. "\n" .. [[
k5 port gk5, ]] .. step/2 .. "\n" .. [[
k6 port gk6, ]] .. step/2 .. "\n" .. [[
k7 port gk7, ]] .. step/2 .. "\n" .. [[
k8 port gk8, ]] .. step/2 .. "\n" .. [[

aEnv transeg 0, p3*0.1, 3, iAmp, p3*0.7, 0, iAmp, p3*0.2, -2, 0
aOut chebyshevpoly aSin, 0, k1, k2, k3, k4, k5, k6, k7, k8
aOut = aOut * 0.05 * aEnv
aL, aR pan2 aOut, iPan
gaL = gaL + aL
gaR = gaR + aR
endin

instr 1000

ilev = 0.5
al, ar reverbsc gaL, gaR, 0.8, 20000
aL = al*ilev + gaL*(1-ilev)
aR = ar*ilev + gaR*(1-ilev)
outs aL, aR
gaL = 0
gaR = 0
endin
]]

cs:SetOption("--nchnls=2")
cs:SetOption("--0dbfs=1")
cs:SetOption("-d")
cs:SetOption("-odac")
cs:Start()
perf:Play()
cs:CompileOrc (orc)
----------------------------------------------------------------------------------------------------------------------------------------------------
local start = 0
local CpsBase = 48

cs:ReadScore("i 1000 0 " .. Dur+6)

local freqRatio = {1, 3/2, 4/3}

-- 3 istanze
for i=1, 3 do
    local Cps = CpsBase * freqRatio [i]
    local amp = 1
    local pan = math.random(0, 1000) * 0.001
    cs:ReadScore(string.format("i10 %f %f %f %f %f", start, Dur, amp, Cps,
pan))
    --print("oscill", i, string.format("i10 %f %f %f %f %f", start, dur,
amp, cps, pan))
end

for i=1, ripetizioni do
    local k1 = 1 - math.random(0, 2000)*0.001
    local k2 = 1 - math.random(0, 2000)*0.001
    local k3 = 1 - math.random(0, 2000)*0.001
    local k4 = 1 - math.random(0, 2000)*0.001
    local k5 = 1 - math.random(0, 2000)*0.001
    local k6 = 1 - math.random(0, 2000)*0.001
    local k7 = 1 - math.random(0, 2000)*0.001
    local k8 = 1 - math.random(0, 2000)*0.001
    --print(k1, k2, k3, k4, k5, k6, k7, k8)
    cs:SetChannel("k1", k1)
    cs:SetChannel("k2", k2)
    cs:SetChannel("k3", k3)
    cs:SetChannel("k4", k4)
    cs:SetChannel("k5", k5)
    cs:SetChannel("k6", k6)
    cs:SetChannel("k7", k7)
    cs:SetChannel("k8", k8)
    --luaCsnd6.csoundSleep(Dur*100)
    local time = os.time()
    repeat
        local now = os.time()
        until now<(time+step)
end
    
perf:Join()
perf:Stop()

os.remove("test.orc")
os.remove("test.sco")





--
View this message in context: http://csound.1045644.n5.nabble.com/chnexport-segfault-tp5726038p5726088.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2013-07-31 13:09
FromSteven Yi
SubjectRe: [Csnd] Re: chnexport segfault
Hi Francesco,

I think I've found the bug and fixed it.  Took a while to get setup as
I had to get the Lua interface built and figure out some gdb issues
with pthread.  The project runs for me now, but I did the debugging in
a Virtual Machine (Debian 7.1 amd64) so it was going really slow for
audio output.  I can't test as the Lua interface doesn't build on OSX.
 Could you retest with the latest from GIT?

Thanks!
steven

On Sun, Jul 28, 2013 at 8:41 AM, francesco  wrote:
> Ok, attached a Lua script, but don't copy my tricks!
>
> Thank You,
> ciao,
> francesco.
>
> ws2.lua 
>
>
> -- 28 luglio 2013
>
> require "luaCsnd6"
>
> math.randomseed(os.time())
>
> local cs = luaCsnd6.Csound()
> local perf = luaCsnd6.CsoundPerformanceThread(cs)
>
> local Dur = 180
> local ripetizioni = 90
> local step = Dur/ripetizioni
>
> local orc = [[
> sr = 44100
> ksmps = 16
> nchnls = 2
> 0dbfs = 1
>
> giSine ftgen 0, 0, 16384, 10, 1
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> ;; segfault
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> gaL init 0
> gaR init 0
>
> gk1 chnexport "k1", 3
> gk1 init 0
> gk2 chnexport "k2", 3
> gk2 init 0
> gk3 chnexport "k3", 3
> gk3 init 0
> gk4 chnexport "k4", 3
> gk4 init 0
> gk5 chnexport "k5", 3
> gk5 init 0
> gk6 chnexport "k6", 3
> gk6 init 0
> gk7 chnexport "k7", 3
> gk7 init 0
> gk8 chnexport "k8", 3
> gk8 init 0
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> ;; ok
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> ;gaL init 0
> ;gaR init 0
>
> instr 10
>
> iAmp = p4
> iCps = p5
> iPan = p6
>
> kCps randomh iCps*0.975, iCps*1.025, 0.1
> kCps port kCps, 5, iCps
>
> aSin poscil iAmp, kCps, giSine
>
> k1 port gk1, ]] .. step/2 .. "\n" .. [[
> k2 port gk2, ]] .. step/2 .. "\n" .. [[
> k3 port gk3, ]] .. step/2 .. "\n" .. [[
> k4 port gk4, ]] .. step/2 .. "\n" .. [[
> k5 port gk5, ]] .. step/2 .. "\n" .. [[
> k6 port gk6, ]] .. step/2 .. "\n" .. [[
> k7 port gk7, ]] .. step/2 .. "\n" .. [[
> k8 port gk8, ]] .. step/2 .. "\n" .. [[
>
> aEnv transeg 0, p3*0.1, 3, iAmp, p3*0.7, 0, iAmp, p3*0.2, -2, 0
> aOut chebyshevpoly aSin, 0, k1, k2, k3, k4, k5, k6, k7, k8
> aOut = aOut * 0.05 * aEnv
> aL, aR pan2 aOut, iPan
> gaL = gaL + aL
> gaR = gaR + aR
> endin
>
> instr 1000
>
> ilev = 0.5
> al, ar reverbsc gaL, gaR, 0.8, 20000
> aL = al*ilev + gaL*(1-ilev)
> aR = ar*ilev + gaR*(1-ilev)
> outs aL, aR
> gaL = 0
> gaR = 0
> endin
> ]]
>
> cs:SetOption("--nchnls=2")
> cs:SetOption("--0dbfs=1")
> cs:SetOption("-d")
> cs:SetOption("-odac")
> cs:Start()
> perf:Play()
> cs:CompileOrc (orc)
> ----------------------------------------------------------------------------------------------------------------------------------------------------
> local start = 0
> local CpsBase = 48
>
> cs:ReadScore("i 1000 0 " .. Dur+6)
>
> local freqRatio = {1, 3/2, 4/3}
>
> -- 3 istanze
> for i=1, 3 do
>     local Cps = CpsBase * freqRatio [i]
>     local amp = 1
>     local pan = math.random(0, 1000) * 0.001
>     cs:ReadScore(string.format("i10 %f %f %f %f %f", start, Dur, amp, Cps,
> pan))
>     --print("oscill", i, string.format("i10 %f %f %f %f %f", start, dur,
> amp, cps, pan))
> end
>
> for i=1, ripetizioni do
>     local k1 = 1 - math.random(0, 2000)*0.001
>     local k2 = 1 - math.random(0, 2000)*0.001
>     local k3 = 1 - math.random(0, 2000)*0.001
>     local k4 = 1 - math.random(0, 2000)*0.001
>     local k5 = 1 - math.random(0, 2000)*0.001
>     local k6 = 1 - math.random(0, 2000)*0.001
>     local k7 = 1 - math.random(0, 2000)*0.001
>     local k8 = 1 - math.random(0, 2000)*0.001
>     --print(k1, k2, k3, k4, k5, k6, k7, k8)
>     cs:SetChannel("k1", k1)
>     cs:SetChannel("k2", k2)
>     cs:SetChannel("k3", k3)
>     cs:SetChannel("k4", k4)
>     cs:SetChannel("k5", k5)
>     cs:SetChannel("k6", k6)
>     cs:SetChannel("k7", k7)
>     cs:SetChannel("k8", k8)
>     --luaCsnd6.csoundSleep(Dur*100)
>     local time = os.time()
>     repeat
>         local now = os.time()
>         until now<(time+step)
> end
>
> perf:Join()
> perf:Stop()
>
> os.remove("test.orc")
> os.remove("test.sco")
>
>
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/chnexport-segfault-tp5726038p5726088.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-07-31 14:31
Fromfrancesco
Subject[Csnd] Re: chnexport segfault
Thank You.
I've rebuild and seems ok now.

Again thanks,
ciao,
francesco.




--
View this message in context: http://csound.1045644.n5.nabble.com/chnexport-segfault-tp5726038p5726173.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2013-08-01 11:41
FromSteven Yi
SubjectRe: [Csnd] Re: chnexport segfault
Fantastic, thanks for verifying!

On Wed, Jul 31, 2013 at 3:31 PM, francesco  wrote:
> Thank You.
> I've rebuild and seems ok now.
>
> Again thanks,
> ciao,
> francesco.
>
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/chnexport-segfault-tp5726038p5726173.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"
>
>