Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error with cl-manual, chords #4

Closed
clfest opened this issue Jan 25, 2018 · 9 comments
Closed

error with cl-manual, chords #4

clfest opened this issue Jan 25, 2018 · 9 comments

Comments

@clfest
Copy link

clfest commented Jan 25, 2018

I am running SuperCollider 3.9.0-rc2. Running through the examples (in sequence) on everything's fine until
I reach on page 12:

/make(anapadVC:pad/chordBP:ch(chords:\one));

It errors out, posting this:

ERROR: clMake: Fact('anapadVC') does not exist

PROTECTED CALL STACK:
a FunctionDef 0x800d4e8
sourceCode = "{ |stream|
var fact, target, parms, ch, start, factory;
#fact, ch = ~parseWord.(stream);
if(Fact.exists(fact.asSymbol).not) {
Error("clMake: Fact('%') does not exist".format(fact)).throw;
};
if(ch == $:) {
#target, ch = ~parseWord.(stream);
if(target.isEmpty) {
"clMake: empty target name for Fact(%), reverting to default"
.format(fact.asSymbol.asCompileString).warn;
target = nil;
};
};
if(ch == $() {
start = stream.pos;
\clParseBracketed.eval(...etc..."
arg stream = a CollStream
var fact = anapadVC
var target = nil
var parms = nil
var ch = :
var start = nil
var factory = nil
a FunctionDef 0x800cf28
sourceCode = "{ |code|
var stream = CollStream(code), ch, continue = true;
~ids = Array.new;
while { (ch = stream.next).notNil and: { ch != $( } };
if(ch != $() {
Error("clMake expected parentheses").throw;
};
while { continue } {
~ids = ~ids.add(~parseOne.(stream));
ch = stream.peek;
case
{ ch == $/ } { continue = true; stream.next }
{ ch.isNil or: { ch == $) } } { continue = false }
{ Error("clMake: invalid separator '%'".format(ch)).throw };
};
if(ch.isNil) {
...etc..."
arg code = make(anapadVC:pad/chordBP:ch(chords:\one))
var stream = a CollStream
var ch = (
var continue = true
a FunctionDef 0x800c688
sourceCode = "{ |code|
~parseIDs.(code);
~writeCode.();
}"
arg code = make(anapadVC:pad/chordBP:ch(chords:\one))
a FunctionDef 0x3c88d00
sourceCode = ""
a FunctionDef 0x3c86d40
sourceCode = ""
Function:prTry 0x32bf740
arg this = a Function
var result = nil
var thread = a Thread
var next = a Function
var wasInProtectedFunc = true
Function:protect 0x32becc0
arg this = a Function
arg handler = a Function
var result = nil
Proto:use 0x3c867c0
arg this = a Proto
arg func = a Function
arg failSilentlyAfterFree = false
var result = nil
var saveEnvir = a Proto
Proto:doesNotUnderstand 0x3c885c0
arg this = a Proto
arg selector = process
arg args = nil
var result = [ make(anapadVC:pad/chordBP:ch(chords:\one)) ]
var item = nil
a FunctionDef 0x8098098
sourceCode = ""
arg assn = (clMake -> ^ make(.))
ArrayedCollection:do 0x3fb9d00
arg this = [ (clMake -> ^ make(.)), (clFuncCall -> ^ id\.\(.*\)), (clPassThru -> ^ *([A-Z][A-Za-z0-9_]*\.)?id(.)), (clChuck -> ^ ([A-Z][A-Za-z0-9_].)?id *=>.*), (clPatternSet -> ^ *id(.|id|id*[0-9]+)* = .), (clGenerator -> ^ id(\.|id) *.), (clXferPattern -> ^ id(\.id)?(*int)? ->>), (clCopyPattern -> ^ *id(.id)?(\*int)? ->), (clStartStop -> ^([/spc]*id)+[spc]*[+-]), (clPatternToDoc -> ^ *id(.|id)*(\*[0-9]+)?[spc]$) ]
arg function = a Function
var i = 0
a FunctionDef 0x8098208
sourceCode = ""
arg break = a Function
a FunctionDef 0x3c88d00
sourceCode = ""
a FunctionDef 0x3c86d40
sourceCode = ""
Function:prTry 0x32bf740
arg this = a Function
var result = nil
var thread = a Thread
var next = nil
var wasInProtectedFunc = false

CALL STACK:
Exception:reportError
arg this =
Nil:handleError
arg this = nil
arg error =
Thread:handleError
arg this =
arg error =
Object:throw
arg this =
Function:protect
arg this =
arg handler =
var result =
Proto:use
arg this =
arg func =
arg failSilentlyAfterFree = false
var result = nil
var saveEnvir =
Proto:doesNotUnderstand
arg this =
arg selector = 'process'
arg args = [*1]
var result = nil
var item =
< FunctionDef in closed FunctionDef >
arg stmt = "/make(anapadVC:pad/chordBP:c..."
arg i = 0
ArrayedCollection:do
arg this = [*2]
arg function =
var i = 0
< closed FunctionDef >
arg code = [*2]
Interpreter:interpretPrintCmdLine
arg this =
var res = nil
var func = nil
var code = "/make(anapadVC:pad/chordBP:c..."
var doc = nil
var ideClass =
Process:interpretPrintCmdLine
arg this =
^^ The preceding error dump is for ERROR: clMake: Fact('anapadVC') does not exist

What gives?

Thank You for Your Attention

@jamshark70
Copy link
Owner

Can't reproduce it here, and I checked the file containing anapadVC: it's in github, and the version in github is the same as my local version.

The most likely explanation is that the file is either missing or out of date. Check the top of the output here:

"cd % && git log chord-vc.scd".format(Quarks.at("ddwLivecodeInstruments").localPath).unixCmd;

Latest entry should be d50380c9, raising filter frequencies. If yours doesn't match, try updating.

Otherwise: did you get an error when running \loadAllCl.eval? If the file got corrupted, a syntax error in it would prevent the definition from loading.

@jamshark70
Copy link
Owner

Not reproducible, no further information provided. Closing.

@clfest
Copy link
Author

clfest commented Feb 7, 2018

I have updated, and I've updated the various ddw quarks too. It seems to pass your tests. Still it errors out at:

/make(anapadVC:pad/chordBP:ch(chords:\one));

but the error is different, it reads:

ERROR: syntax error, unexpected BINOP, expecting $end
in interpreted text
line 4 char 1:

?
^

ERROR: Command line parse failed
-> nil

I'm running 3.9.0 compiled from git on Ubuntu Studio

@jamshark70
Copy link
Owner

jamshark70 commented Feb 7, 2018

ERROR: syntax error, unexpected BINOP, expecting $end

Whoa... I definitely don't get that.

Are you copy/pasting the text, or typing it yourself? If pasting, are you copying from the PDF or from cl-manual-examples.scd? Copying from the PDF might include some extra, invisible characters.

Another possible explanation might be text encoding, which may be related to locale. Could you save your code window as scd and upload here as an attachment? So I can inspect it byte by byte.

Ok... another test. Can you post the output of this statement (copy from here)?

\chucklibLiveCode.eval("/make(anapadVC:pad/chordBP:ch(chords:\\one));").postcs.interpret;

I'm sorry to ask for so much, but I used anapadVC just a few hours ago and nothing bad happened. I can see that, on your machine, for some reason a wrong character is being generated in the translation, but I don't see that behavior myself and I don't know why it's happening on your machine and not mine.

Thanks for your patience --

@clfest
Copy link
Author

clfest commented Feb 8, 2018

I have, at the manuals (your) suggestion, typed them in myself. I include a copy of this file, but looking
through it with 'cat -A | less', I could not see any invisible characters anywhere in the file except for
\n. It seems I have to change my file from .scd to .txt, but I suppose you can change it back.
cl-manual_examples.txt.

You have suggested that I execute the statement above and see what it produces. I have to guess a little
bit as to context. I assume you want me to execute:

\loadAllCl.eval
// and then
\chucklibLiveCode.eval("/make(anapadVC:pad/chordBP:ch(chords:\one));").postcs.interpret;

The former gave:
-> [ loadCl, loadClExtras, loadClInstr ]
late 0.344703148
late 0.294703148
late 0.244703148
late 0.144703148
late 0.094703148

and the latter gave:

"Fact('anapadVC').chuck(VC('pad'));
Fact('chordBP').chuck(BP('ch'), nil, (chords:\one));
VC('pad') => BP('ch');
"
-> BP('ch')
ERROR: Message 'doWhenPlaying' not understood.
RECEIVER:
Instance of FxPatch { (0x78390a8, gc=C4, fmt=00, flg=00, set=05)
instance variables [21]
path : nil
name : nil
synth : instance of Synth (0x6e73448, size=6, set=3)
group : instance of Group (0x525e058, size=5, set=3)
server : instance of Server (0x1658fa8, size=29, set=5)
patchOut : instance of AudioPatchOut (0x6e77178, size=6, set=3)
defName : "chorus2#BcZDOp"
status : Symbol 'isPreparing'
patchIns : instance of Array (0x3c979b8, size=9, set=4)
instr : instance of Instr (0x58e3378, size=6, set=3)
args : instance of Array (0x4ade248, size=9, set=4)
synthPatchIns : instance of Array (0x5925458, size=9, set=4)
argsForSynth : instance of Array (0x46dd558, size=9, set=4)
argNamesForSynth : instance of Array (0x3d8ded8, size=9, set=4)
synthArgsIndices : instance of Array (0x4e12178, size=9, set=4)
synthDef : instance of InstrSynthDef (0x783ace8, size=28, set=5)
outClass : instance of Meta_ReplaceOut (0x20a8540, size=19, set=5)
numChannels : Integer 2
rate : Symbol 'audio'
respawnOnChange : nil
stepChildren : nil
}
ARGS:
Instance of Function { (0x6620198, gc=C0, fmt=00, flg=00, set=02)
instance variables [2]
def : instance of FunctionDef in Method Function:inEnvir
context : Frame (0x4ce8958) of Function:inEnvir
}
PATH: /home/clfest/clfest/SuperCollider/cl-manual_examples.scd

PROTECTED CALL STACK:
Meta_MethodError:new 0x1abb9c0
arg this = DoesNotUnderstandError
arg what = nil
arg receiver = FxPatch("busfx.chorus2")
Meta_DoesNotUnderstandError:new 0x1abd980
arg this = DoesNotUnderstandError
arg receiver = FxPatch("busfx.chorus2")
arg selector = doWhenPlaying
arg args = [ a Function ]
Object:doesNotUnderstand 0x137ab80
arg this = FxPatch("busfx.chorus2")
arg selector = doWhenPlaying
arg args = nil
a FunctionDef 0x2bb8240
sourceCode = ""
Function:prTry 0x1d7ef80
arg this = a Function
var result = nil
var thread = a Routine
var next = nil
var wasInProtectedFunc = false

CALL STACK:
DoesNotUnderstandError:reportError
arg this =
Nil:handleError
arg this = nil
arg error =
Thread:handleError
arg this =
arg error =
Thread:handleError
arg this =
arg error =
Object:throw
arg this =
Function:protect
arg this =
arg handler =
var result =
Environment:use
arg this =
arg function =
var result = nil
var saveEnvir =
< FunctionDef in Method Meta_MixerChannelReconstructor:doQueue > (no arguments or variables)
Routine:prStart
arg this =
arg inval = 129.240031475
^^ The preceding error dump is for ERROR: Message 'doWhenPlaying' not understood.
RECEIVER: FxPatch("busfx.chorus2")

If I have misinterpreted your request, please let me know.

@jamshark70
Copy link
Owner

OK, I've fixed Message 'doWhenPlaying' not understood.

Quarks.update("ddwLivecodeInstruments");

And now I see where the '?' problem came from. You said you ran this:

/make(anapadVC:pad/chordBP:ch(chords:\one));

But actually ran this:

/make(anapadVC:pad/chordBP:ch(chords:\one)); // <bug?

... which is a parsing bug with comments at the end of a cll statement. I will fix it tomorrow but it's quite late and I can't do it right now.

I didn't even think of that because I didn't know what statement you were really running.

In the meantime, could you try this?

Quarks.update("ddwLivecodeInstruments");

// wait
\loadAllCl.eval;

VC(\pad).free; BP(\ch).free;

// no comment here, for now
/make(anapadVC:pad/chordBP:ch(chords:\one));

Really appreciate your patience, thanks.

@jamshark70
Copy link
Owner

'?' bug is fixed now, too: 1f251ce

Quarks.update("ddwChucklib-livecode");

@clfest
Copy link
Author

clfest commented Feb 9, 2018

Loaded the latest ddwChucklib-livecode and ddwLivecodeInstruments and now

/make(anapadVC:pad/chordBP:ch(chords:\one));

works. I, apparently naively, thought the markings for comments were the same as the main supercollider
interpreter. Apparently you've got your own interpeter with different rules. I didn't have that comment
there when it errored out initally, however. What are the rules for writing comments with Chucklib?

@jamshark70
Copy link
Owner

Comments should be the same. There was a bug processing them, which caused the "?" error you saw, but that isn't the behavior I wanted. The bug is fixed, so now your version with the comment should behave correctly.

It's difficult to unpack the first error, because there wasn't much info about it and there are now at least 2 other errors listed in the thread. The target kept moving. If it's working now, we probably should just close it.

I do appreciate the error report and your patience in sending the details. There were a couple of bugs in the code that are now fixed -- I'm happy about fixing those! Thanks for taking the time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants