How do I add Supercollider as a firewall exception?

I have downloaded, uninstalled, and reinstalled supercollider 3.13.0 and I can’t play any sound. I used s.boot to boot the server, and used this code:

SinOsc.ar(freq: 440.0, phase: 0.0, mul: 1.0, add: 0.0)

The post window shows

-> a SinOsc

No sound plays though. Also, when I try to run other code it doesn’t work either. One example: ERROR: Class not defined.

How do I add Supercollider as a firewall exception? When I installed it it didn’t ask me. I tried searching this online and there are no specific examples on how to do it.

try running all of this. It should give you sound.

s.waitForBoot { { SinOsc.ar(220) }.play }

Thanks for your response.

It does work. Why doesn’t the line of code in my post doesn’t work? It’s a part of the help browser.

You need to boot the server first and you need to place that code in a function (and call play) or a synthdef.

s.boot;  // boot server

{ SinOsc.ar }.play;  

I did boot the server using both s.boot and ctrl+b but it didn’t work. Additionally I also tried to run this line of code from the supercollider book and it didn’t work:

play({SinOsc.ar(LFNoise0.kr(12, mul: 600, add: 1000), 0.3)})

The first time I installed sc it worked, but when I tried doing it again, it didn’t play.

Why do you think this is related to your firewall settings? Or are you asking two different questions in one post?
Anyway, sclang is by default listening on port 57120, scsynth (the “server”) on port 57110. So, these two ports should be open (if that’s the problem).

One suggestion here: 99.99% of the time, “it doesn’t work” doesn’t just mean it doesn’t work – it means, “I did action A, and I expected result B, but instead I got result C.”

Here, A and C are a bit unclear.

Booting the server:
A. Ctrl-B.
B. Expected: Server running, status bar green.
C. Actual: Not stated – though we can probably assume success because you got sound in one case.

Playing the synth:
A. Run the play { ... } code snippet – though it isn’t stated whether you let the server finish booting before running it.
B. Expected: Sound.
C. Actual: Not stated – I have no idea if it failed with an error (and, which error is important).

“… whether you let the server finish booting…” – this is important because the waitForBoot example from Jordan did work – so I guess that you’re doing something different from that, but I’m not sure exactly what.

Also here: What’s the rest of the error message? The error message is not only that some unspecified class was undefined – it’s about a specific class. The full error may or may not be relevant to the sound problem, but there’s no way to evaluate that without having the full error text.

So what’s been going on in this thread is that people are trying to help you by guessing at the details that haven’t been provided. Often, this doesn’t lead quickly to a solution (as in this case).

Could you be specific about the exact sequence of steps you’re taking, and their actual results?

hjh

In this case, I’m expecting what the code is described to do: play a sound.

What the problem is:
I gave two examples of code that does not work. One of them is from the help docs:

SinOsc.ar(freq: 440.0, phase: 0.0, mul: 1.0, add: 0.0).

The other is from The SuperCollider Book by David Cottle, Scott Wilson, and Nick Collins, 1 Beginner’s Tutorial:

play({SinOsc.ar(LFNoise0.kr(12, mul: 600, add: 1000), 0.3)})

Every time I open sc, I always do either s.boot or ctrl+b, and I wait for the server to finish before running.

Day 1: When I first downloaded sc, I accidentally did not click allow from the message that popped up to make a firewall exception. I used s.boot, waited and then ran the code from The SuperCollider Book and it worked as expected (every time I used s.boot or ctrl+b it always said it was booting in the post win and the status bar was green).

Day 2: I opened sc, used s.boot, waited, and ran the same code from the book. It did not play sound. The error had to do with syntax (I’ll post it later). I tried closing and opening, used ctrl+b, tried the code from the help docs, uninstalled and reinstalled sc, and did the same procedure as I did before; it did not work.

Because of this, I was thinking the problem had to do with firewall; it worked the first day and not the next.

Also, I mentioned ERROR: Class not defined, because for some reason, none of a program by Sam Pluta that I downloaded worked. I tried running different parts of the code and the errors said similar things about syntax errors.

Please see me reply: How do I add Supercollider as a firewall exception? - #8 by botstation

I’m wondering if the problem has to do with firewall, and if yes, then how do I set it up?

If the status bar is green, it means that network messages are successfully transmitting between the IDE and the server.

Also: per web search, Windows does not block localhost (127.0.0.1) communication by default. Normal usage of SC is with the IDE, sclang and scsynth all on the same machine. The firewall pop-up is asking if you want to allow access to these apps from different machines, which shouldn’t make a difference when running SC all on one machine.

So I think the firewall thing is not the real problem.

I used s.boot, waited and then ran the code from The SuperCollider Book and it worked as expected

If you ran SC without “allowing” the app on the firewall, and it worked as expected, that would be strong evidence against the firewall being the issue.

This code block has an extra period at the end of it – that’s a syntax error.

Also, as Jordan already explained, synthesis units must be written into a function. Synthesis units written outside of a function will never make sound.

