csound-expression icon indicating copy to clipboard operation
csound-expression copied to clipboard

Unable to find opcode entry for 'FLpanel' with matching argument types

Open jwaldmann opened this issue 2 years ago • 1 comments

possible duplicate of #13 #69 but since it's a different error message, I'm writing a separate issue.

When I run

dacBy (setTrace <> setJackv "cse") $ do 
 (g,f) <- slider "f" (expSpan 20 2e4) 440 
 panel g ; return $ osc f 

I am getting

0dBFS level = 32768.0
--Csound version 6.16 (double samples) Jul 19 2023
[commit: none]
libsndfile-1.1.0
UnifiedCSD:  /tmp/tmp.csd
STARTING FILE
Creating options
Creating orchestra
closing tag
Creating score
rtmidi: ALSA Raw MIDI module enabled
rtaudio: JACK module enabled
error:  Unable to find opcode entry for 'FLpanel' with matching argument types:
Found: (null) FLpanel cccccc
Line: 23
 from file /tmp/tmp.csd (1)
Parsing failed due to syntax errors
Stopping on parser failure
cannot compile orchestra
end of score.		   overall amps:      0.0
	   overall samples out of range:        0
1 errors in performance
Elapsed time at end of performance: real: 0.002s, CPU: 0.002s

this is csound as it comes with Fedora-39.

One comment recommended that this command "should produce output".

$ csound -z1 2>&1|grep FLp
FLpack      (null)      iiiiooo
FLpackEnd   (null)      (null)
FLpack_end  (null)      (null)
FLpanel     (null)      Sjjjoooo
FLpanelEnd  (null)      (null)
FLpanel_end (null)      (null)
FLprintk    (null)      iki
FLprintk2   (null)      ki

[EDIT] I was assuming that (null) indicates some kind of error but I now think it's a compressed type declaration, vis. https://csound.com/docs/manual/FLpanel.html

FLpanel "label", iwidth, iheight [, ix] [, iy] [, iborder] [, ikbdcapture] [, iclose]

apparently, no result, and these arguments: one string, two int, then five optional (int?). This does not seem to match Sjjjoooo exactly (three j)

jwaldmann avatar Nov 24 '23 16:11 jwaldmann

I think that csound-expression produces syntax errors when writing the code that calls FLpanel.

$ ghci -package csound-expression -package text

-- the following is in ghci (line by line)

import Csound.Base
import Data.Text.IO
:set -XOverloadedStrings

Data.Text.IO.writeFile "check.csd" =<< (renderCsdBy setThru  $ do (g,f) <- slider "f" (expSpan 20 2e4) 440  ; panel g ; return $ osc f)

now at the shell prompt

$ csound check.csd
UnifiedCSD:  check.csd
error:  Unable to find opcode entry for 'FLpanel' with matching argument types:

Found: (null) FLpanel cccccc
Line: 23
 from file check.csd (1),Parsing failed due to syntax errors
Stopping on parser failure
cannot compile orchestra

When I manually patch the file, it works

$ diff check.csd check-patched.csd
23,24c23,24
< FLpanel , 45, 170, -1, -1, 0, 0
< gkrgg0, girgh0 FLslider f, 20.0, 20000.0, -1, 22, -1, 25, 140, 10, 10
---
> FLpanel "panel" , 45, 170, -1, -1, 0, 0
> gkrgg0, girgh0 FLslider "f", 20.0, 20000.0, -1, 22, -1, 25, 140, 10, 10

  • FLpanel is missing the first argument (the name of the panel)
  • FLslider is missing string quotes around first argument

jwaldmann avatar Dec 14 '24 18:12 jwaldmann