GithubHelp home page GithubHelp logo

capital-g / sc-grids Goto Github PK

View Code? Open in Web Editor NEW
19.0 3.0 3.0 364 KB

SuperCollider port of topographic drum sequencer Grids by Mutable Instruments

License: GNU General Public License v3.0

SuperCollider 100.00%
generative-patterns livecoding supercollider drums

sc-grids's Introduction

SuperCollider Grids

SuperCollider port of the Eurorack module Grids by Mutable Instruments. This port was made possible because the source code for Grids is open source.

I wrote a blog post on my website on how one can understand C++ code from a eurorack module and port its logic to SuperCollider.

Installation

You can easily install this Quark by executing

Quarks.install("https://github.com/capital-G/sc-grids");

in sclang and recompile the class library (Shift Command L).

Documentation

For documentation please check out the provided help files via ScIDE. Type in ScGrids and hit Command D while hovering with the cursor over ScGrids - this will show you the help files.

GUI

To somehow mimic the haptic feedback of this module there is a GUI implementation which controls multiple TDefs.

Screenshot of GUI

For the source code of this take a look at the grids_gui.scd.

sc-grids's People

Contributors

capital-g avatar telephon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sc-grids's Issues

Write Quark

For easier distribution it would be good to write this as a quark

Using Pwhite for density can run into invalid values

Based on experiments in #7 I came across this error

s.boot;
(
SynthDef(\hh, {|out|
	var sig = WhiteNoise.ar*EnvGen.kr(Env.perc(releaseTime: \release.kr(0.2)), doneAction: Done.freeSelf)*\amp.kr(0.5);
	Out.ar(out, sig!2);
}).add;
)

Synth(\hh)


(
Pdef(\foo, Pbind(
	\instrument, \hh,
	\density, Pwhite(0.0, 1.0),
	\dur, Pgrids(\hihat, density: Pkey(\density)),
)).play;
)

resulting in

ERROR: binary operator '-' failed.
RECEIVER:
   nil
ARGS:
   Integer 32
   nil
CALL STACK:
	DoesNotUnderstandError:reportError
		arg this = <instance of BinaryOpFailureError>
	Nil:handleError
		arg this = nil
		arg error = <instance of BinaryOpFailureError>
	Thread:handleError
		arg this = <instance of Thread>
		arg error = <instance of BinaryOpFailureError>
	Thread:handleError
		arg this = <instance of Routine>
		arg error = <instance of BinaryOpFailureError>
	Thread:handleError
		arg this = <instance of Routine>
		arg error = <instance of BinaryOpFailureError>
	Thread:handleError
		arg this = <instance of Routine>
		arg error = <instance of BinaryOpFailureError>
	Thread:handleError
		arg this = <instance of Routine>
		arg error = <instance of BinaryOpFailureError>
	Object:throw
		arg this = <instance of BinaryOpFailureError>
	Object:performBinaryOpOnSomething
		arg this = nil
		arg aSelector = '-'
		arg thing = 32
		arg adverb = nil
	< FunctionDef in Method SequenceableCollection:performBinaryOpOnSeqColl >
		arg i = 0
	Integer:do
		arg this = 1
		arg function = <instance of Function>
		var i = 0
	SequenceableCollection:performBinaryOpOnSeqColl
		arg this = [*0]
		arg aSelector = '-'
		arg theOperand = [*1]
		arg adverb = nil
		var size = 1
		var newList = [*0]
	< FunctionDef in Method Pgrids:embedInStream >
		var outval = nil
		var b = nil
		var durations = nil
		var indices = [*0]
		var levels = [*32]
	Float:do
		arg this = inf
		arg function = <instance of Function>
		var i = 9.0
	Pgrids:embedInStream
		arg this = <instance of Pgrids>
		arg inval = <instance of Event>
		var instrumentStream = 'hihat'
		var xStream = 0.0
		var yStream = 0.0
		var densityStream = <instance of FuncStream>
		var biasStream = 0.0
		var xVal = 0.0
		var yVal = 0.0
		var instrumentVal = 'hihat'
		var densityVal = 5.3882598876953e-05
		var biasVal = 0.0
	Routine:prStart
		arg this = <instance of Routine>
		arg inval = <instance of Event>
^^ The preceding error dump is for ERROR: binary operator '-' failed.
RECEIVER: nil

Add Help documents

For SC and GitHub markdown.

Maybe also mention how it differs from original implementation.

Add value pattern

To get syncopes etc it would be good to have a pattern which yields just the values instead of the durations

Pkey on Pseq does not work for density

Minimal example

s.boot;

(
SynthDef(\hh, {|out|
	var sig = WhiteNoise.ar*EnvGen.kr(Env.perc(releaseTime: \release.kr(0.2)), doneAction: Done.freeSelf)*\amp.kr(0.5);
	Out.ar(out, sig!2);
}).add;
)

// works
Synth(\hh);

// does not yield anything
// => density is always 0
(
Pdef(\foo, Pbind(
	\instrument, \hh,
	\density, Pseq([0.0, 0.9], inf),
	\dur, Pgrids(\hihat, density: Pkey(\density, inf)),
)).play;
)

but the more easier example works.
Is this a bug by Pkey?

(
Pdef(\foo, Pbind(
	\instrument, \hh,
	\dur, Pgrids(\hihat, density: Pseq([0.0, 0.6], inf)),
)).play;
)

Strangely using Pwhite on density works, see

(
Pdef(\foo, Pbind(
	\instrument, \hh,
	\density, Pwhite(0.0, 1.0),
	\dur, Pgrids(\hihat, density: Pkey(\density)),
)).play;
)

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.