| I think the simplest way to get RT playback is to use the
realtime modules that come with Csound (unless you
are in platform that does not have them). csoundSetRTPlaybackOpen()
et al are there so that you can implement your own RT, if
Csound does not provide it or you have a very good reason for
re-writing the RT modules.
So all you need to do is to pass the "-o dac" option to Csound,
which can be done either as an argument to csoundCompile()
(or Csound::Compile()) or in the
field of a CSD file.
Victor
At 22:54 08/07/2007, you wrote:
>Greetings everyone,
>Iâm an undergrad computer science student trying my best to write a Csound
>frontend. I discovered Csound about two years ago and I started this
>frontend project when classes let out for the summer. Most of my time so far
>has been spent learning the windows API to create the GUI. Thanks to Roryâs
>.pdf, my program renders a wave file from orchestra and score files just
>fine.
>
>Real-time has been more difficult. My initial goal is to get an oscillator
>to play whenever I press a key. My current build uses csoundCreateThread()
>and csoundScoreEvent() as described in Roryâs .pdf. Iâve got it to
>build and
>run without crashing, but no noise plays. So after studying csound.h and
>scanning the mailing list archives, Iâve decided itâs time to come out of
>the shadows and ask my first two of probably several questions:
>
>1. I need very simple Csound files to test real-time performance. I just
>want to be sure these will work:
>
>--- .sco ---
>f1 0 2048 10 1 ;Sine
>f0 120
>e
>
>--- .orc ---
>instr 1
> a1 oscil 12000, 400,1
> out a1
>endin
>
>I then send to csoundInitialize() âcsound orcFilePath scoFilePath
>odacâ. I
>send to csoundScoreEvent() only p1 = 1, as my instrument takes no parameters
>except p1 = 1 tells it to use the instrument named 1, correct?
>
>2. csound.h seems to suggest that csoundSetPlayopenCallback() and
>csoundSetRtplayCallback() would be useful to me as they are commented as
>âfor real-time useâ, but Iâm lost as to how to use them. My end goal
>is to
>bind keyboard keys to instruments and parameters (e.g. âAâ corresponds to
>instrument 1 with p2 = 400) and then have those notes play when pressed.
>Pseudocode:
>
>BeginPerformance()
>Loop: If(keypress) then PlayNote()
>EndPerformance()
>
>Should I concern myself with csoundSetRtplayCallback(), etc.? Is
>csoundScoreEvent() the way to go? Is there a better way?
>
>Thanks for reading. I feel if I can just get this simple oscillator to play
>I will be able to accomplish the rest of my project goals with enough
>effort. At that point I look forward to sharing it with you all.
>
>- Ben Johnson
>
>--
>View this message in context:
>http://www.nabble.com/API-Real-time-questions-tf4046102.html#a11493207
>Sent from the Csound - Dev mailing list archive at Nabble.com.
>
>
>-------------------------------------------------------------------------
>This SF.net email is sponsored by DB2 Express
>Download DB2 Express C - the FREE version of DB2 express and take
>control of your XML. No limits. Just data. Click to get it now.
>http://sourceforge.net/powerbar/db2/
>_______________________________________________
>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 DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |