Csound Csound-dev Csound-tekno Search About

[Csnd] .py file doesn't play even "0 errors in perfomance" message.

Date2013-09-19 12:00
FromPablo Frank
Subject[Csnd] .py file doesn't play even "0 errors in perfomance" message.
AttachmentsFailed_output.py  MY_notes.py  MY_test.csd  
.py file doesn't play even "0 errors in perfomance" message. Probably i don't identify the mistake.
python 2.7 and csound 5.19 used.
Files pasted below and attached.


Failed_output.py

import time
import csnd

cs = csnd.Csound() 

cs.Compile("My_test.csd") # see My_test.csd  below in this page

perf = csnd.CsoundPerformanceThread(cs)

execfile("MY_notes.py")# see MY_notes.py  below in this page

perf.Play()


;;;;;; My_test.csd  :

<CsoundSynthesizer>
<CsOptions>
-odac3 -d
</CsOptions>
<CsInstruments>

sr      =    44100
kr       =     44100
ksmps     =      1
nchnls     =      1

instr 1
aoscil    oscil 1000, 200, 1
out aoscil
endin


</CsInstruments>
<CsScore>
f1     0     4096     10         1
</CsScore>
</CsoundSynthesizer>


;;;;; MY_notes.py  :

for i in range(1,5):
    perf.InputMessage("i 1 %d 1 % (i)")


Date2013-09-19 12:25
Fromzappfinger
Subject[Csnd] Re: .py file doesn't play even "0 errors in perfomance" message.
Try a time.sleep(300) after perf.Play()...

Richard 



--
View this message in context: http://csound.1045644.n5.nabble.com/py-file-doesn-t-play-even-0-errors-in-perfomance-message-tp5727695p5727696.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2013-09-19 17:12
FromSteven Yi
SubjectRe: [Csnd] Re: .py file doesn't play even "0 errors in perfomance" message.
AttachmentsMY_notes.py  MY_test.csd  Failed_output.py  
Hi Pablo,

I modified a few things to get it to work.  Some notes:

1. I changed to Csound 6, but should work if you change to Csound5.
2. The CSD had an ftable, but that gets loaded and at this point
there's no score. You're using inputMessage but I think those realtime
events happen after Csound runs it's first kperf.  My guess is that
Csound loads your CSD, runs once and sees no score and ends, then the
performancethread.InputMessage doesn't have a chance to run.
3. After adding a dummy f-table statement, things ran but the code in
MY_notes.py was wrong, creating invalid notes.  I modified that.
4. I added perf.Join() at the end.  That will wait until the Csound
performance thread is completed before moving on.

Hope that helps!
steven

On Thu, Sep 19, 2013 at 7:25 AM, zappfinger  wrote:
> Try a time.sleep(300) after perf.Play()...
>
> Richard
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/py-file-doesn-t-play-even-0-errors-in-perfomance-message-tp5727695p5727696.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"
>
>