keep getting a syntax error
Date | 2017-03-16 08:51 |
From | "Gabriel (Gabe) Rosser" |
Subject | keep getting a syntax error |
I’m working in the beginning of the Csound book, and I’ve coded out the etude1 piece, but can’t get it to run properly. Here’s my code: <CsoundSynthesizer> <CsOptions> -odac </CsOptions> <CsInstruments> sr = 44100 kr = 441 ksmps = 100 nchnls = 1 0dbfs = 1.0 instr 101 ; simple oscil a1 oscil 1000, 440, 1 out a1 endin instr 102 ;simple fm a1 foscil 1000, 440, 1, 2, 3, 1, out a1 endin
instr 103 ;simple buzz a1 buzz 1000, 440, 10, 1 out a1 endin instr 104 ;simple waveguide a1 pluck 1000, 440, 440, 2, 1 out a1 endin instr 105 ;simple granular a1 grain 10000, 440, 55, 10000, 10, .05, 1, 3, 1 out a1 endin instr 106 ;simnple wavetable a1 loscil 10000, 440, 4 out a1 endin </CsInstruments> <CsScore> ; function 1 uses a GEN10 subroutine to compute a sinewave ; function 2 uses a GEN10 subroutine to issue the first 16 partials of a sawtooth wave ; function 3 uses the GEN20 subroutine to compute a Hanning window for use as a grain envelope ; function 4 GEN1 to fill a table with a 44.1k mono 16 bit AIF format soundfile of a male vocalist singing the word la at the pitch A440 for 3 seconds. f 1 0 4096 10 1 f 2 0 4096 10 1 .5 .333 .25 .2 .166 .142 .125 .111 .1 .09 .083 .076 .071 .066 .062 f 3 0 4097 20 2 f 4 0 0 1 "sing.aif" 0 4 0 ;inststartduration i 101 0 3 i 102 4 3 i 103 8 3 i 104 12 3 i 105 16 3 i 106 20 3 </CsScore> </CsoundSynthesizer> Console output: error: syntax error, unexpected T_IDENT, expecting NEWLINE or ',' (token "a1") from file /var/folders/f6/bk2m5dbd68d3nmzdls45p3b40000gn/T/csoundqt-temp.csd (1) line 19: >>> out a1 <<< Parsing failed due to invalid input! Stopping on parser failure cannot compile orchestra end of score. I’ve looked at line 19 and compared it with the example etude1 piece and can’t find any differences…what could be the issue? Gabe |
Date | 2017-03-16 09:05 |
From | Karin Daum |
Subject | Re: keep getting a syntax error |
just remove the comma at the end of the line before a1 foscil 1000, 440, 1, 2, 3, 1,<<<<
|
Date | 2017-03-16 09:06 |
From | "Gabriel (Gabe) Rosser" |
Subject | Re: keep getting a syntax error |
Ah thank you! Gabe
|
Date | 2017-03-16 09:13 |
From | Salvatore Mirenda |
Subject | Re: keep getting a syntax error |
Hi, in instr 102 there's a comma in the foscil opcode (, after the last number 1). Take it away and it will work. Il 16 mar 2017 09:52, "Gabriel (Gabe) Rosser" <grosser@crimson.ua.edu> ha scritto:
|