[Csnd] Master orc file, multiple python scripts (API question)
Date | 2020-04-16 17:24 |
From | Joshua Armenta |
Subject | [Csnd] Master orc file, multiple python scripts (API question) |
I have a master orchestra file I want to use in multiple python scripts. When I do the following: orc = "synth.orc" c.compileOrc(orc) I get an exception. When I copy and paste the entire orc file all the scripts run. Is there a different way of including an external orc only? The python script does the random generation of notes for the score, so I don't want to do a whole CSD, I just want to keep the instruments in a separate file so I can reuse the master library in multiple scripts. -- Josh Armenta, M.Mus, M.Mus., B.Mus. Composer & Conductor | Compositor y Director Mexico City | Ciudad de Mexico "If I cannot fly, let me sing." - Stephen Sondheim |
Date | 2020-04-21 23:16 |
From | Syl Morrison |
Subject | Re: [Csnd] Master orc file, multiple python scripts (API question) |
Hey dude, looks like you're telling it to literally use "synth.orc" as the orchestra instead of the contents of that file, (check compileOrc's definition here https://csound.com/docs/ctcsound/ctcsound-API.html ), you could parse the orc into a string and then just use that string, or could you not just have a CSD with nothing in the score section? On Thu, Apr 16, 2020 at 5:24 PM Joshua Armenta <josharmenta@gmail.com> wrote:
|
Date | 2020-04-22 08:27 |
From | Oeyvind Brandtsegg |
Subject | Re: [Csnd] Master orc file, multiple python scripts (API question) |
Hi, Sorry for the late reply. I think you need to use a pointer to the file object, instead of the filename string. Otherwise compileOrc will not know that you are referrring to a file. Try this: orcfile = open('synth.orc', 'r') orc = orcfile.read() self.cs.compileOrc(orc) best Oeyvind tor. 16. apr. 2020 kl. 18:24 skrev Joshua Armenta <josharmenta@gmail.com>:
|