Coder Social home page Coder Social logo

Comments (11)

jwaldmann avatar jwaldmann commented on July 18, 2024

ah, is this #231 (comment) ?

I still don't get it. I put this extra line (loadRelative ...)) in startup.scd:

(
s.reboot {
  ...
	s.waitForBoot {
		~dirt = SuperDirt(2, s); // two output channels, increase if you want to pan across more channels
		loadRelative("../../software/music/SuperDirt/hacks/adding-a-compressor.scd");
...

then when starting sclang, I get

...
loading synthdefs in /home/waldmann/.local/share/SuperCollider/downloaded-quarks/SuperDirt/classes/../synths/zzzzz-core-modules-that-come-last.scd
ERROR: syntax error, unexpected '(', expecting $end
  in interpreted text
  line 19 char 1:

  (
  ^
  SynthDef("dirt_compressor" ++ ~dirt.numChannels, { |dryBus, effectBus, gate = 1|
-----------------------------------
ERROR: Command line parse failed

loading 217 sample banks:
...

from superdirt.

telephon avatar telephon commented on July 18, 2024

Hi @jwaldmann, it is confusing, yes.
I've added a bit of documentation (#260), please let me know if it is clearer and works for you …

from superdirt.

jwaldmann avatar jwaldmann commented on July 18, 2024

Thanks! I was still getting the above syntax error. The file I wanted to include https://github.com/musikinformatik/SuperDirt/blob/develop/hacks/adding-a-compressor.scd has this structure

( ~dirt.orbits.do { ... };  )
( SynthDef ... )
( SynthDef ... )
( SynthDef ... )

The error message refers to the beginning of the second block. Are we just missing separators here?
Adding semi-colons makes it work:

( ~dirt.orbits.do { ... };  ) ;
( SynthDef ... )              ;
( SynthDef ... )              ;
( SynthDef ... )

Well, "work" - at least it gives no syntax errors, so we can start thinking about semantics ...

from superdirt.

telephon avatar telephon commented on July 18, 2024

The main thing is that the file (like all other files in the folder) are not meant to be used that way. It is not like a module system. I decided to use this "extension by example" style to encourage a more active involvement with the code. It is also a common way supercollider is organised: files which have many snippets of code that you can use, but not intended to be used all at once. This allows you to vary it in place, by writing series of minor modifications. It is more tedious out of the box, but more flexible to experiment with.

from superdirt.

telephon avatar telephon commented on July 18, 2024

If you wanted to have a file you can load, you'd copy the variant you prefer in a file like this:

(
// add a compressor module
(
~dirt.orbits.do { |x|
	x.globalEffects = [
		GlobalDirtEffect(\dirt_delay, [\delaytime, \delayfeedback, \delaySend, \delayAmp, \lock, \cps]),
		GlobalDirtEffect(\dirt_reverb, [\size, \room, \dry]),
		GlobalDirtEffect(\dirt_leslie, [\leslie, \lrate, \lsize]),
		GlobalDirtEffect(\dirt_rms, [\rmsReplyRate, \rmsPeakLag]).alwaysRun_(true),
		GlobalDirtEffect(\dirt_monitor, [\limitertype]).alwaysRun_(true),
	]
};
);


// now play with different variants while you listen to tidal:


// a dirty hyperbolic tangens
(
SynthDef("dirt_compressor" ++ ~dirt.numChannels, { |dryBus, effectBus, gate = 1|
	var signal = In.ar(dryBus, ~dirt.numChannels);

	signal = (signal * 5).tanh;
	signal = signal * EnvGen.kr(Env.asr, gate, doneAction:2);
	Out.ar(effectBus, signal);
}, [\ir, \ir]).add;

s.freeAll; // restart all synths
)
)

from superdirt.

telephon avatar telephon commented on July 18, 2024
( ~dirt.orbits.do { ... };  ) ;
( SynthDef ... )              ;
( SynthDef ... )              ;
( SynthDef ... )

the syntax correction is correct, but the SynthDefs override each other (they all have the same name).

from superdirt.

jwaldmann avatar jwaldmann commented on July 18, 2024

The main thing is that the file (like all other files in the folder) are not meant to be used that way. It is not like a module system. I decided to use this "extension by example" style ...

Yes, I see now. Perhaps make this intended usage more explicit in the README of that directory? Something like:

  • you can use synthdefs from these files for SC live coding [this is addressing people who know SC, and probably don't need help]
  • or [addressing people who only know Tidal, like me] you can make them available for Tidal live coding by writing a collection of synthdefs to a file, and loading this file from your SC startup file (or from your sclang session?)
  • in such a collection of synthdefs (and other declarations? statements?) , each is terminated a by semi-colon, (and the collection is enclosed in a parentheses?).
  • see https://github.com/musikinformatik/SuperDirt/blob/develop/hacks/adding-global-effects.scd for accessing parameters of synthdefs.
  • In the startup file, write ... [the include command, you already have this text]

from superdirt.

telephon avatar telephon commented on July 18, 2024

Thanks! Better now? https://github.com/musikinformatik/SuperDirt/pull/260/files

from superdirt.

jwaldmann avatar jwaldmann commented on July 18, 2024

Yes, fine! - This issue was actually brought up by students (they wanted side chain compression for Tidal). I will point them to these improved instructions, and I'll forward any remaining complaints :-)

from superdirt.

telephon avatar telephon commented on July 18, 2024

Yes, thanks, that would be good :) It is hard for me to un-understand these things.

from superdirt.

telephon avatar telephon commented on July 18, 2024

please feel free to reopen this issue with suggestions.

from superdirt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.