Coder Social home page Coder Social logo

connection.quark's People

Contributors

patrickdupuis avatar scztt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

connection.quark's Issues

Initial Value not set for sliders

I modified the example in the "Control values" section of the overview to include initial values.
The number boxes show the correct initial value but the sliders are not updated and remain at "zero".

MacOS: 10.15.7
Supercollider: 3.12.0

Screen Shot 2021-08-17 at 11 41 52 AM

(
~controls = [
    ~amp     = NumericControlValue(0.5, spec:ControlSpec(0, 1, default:1)),
    ~freq     = NumericControlValue(10, spec:ControlSpec(1, 20, default:1)),
    ~delay     = NumericControlValue(1, spec:ControlSpec(0.05, 2, default:0.3)),
    ~decay    = NumericControlValue(5, spec:ControlSpec(1, 8, default:5)),
    ~filterFreq = NumericControlValue(5000, spec:ControlSpec(2000, 10000, default:8000)),
];

~view = View(bounds:600@200).layout_(GridLayout.rows(

    ~sliders = 5.collect { Slider() },
    ~numbers = 5.collect { NumberBox() }
)).front;

~view.onClose = { ~synth.free; ~connections.disconnect };

~connections = ConnectionList.makeWith {
    ~controls.connectEach(\input, ~sliders, _.valueSlot);
    ~controls.connectEach(\value, ~numbers, _.valueSlot);
    ~sliders.connectEach(\value, ~controls, _.inputSlot);
    ~numbers.connectEach(\value, ~controls, _.valueSlot);
};
)

ControlSpec setFrom method already exists in SC

Hello,

I'm getting a recompile error when attempting to install this quark.

The setFrom method already exists in the SCClassLibrary.

I checked the source code, seems both are the same. Is it possible to remove this class file from your quark?

Boris

Documentation typos

in the Connection overview helpfile, under "Connecting multiple objects":
The Connection: -connectTo method can take multiple objects, and will connect all of them. This makes it easy to create a one-to-many connection. For example: slider.connectAll(a, b, c).

I think this should be slider.connectTo(a, b, c)

... and in Connection helpfile,

Creating a connection using:

Connection(obj, dependantm, autoConnect:true)
is roughly equivalent to calling

obj.addDependant(dependant);

I think depandantm should be dependant

inline warnings

There are a number of inline warnings (try switching on inline warnings to see them):

WARNING: FunctionDef contains variable declarations and so will not be inlined.
  in file '~/Library/Application Support/SuperCollider/downloaded-quarks/Connection/Connection.sc'
  line 62 char 30:

  			^object.dependants !? { |d| d.includes(dependant) } ?? false;
                                
  		}
-----------------------------------
WARNING: FunctionDef contains variable declarations and so will not be inlined.
  in file '~/Library/Application Support/SuperCollider/downloaded-quarks/Connection/Connection.sc'
  line 141 char 36:

  				var tempTrace = traceConnection;
                                      
  				traceConnection = nil;
-----------------------------------
WARNING: FunctionDef contains variable declarations and so will not be inlined.
  in file '~/Library/Application Support/SuperCollider/downloaded-quarks/Singleton/Singleton.sc'
  line 75 char 40:

  			var key = dict.findKeyForValue(sing);
                                          
  			if (key.notNil) {
-----------------------------------
WARNING: FunctionDef contains variable declarations and so will not be inlined.
  in file '~/Library/Application Support/SuperCollider/downloaded-quarks/Connection/UpdateDispatcher.sc'
  line 19 char 0:

  			|d|
  
  			d.free;
-----------------------------------
WARNING: FunctionDef contains variable declarations and so will not be inlined.
  in file '~/Library/Application Support/SuperCollider/downloaded-quarks/Connection/UpdateDispatcher.sc'
  line 76 char 0:

  			|item|
  
  			item.update(obj, changed, *args);
-----------------------------------
WARNING: FunctionDef contains variable declarations and so will not be inlined.
  in file '~/Library/Application Support/SuperCollider/downloaded-quarks/Connection/UpdateDispatcher.sc'
  line 83 char 33:

  		^dispatchTable[obj] !? { |conn| conn.dependant.connectionTraceString(obj, what) } ?? { "%(%) - no target".format(this.class, this.identityHash) }
                                   
  	}
-----------------------------------
WARNING: FunctionDef contains variable declarations and so will not be inlined.
  in file '~/Library/Application Support/SuperCollider/downloaded-quarks/Connection/UpdateForwarder.sc'
  line 196 char 44:

  					var tmpdeferredUpdate = deferredUpdate;
                                              
  					deferredUpdate = nil;
-----------------------------------
WARNING: FunctionDef contains variable declarations and so will not be inlined.
  in file '~/Library/Application Support/SuperCollider/downloaded-quarks/Connection/extDictionary.sc'
  line 8 char 36:

  			var newVal = defaultFunc.value();
                                      
  			this.put(key, newVal);
-----------------------------------

Errors after installation

Using the current development branch, after Quarks.install("Connection") and recompiling the class library, I get:

ERROR: duplicate Class found: 'UnitTest' 
/home/dlm/share/supercollider/SCClassLibrary/Common/UnitTesting/UnitTest.sc
/home/dlm/.local/share/SuperCollider/downloaded-quarks/UnitTesting/UnitTest.sc

ERROR: duplicate Class found: 'UnitTestResult' 
/home/dlm/share/supercollider/SCClassLibrary/Common/UnitTesting/UnitTest.sc
/home/dlm/.local/share/SuperCollider/downloaded-quarks/UnitTesting/UnitTest.sc

ERROR: duplicate Class found: 'UnitTestScript' 
/home/dlm/share/supercollider/SCClassLibrary/Common/UnitTesting/UnitTest.sc
/home/dlm/.local/share/SuperCollider/downloaded-quarks/UnitTesting/UnitTest.sc

ERROR: duplicate Class found: 'MixedBundleTester' 
/home/dlm/share/supercollider/SCClassLibrary/Common/UnitTesting/MixedBundleTester.sc
/home/dlm/.local/share/SuperCollider/downloaded-quarks/UnitTesting/MixedBundleTester.sc

	Compiling directory '/home/dlm/.local/share/SuperCollider/downloaded-quarks/Singleton'
	Compiling directory '/home/dlm/.local/share/SuperCollider/downloaded-quarks/FreeAfter'
	Compiling directory '/home/dlm/.local/share/SuperCollider/downloaded-quarks/Connection'
ERROR: Parse error
  in file '/home/dlm/.local/share/SuperCollider/downloaded-quarks/Connection/ControlValue.sc'
  line 260 char 3:

  		}
    ^
  	}
-----------------------------------
unmatched '}'
  in file '/home/dlm/.local/share/SuperCollider/downloaded-quarks/Connection/ControlValue.sc' line 260 char 3
Expected class name.  got token: '}' 280
  in file '/home/dlm/.local/share/SuperCollider/downloaded-quarks/Connection/ControlValue.sc'
  line 260 char 3:

  		}
    ^
  	}
-----------------------------------

The duplicate class problem is known (cross-version compatibility nightmares, again). But, adding UnitTesting as a dependent should be conditional, based on the SC version. (Admittedly that's a bit kludgey, but I don't anticipate a proper solution in Quarks anytime soon. I know what to do about this but new users will not.)

The syntax error, I don't know. I guess a typo.

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.