Ndef argument, min/max


#1

Hello,

I am very new to using ndef. I was curious if there was a way to use an argument to set the min and max of a parameter slider so I would not have to go in and adjust them every time I load a synth to the ndef.

Thanks!


#2

Best way I know is with JITLibExtensions.

  1. Add the JITLibExtensions quark.
    a. Install git from git-scm.com.
    b. Quarks.gui
    c. Find JITLibExtensions and click the checkbox to install.
    d. Recompile the class library.

Then you can do:

Ndef(\a).addSpec(\parameter, [min, max, warp], \otherParameter, [min, max, warp]... etc...)

hjh


#3

ahh amazing thanks!

Any other cool tips you recommend for Ndef?


#4

Is there a directory where I can see what else these Jitlib extensions let me do?

Thanks


#5
Quarks.at("JITLibExtensions").localPath.openOS

hjh


#6

That does not work for me due to the way I have quarks installed? Would there be another way?

Thanks


#7

Aha, well, I couldn’t have guessed that you were installing them in a nonstandard way.

In fact, it isn’t required to use git to download the quarks. The only thing that is required is to put them in userAppSupportDir/downloaded-quarks, e.g.:

(
var quarksDir = Platform.userAppSupportDir +/+ "downloaded-quarks";
if(File.exists(quarksDir).not) {
	File.mkdir(quarksDir);
};
quarksDir.openOS;
)

If there is a directory within this location, and that directory contains a valid ‘.quark’ file, then you can use Quarks methods to access it – no need for it to be in the official list of quarks.

So you might consider moving your quarks into this location. Then you can use Quarks.gui etc.

In the meantime, you could pick some class that is defined in the quark and use its filenameSymbol to open the directory. (The catch is that you wanted to open the directory to find out what’s defined inside!)

Halo.filenameSymbol.asString.dirname.openOS

hjh


#8

Weird, I have all my quarks in a folder called “downloaded-quarks” in my Supercollider Application support folder and the first method does not work? The quarks.gui does work for me.

Thanks!


#9

the first method does not work

Recommended, if something is unexpectedly not working, to post the error output. This is actually an important point that often gets overlooked: if you ever catch yourself writing “it doesn’t work,” a little red flag should go up in your mind saying “Oops, it’s not enough to say that” – error or other output, maybe code snippets, to help diagnose the problem.

At present, all I know is that if I execute Quarks.at("JITLibExtensions").localPath, then I get "/home/dlm/.local/share/SuperCollider/downloaded-quarks/JITLibExtensions" as a String, and Strings know how to openOS.

There is no information about why it isn’t working on your machine, so I can’t begin to guess.

hjh


#10

ERROR: Quarks requires git to be installed
ERROR: Failed to read quarks directory listing: https://github.com/supercollider-quarks/quarks.git a PrimitiveFailedError
ERROR: Quark ‘JITLibExtensions’ not found
CALL STACK:
Exception:reportError
arg this =
Nil:handleError
arg this = nil
arg error =
Thread:handleError
arg this =
arg error =
Object:throw
arg this =
Meta_Quark:new
arg this =
arg name = “JITLibExtensions”
arg refspec = nil
arg url = nil
arg localPath = nil
var args = nil
Meta_Quarks:at
arg this =
arg name = “JITLibExtensions”
var q = nil
Interpreter:interpretPrintCmdLine
arg this =
var res = nil
var func =
var code = " Quarks.at(“JITLibExtensions”)"
var doc = nil
var ideClass =
Process:interpretPrintCmdLine
arg this =
^^ The preceding error dump is for ERROR: Quark ‘JITLibExtensions’ not found