< Back to IRCAM Forum

STK user-defined opcodes

Hi All,

I have a problem in OMChroma with a user class that is using a STK opcode (STKClarinet). I enclose the figure of the patch. The text of the orchestra loaded with get-instrument is the following:

instr 1

;asignal STKClarinet ifrequency, iamplitude, [kstiff, kv1[, knoise, kv2[, klfo, kv3[, klfodepth, kv4[, kbreath, kv5]]]]]

ifreq = p5
iamp = p4
kv1 = p6 ;kstiff 0-127
kv2 = p7 ;knoise 0-127
kv3 = p8 ;klfo 0-127
kv4 = p9 ;klfodepth 0-127
kv5 = p10 ;kbreath 0-127

asig STKClarinet ifreq, iamp, 2, kv1, 4, kv2, 11, kv3, 1, kv4, 128, kv5

outs asig, asig  

endin

In OMChroma I receive the following error in rendering the audio file:

:: error: syntax error, unexpected T_IDENT (token “STKClarinet”) from file /Users/fabio/Desktop/Balaenoptera/materiale_OM/out-files/.orc (1)
:: line 28:
:: >>>asig STKClarinet# <<<
:: Unexpected untyped word asig when expecting a variable

If I generate only .orc and .sco files (:run option in synthesize object) the same error is present using WinXound:

error: syntax error, unexpected T_IDENT (token “STKClarinet”) from file /Users/fabio/Desktop/Balaenoptera/materiale_OM/out-files/my_synt.csd (1)
line 33:

asig STKClarinet# <<<
Unexpected untyped word asig when expecting a variable

On the contrary, if I load the .orc file in CsoundQt it runs perfectly, both in real time and in rendering the audio file.
It seems to me it could be an error linked to Csound6 and STK opcodes, if so, I apologize if this is not the place where to post this message.

Thank You in advance for help.

fdsdb

stk_patch.png

Hello,

It is hard to reply when seeing only the orchestra. Would you, please, send the .orc and .sco files that give the problem? I can then test them with csound (on a Mac, both 6 and 5). If they do not work, but the syntax is correct, it might be a csound problem, rather than a OMChroma problem.
However, already the first line of the error message is curious: the orchestra file has no name, only an extension “.orc”.
Thank you.

Marco

Dear Marco,

Thank you for your rapid answer. I enclose the .orc and .sco files. There is an incongruence in number of channels and a lot of samples result out of range, but the problem is the same of my other post: no synthesis from OM, neither using WinXound, but rendering using CsoundQt.

Thank you in advance,

Ciao

Fabio De Sanctis De Benedictis

Sorry, Fabio,

But I do not find the orchestra and score files. Would you, please, mind, to send them directly to my ircam address (“my first-name, low case” @ ircam.fr)?
I will check with my computer and will let you know.

Back to you soon.

Marco

@Marco,

Dear Marco,

I have sent you the files (.orc and .sco), I hope I have used the right mail address: have you received them?
Thank you

Ciao

fdsdb

Hello again, Fabio,

Sorry for this late reply. I was not well connected to the internet and had to search for the problem a little. The behaviour of your orchestra has probably little to do with OMChroma. My feeling is that you did not install the csound STK Opcodes, which are not installed automatically by csound (see: http://csound.github.io/docs/manual/STKTop.html). OMChroma does not know anything about csound, it just generates an orchestra and score file according to the instructions that you gave it when you defined the class with get-instrument.
I would recommend that you post a mail to the csound mailing list (new address: csound-users@lists.sourceforge.net), which is quite active, and ask for the way to install the opcodes. In the Stanford site, it is only explained how to install them for csound 5, but are are now in the csound 6 (.03.2) world!
I hope this reply does not come too late and might be useful for you.
Let us know how it works. We might add a remark concerning this in a further release of the documentation of OMChroma.
All the best,

Marco

Dear Marco,

Thank you very much for your answer, it comes absolutely in time, please, don’t worry.
I think yours is the right way to solve the problem: in fact on my terminal csound -z says to me that I must define RAWWAVE_PATH, and I have no STK opcodes at all; if I digit locate stk (or STK) on terminal I see I have no waves or directories into my HD. The strange thing is that using CsoundQT with scores and orchestras realized in OM everything runs perfectly, even if, also inside CsoundQT, RAWWAVE_PATH is not specified…
Well, I am going to ask about this problem to csound list, if I find a solution I will post it on this list.

Thank you again,

Ciao

Fabio

Hi All,

I have resolved. First of all thanks to Marco Stroppa for useful suggestions. I have adopted the following procedure:

  1. I have downloaded the Synthesis Toolkit, the source distribution: http://ccrma.stanford.edu/software/stk/release/stk-4.5.0.tar.gz, than I have compiled it (./configure and make terminal commands, eventually make install as Administrator for installing at wide system level), but perhaps the compilation/installation is not necessary; it is important to have the rawwaves folder somewhere in your hard disk; i have it in a lib folder in my home directory

  2. I have set RAWWAVE_PATH environment variable adding it to my .bash_profile file; also this can be unnecessary, but permit to use Csound from terminal

  3. In OpenMusic I have loaded OMChroma library

  4. In OpenMusic Preferences I have selected Externals and I have opened Csound Options

  5. In the Csound default Flags i have added the following: --env:RAWWAVE_PATH=

Now everything run without problems. I hope I have been clear. I enclose a screenshot of Csound default Flags.

Best

fdsdb

Schermata-2014-12-06-alle-11.04.53.png

Hi All,

I have resolved. First of all thanks to Marco Stroppa for useful suggestions. I have adopted the following procedure:

  1. I have downloaded the Synthesis Toolkit, the source distribution: http://ccrma.stanford.edu/software/stk/release/stk-4.5.0.tar.gz, than I have compiled it (./configure and make terminal commands, eventually make install as Administrator for installing at wide system level), but perhaps the compilation/installation is not necessary; it is important to have the rawwaves folder somewhere in your hard disk; i have it in a lib folder in my home directory

  2. I have set RAWWAVE_PATH environment variable adding it to my .bash_profile file; also this can be unnecessary, but permit to use Csound from terminal

  3. In OpenMusic I have loaded OMChroma library

  4. In OpenMusic Preferences I have selected Externals and I have opened Csound Options

  5. In the Csound default Flags i have added the following: --env:RAWWAVE_PATH= (env preceeded by two minus signs - - env)

Now everything run without problems. I hope I have been clear. I enclose a screenshot of Csound default Flags.

Best

fdsdb

Schermata-2014-12-06-alle-11.04.53.png