Csound Csound-dev Csound-tekno Search About

[Csnd] Error with UDO

Date2011-10-19 04:02
FromForrest Cahoon
Subject[Csnd] Error with UDO
This is the first UDO I've tried to write, and I'm getting an error.  I want to translate one number (a note number in my custom scale) to another number (the frequency).  Here's a simple version:

<CsoundSynthesizer>

<CsOptions>

</CsOptions>

<CsInstruments>

opcode getFreq, i, i

iNoteNum xin

iFreq = 0

if (iNoteNum == 1) then

iFreq = 224

elseif (iNoteNum == 2) then

iFreq = 256

else

iFreq = 16000 ; high freq indicates error

xout iFreq

endop

</CsInstruments>

<CsScore>

</CsScore>

</CsoundSynthesizer>


And here's the error I get:

orch compiler:
    opcode    getFreq    i    i   
error line 5.  unknown label:
        iFreq = 224
1 syntax errors in orchestra.  compilation invalid


I've tried all sorts of variations on this but can't seem to get it to work. What am I doing wrong?

Forrest


Date2011-10-19 04:06
FromAdam Puckett
SubjectRe: [Csnd] Error with UDO
Try writing "endif" before "xout iFreq."

On 10/19/11, Forrest Cahoon  wrote:
> This is the first UDO I've tried to write, and I'm getting an error.  I want
> to translate one number (a note number in my custom scale) to another number
> (the frequency).  Here's a simple version:
>
>  
>
> 
>
> 
>
> 
>
> opcode getFreq, i, i
>
> iNoteNum xin
>
> iFreq = 0
>
> if (iNoteNum == 1) then
>
> iFreq = 224
>
> elseif (iNoteNum == 2) then
>
> iFreq = 256
>
> else
>
> iFreq = 16000 ; high freq indicates error
>
> xout iFreq
>
> endop
>
> 
>
> 
>
> 
>
> 
>
> And here's the error I get:
>
> orch compiler:
>     opcode    getFreq    i    i
> error line 5.  unknown label:
>         iFreq = 224
> 1 syntax errors in orchestra.  compilation invalid
>
>
> I've tried all sorts of variations on this but can't seem to get it to work.
> What am I doing wrong?
>
> Forrest
>
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-10-19 05:29
FromForrest Cahoon
SubjectRe: [Csnd] Error with UDO
Dang, I didn't see what I was missing because I was "sure" it was there.
Of course that was the problem. Thanks!

Forrest

On Tue, Oct 18, 2011 at 10:06 PM, Adam Puckett <adotsdothmusic@gmail.com> wrote:
Try writing "endif" before "xout iFreq."
 
On 10/19/11, Forrest Cahoon <forrest.cahoon@gmail.com> wrote:
> This is the first UDO I've tried to write, and I'm getting an error.  I want
> to translate one number (a note number in my custom scale) to another number
> (the frequency).  Here's a simple version:
>
>  <CsoundSynthesizer>
>
> <CsOptions>
>
> </CsOptions>
>
> <CsInstruments>
>
> opcode getFreq, i, i
>
> iNoteNum xin
>
> iFreq = 0
>
> if (iNoteNum == 1) then
>
> iFreq = 224
>
> elseif (iNoteNum == 2) then
>
> iFreq = 256
>
> else
>
> iFreq = 16000 ; high freq indicates error
>
> xout iFreq
>
> endop
>
> </CsInstruments>
>
> <CsScore>
>
> </CsScore>
>
> </CsoundSynthesizer>
>
> And here's the error I get:
>
> orch compiler:
>     opcode    getFreq    i    i
> error line 5.  unknown label:
>         iFreq = 224
> 1 syntax errors in orchestra.  compilation invalid
>
>
> I've tried all sorts of variations on this but can't seem to get it to work.
> What am I doing wrong?
>
> Forrest
>
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2011-10-19 14:11
FromAdam Puckett
SubjectRe: [Csnd] Error with UDO
I'm glad I could help.

On 10/19/11, Forrest Cahoon  wrote:
> Dang, I didn't see what I was missing because I was "sure" it was there.
> Of course that was the problem. Thanks!
>
> Forrest
>
> On Tue, Oct 18, 2011 at 10:06 PM, Adam Puckett
> wrote:
>
>> Try writing "endif" before "xout iFreq."
>>
>>
> On 10/19/11, Forrest Cahoon  wrote:
>> > This is the first UDO I've tried to write, and I'm getting an error.  I
>> want
>> > to translate one number (a note number in my custom scale) to another
>> number
>> > (the frequency).  Here's a simple version:
>> >
>> >  
>> >
>> > 
>> >
>> > 
>> >
>> > 
>> >
>> > opcode getFreq, i, i
>> >
>> > iNoteNum xin
>> >
>> > iFreq = 0
>> >
>> > if (iNoteNum == 1) then
>> >
>> > iFreq = 224
>> >
>> > elseif (iNoteNum == 2) then
>> >
>> > iFreq = 256
>> >
>> > else
>> >
>> > iFreq = 16000 ; high freq indicates error
>> >
>> > xout iFreq
>> >
>> > endop
>> >
>> > 
>> >
>> > 
>> >
>> > 
>> >
>> > 
>> >
>> > And here's the error I get:
>> >
>> > orch compiler:
>> >     opcode    getFreq    i    i
>> > error line 5.  unknown label:
>> >         iFreq = 224
>> > 1 syntax errors in orchestra.  compilation invalid
>> >
>> >
>> > I've tried all sorts of variations on this but can't seem to get it to
>> work.
>> > What am I doing wrong?
>> >
>> > Forrest
>> >
>> > Send bugs reports to the Sourceforge bug tracker
>> >             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> > Discussions of bugs and features can be posted here
>> > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> > csound"
>> >
>> >
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>>
>
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"