// not written into a function
// should print "a SinOsc" but not make sound
SinOsc.ar(freq: 440.0, phase: 0.0, mul: 1.0, add: 0.0)

// written into a function, with .play
// should print Synth(...) and make sound
// it will be very loud though!
// maybe change mul: 1.0 to mul: 0.1
{ SinOsc.ar(freq: 440.0, phase: 0.0, mul: 1.0, add: 0.0) }.play;

play({SinOsc.ar(LFNoise0.kr(12, mul: 600, add: 1000), 0.3)})

This code example is fine. I did: 1/ Start SC. 2/ Boot server. 3/ Wait for green. 4/ Run the line. Result: Loud bloopy sine.

ran the same code from the book. It did not play sound. The error had to do with syntax (I’ll post it later).

OK, so SC is telling you where to look for the problem: in the code syntax.

If the error had to do with syntax, then a crucial piece of information about “the action taken” is: the exact code you were running. We don’t know what you ran, so we can’t tell you what the syntax error is. (“The code from the book” but your code snippet above from the book runs perfectly on my machine, so you must have been running code that was slightly altered from that.)

Also, I mentioned ERROR: Class not defined, because for some reason, none of a program by Sam Pluta that I downloaded worked. I tried running different parts of the code and the errors said similar things about syntax errors.

Similarly – you ran some unspecified code, and got an unspecified error message – there’s no way that anybody can guess what the problem is.

Which program by Sam? Which specific classes were mentioned as not being found?

hjh

The reason why I suspected about firewall is because it is mentioned in the README_WINDOWS.md on github and other people asked similar questions and the responses were that they could be related to firewall.

The “extra period” you mentioned at the end of:

SinOsc.ar(freq: 440.0, phase: 0.0, mul: 1.0, add: 0.0)

That’s a typo when I replied to you. My original post does not have it.
The code from the supercollider book used to run fine, but the next day I did the same procedure and there was no sound. I did not alter the code, and made sure it was exactly the same.

The program I’m referring to is the Live Modular Instrument (GitHub - spluta/LiveModularInstrument). The video that he made explaining it is outdated because he updated it.

What I did was open LiveModularInstrument.scd (server’s already running). Then, I ran ln 34 using ctrl+enter (same way I always run code):

LiveModularInstrument.boot(8, startChan+[1,2,3,4,5,6,7,8], (128!7).add(2)/*sets the blockSize*/, 'normal', [OSCReceiver_Mod, Joystick_Mod.setPaths(["logitech-extreme-3d-pro2"]), TypeOSCFunc_Mod, MIDI_Mod], "/Users/spluta1/Library/Application Support/SuperCollider/saved LMI Sessions/Oct_27_23");

This is the error:

ERROR: Class not defined.
  in interpreted text
  line 8 char 15:

  OSCReceiver_Mod.ips_(["left.local","right.local"]);
                 
  
-----------------------------------
ERROR: Class not defined.
  in interpreted text
  line 10 char 21:

  LiveModularInstrument.boot(8, startChan+[1,2,3,4,5,6,7,8], (128!7).add(2)/*sets the blockSize*/, 'normal', [OSCReceiver_Mod, Joystick_Mod.setPaths(["logitech-extreme-3d-pro2"]), TypeOSCFunc_Mod, MIDI_Mod], "/Users/spluta1/Library/Application Support/Super
                       
  ) 
-----------------------------------
ERROR: Class not defined.
  in interpreted text
  line 10 char 123:

  LiveModularInstrument.boot(8, startChan+[1,2,3,4,5,6,7,8], (128!7).add(2)/*sets the blockSize*/, 'normal', [OSCReceiver_Mod, Joystick_Mod.setPaths(["logitech-extreme-3d-pro2"]), TypeOSCFunc_Mod, MIDI_Mod], "/Users/spluta1/Library/Application Support/Super
                                                                                                                             
  ) 
-----------------------------------
ERROR: Class not defined.
  in interpreted text
  line 10 char 137:

  LiveModularInstrument.boot(8, startChan+[1,2,3,4,5,6,7,8], (128!7).add(2)/*sets the blockSize*/, 'normal', [OSCReceiver_Mod, Joystick_Mod.setPaths(["logitech-extreme-3d-pro2"]), TypeOSCFunc_Mod, MIDI_Mod], "/Users/spluta1/Library/Application Support/Super
                                                                                                                                           
  ) 
-----------------------------------
ERROR: Class not defined.
  in interpreted text
  line 10 char 193:

  LiveModularInstrument.boot(8, startChan+[1,2,3,4,5,6,7,8], (128!7).add(2)/*sets the blockSize*/, 'normal', [OSCReceiver_Mod, Joystick_Mod.setPaths(["logitech-extreme-3d-pro2"]), TypeOSCFunc_Mod, MIDI_Mod], "/Users/spluta1/Library/Application Support/Super
                                                                                                                                                                                                   
  ) 
