-
Notifications
You must be signed in to change notification settings - Fork 12
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
in file null error #71
Comments
Having a similar issue. When evaluating the same selection, I get either:
or
The same code evaluates fine in the IDE or Sublime Text. Please advise. |
I still occasionally have this problem but circumvent it by saving code in separate files and then executing them all from one master file. I think in that instance I moved all the synthdefs into one file and it worked fine. |
That's what I figured I'd have to do. Thanks! |
I'm having the same problem. Thank you |
Yes, I'm fairly certain it is. It happens when atom-supercollider calls SuperColliderJS.interpret. It's been a while since I tried working on it but I found that when I printed the string to a file, it cut at character 8189 every time. The string (code) is passed in it's entirety to SuperColliderJS.interpret in sclang.js but it gets cut inside *interpret. I don't remember all the details. I think this is related to this: supercollider/supercollider#2569. I have an idea for a workaround but I haven't gotten around to trying it. Again, it's been a long while since I tried to work on it but (tangentially) I found that separating my SC programs out into multiple files has actually been good for organizing. YMMV. |
Ok, that's a pitty. |
Ok, so I'm fairly certain I've fixed this. Basically SC has a hard limit length of String literals at 8188. Since the interpret function in sclang.js passes the code-to-be-evaluated in its entirety to SuperColliderJS.interpret via the stdin where it is actually compiled as a String, if the code-to-be-evaluated is longer than 8188 characters it gets truncated and fails to evaluate. The workaround (for now, at least) is to pass chunks of the code-to-be-evaluated through SuperColliderJS to be concatenated on the other side in sclang as a String that can be greater than 8188 characters. After it's concatenated as a String in sclang, then we call String.compile on it where it evaluates as expected. I believe this is the exact problem crucialfelix/supercolliderjs#33 was having, as well. To do this, you'd need the experimental branch of my fork of atom-supercollider, as well as the develop branch of my fork of supercolliderjs. Then use the local version of supercolliderjs to satisfy the dependency in atom-supercollider by putting the path in line 19 of atom-supercollider/package.json (my path is there now), otherwise it'll pull the one from the npm repos. I've only tested it on scripts that are about 10000 characters so it would be useful for others to try it on really long stuff they've already written. I have some test scripts available that work as a proof of concept. |
Hi, i'm having another problem that seems to be at least partly related to atom-sc. This code: https://github.com/tatecarson/Clarinet/blob/d66d9d1fcdc454c194bd23f7d2ad6a1ca61f7779/newcompexper.scd will evaluate in the IDE, but only if the text is selected, it doesn't evaluate if parens are selected. In atom this doesn't evaluate either way. With parens selected i get an in file null error and without i get:
unexpected $end, expecting ELLIPSIS9:30:04.443 buf=0, rate=1, spos=0, freq=440, rq=1, bpfmi
The problem started with the addition of
SynthDef(\automaticRecorder, {|thresh= 0.09, time= 0.2, amp= 1| var src= SoundIn.ar*amp; //var src= BPF.ar(SoundIn.ar*amp, 150, 1); //variant with bandpass filter var off= DetectSilence.ar(src, thresh, time); var on= 1-off; //invert on.poll; RecordBuf.ar(src, ~buffer, loop:0, trigger: on); }).add;
and the buffer allocation. So I think it has something to do with that.
I realize it's a lot of code and would take some time to go through but i'm at a loss for what the problem could be and i've already asked the facebook group to no avail. The code works for them in the IDE. Whenever you have time let me know if you can find any problems with it.
thanks!
The text was updated successfully, but these errors were encountered: