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!
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!
Best way I know is with JITLibExtensions.
Quarks.gui
Then you can do:
Ndef(\a).addSpec(\parameter, [min, max, warp], \otherParameter, [min, max, warp]... etc...)
hjh
ahh amazing thanks!
Any other cool tips you recommend for Ndef?
Is there a directory where I can see what else these Jitlib extensions let me do?
Thanks
Quarks.at("JITLibExtensions").localPath.openOS
hjh
That does not work for me due to the way I have quarks installed? Would there be another way?
Thanks
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
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!
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
ERROR: Quarks requires git to be installed
ERROR: Failed to read quarks directory listing: GitHub - supercollider-quarks/quarks: Directory of community contributed Quarks for SuperCollider 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
I was curious if there was a way to make the min values in Jitlib smaller than 0.01?
If you set a spec that allows values between 0 and 0.01 and you use the slider, then you get the proper value.
Ndef(\x, { |test = 0| test });
Ndef(\x).addSpec(\test, [0.000001, 0.01, \exp]);
Ndef(\x).gui;
// move slider somewhere in the middle
Ndef(\x).nodeMap[\test]
-> 6.9385678787372e-05
By default, the number box rounds to 0.01 (and unfortunately forces typed-in values to the same rounding ), but this doesnât affect the sliderâs numeric resolution.
hjh
BTW Iâve raised the question on the developer list about making the number box precision user-configurable.
hjh
You could check out the slider and player gui VarGui from miSCellaneous_lib quark. It supports a number of precision and display options which are discribed in its help file Ex.9. It can be used for passing SynthDef names and Synth objects and can be used for Environment variable control, though it doesnât support Ndef.
Code example for control of a default synth
VarGui(
synthCtr: [
\amp, [0.0001, 0.2, \exp, 0, 0.005],
\freq, [100, 10000, \exp, 0, 500]
],
synth: \default
).gui