-----------------------------------
ERROR: Class not defined.
  in interpreted text
  line 10 char 203:

  LiveModularInstrument.boot(8, startChan+[1,2,3,4,5,6,7,8], (128!7).add(2)/*sets the blockSize*/, 'normal', [OSCReceiver_Mod, Joystick_Mod.setPaths(["logitech-extreme-3d-pro2"]), TypeOSCFunc_Mod, MIDI_Mod], "/Users/spluta1/Library/Application Support/Super
                                                                                                                                                                                                             
  ) 
-----------------------------------
-> nil

What could be causing the error?

Just for clarification: You got a message when downloading SC, asking for your permission for a firewall exception? That’s strange. How should that be related to the execution of the program (which is just being downloaded, not executed)? I don’t understand this…

Just a personal experience I made when I was using SC on Linux, running on my old Apple Laptop: SC was always running fine when I was using my external Soundcard (external hardware). But using the internal one (the built-in one of my laptop) was completely unreliable. That reminds me of your description. But I have no idea about your hardware.

Generally I would recommend to first try to solve the basic problem of SC not playing sound before you move on to extending SC. I have never heard of LiveModularInstrument before but very likely that won’t work either if SC doesn’t even play a simple SinOsc (the error btw. results from the fact that LiveModularInstrument doesn’t seem to be installed correctly. I.e. the class files are not in the right location or are missing. I wouldn’t worry too much about that now).

I am really sorry I can’t give you much more advice. I know there can be nasty problems but I’m clueless whether this is a hardware problem or software misconfiguration.

Stefan

Ok, that’s helpful.

I think this is the #1 problem to solve. It will not be productive to scattershot troubleshooting efforts at multiple problems – confusion. Let’s focus only on this problem.

Here’s my suggestion.

  1. Quit SC and relaunch.

  2. Boot the server.

  3. Open the oscilloscope: s.scope;

  4. Run play({SinOsc.ar(LFNoise0.kr(12, mul: 600, add: 1000), 0.3)})

  5. Do you see any signal in the scope window?

  6. Please copy all of the contents of the post window and paste into a message here, within code tags. (If you want to find/replace sensitive folder names in paths, that’s ok, but please don’t change or delete anything else – I say “all,” I mean all.)

    ```
    post window contents
    ```
    

    This will have information about classes being loaded, audio devices in your system, and SC’s response to commands. At this point, this sounds like a strange problem, so I don’t have a good guess what’s going on. In such cases, tightly filtering the information that you’re providing will not lead to a solution. So I’m asking for the full dump.

Also, no. 5 is to see whether the problem is SC failing to generate audio, or the OS failing to deliver audio to the speakers. That’s important!

Thanks for patience. I know this is frustrating.

hjh

Did you install the classes?

I got the message for a firewall exception when sc was already installed and I opened it up.
I do not have external soundcard.

Over the past 2 days, I was able to reset windows and it partially fixed the issue.
The code from the book now works, except the Live Modular Instrument still has the same problem.

@jordan What I did was download the github project as a zip, unzipped it, and opened LiveModularInstrument.scd. I also tried opening the other files in the folder at the same time with LiveModularInstrument.scd and it didn’t get rid of the error either.

If there is another way, how do I install them?

Ok, this certainly won’t work, you need to install the Class (.sc) files into your extensions folder. Otherwise SC won’t find them, as the error message demonstrates.

Note that Sam explicitly writes:

I do not support this software for others to use, but provide this here as information for the community. Please feel free to read my code, steal my code, and make it your own.

Honestly, this doesn’t sound like the right project to choose when you’re starting out with SC.

Ok, that’s a bit clearer. From the other posts I can read that you’ve been able to (at least partially) fix the problem. To rule out that the your firewall is making troubles I would try the following:

  • deactivate your firewall (I don’t know how to do this on your machine)
  • disconnect your machine from the net (if your concerned about security)

If you still have problems running your code (not that example using LiveModularInstrument, just some simple sound example from the standard help files) it’s clear that it’s not the firewall making troubles.

Anyway, maybe you’ve sorted it out already. I wish you all the best!

@Spacechild1 How do I install the class files into the extensions folder? Do I just paste the unzipped folder (LiveModularInstrument-main) into

C:\Users\<USERNAME>\AppData\Local\SuperCollider\Extensions

?
I know that he wrote he does not support the software, but i want to try it out. Im not using this as a tutorial in order to learn sc.

@nufets
Ive been able to fix the issue with the code from the book but the LiveModularInstrument still doesn’t work. Spacechild1 suggests to install it into the extensions folder, so maybe there is no problem with firewall. Ill follow what he says first.

I’m not sure why we are still talking about the firewall, because:

“The firewall doesn’t block/inspect the localhost/loopback address (127.0.0.1) because it’s your computer. So since the target and source are the same, there’s really nothing to firewall.”

That would work.

Or (I think this is better actually), you could go to Preferences > Interpreter and add a library path.

In any case, SC doesn’t scan your entire hard drive looking for .sc files – and it shouldn’t (imagine the startup time). You do have to tell it where to find the files you downloaded: hence the Preferences panel.

hjh