This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
::: ScalaCollider data base ::: | |
: Features : | |
- association of plugin files (e.g. CuspN -> ChaosUGens) | |
- default argument values: | |
- integer graph element | |
- integer scalar (e.g. for "numChannels") | |
- string (e.g. Poll label) | |
- floating point graph element; possibility of "inf" values |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// january 2011 | |
thisProcess.recvOSCfunc = { arg ... args; args.postln } | |
thisProcess.recvOSCfunc = nil | |
r = OSCresponderNode( nil, '/2/push1', { arg time, resp, msg; | |
if( msg[ 1 ] == 1, { | |
"Dang!".postln; | |
}); | |
}).add; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait TxnLike[S <: Sys[S]] { | |
def readVar[A](in: DataInput[S#Tx])(implicit peer: Reader[S#Tx, A]): S#Var[A] | |
} | |
object VarLike { | |
implicit def reader[S <: Sys[S], A](implicit peer: Reader[S#Tx, A]) = new Reader[S#Tx, S#Var[A]] { | |
def read(in: DataInput[S#Tx])(implicit tx: S#Tx): S#Var[A] = | |
tx.readVar[A](in) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.swing._ | |
import Swing._ | |
val f = new Frame { | |
val sl = new Slider { | |
listenTo(this) | |
reactions += { | |
case event.ValueChanged(_) => | |
println(s"adjusting? $adjusting") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implicit class EndingOps(val in: java.io.DataInput) extends AnyVal { | |
def readIntLE(): Int = { | |
val i0 = in.readInt() | |
val b0 = (i0 >> 24) & 0xFF | |
val b1 = (i0 >> 16) & 0xFF | |
val b2 = (i0 >> 8) & 0xFF | |
val b3 = (i0 ) & 0xFF | |
val i1 = (b3 << 24) | (b2 << 16) | (b1 << 8) | b0 | |
i1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Baz[-C, M] | |
object Foo { | |
def empty[V, A](implicit m: Baz[A, V]): Foo[V, A] = ??? | |
implicit def barBaz[V, A](implicit m: Baz[A, V]): Baz[Bar[V, A], V] = ??? | |
case class Single[V, A](measure: V, a: A) extends Foo[V, A] { | |
def append(b: A)(implicit m: Baz[A, V]): Foo[V, A] = Deep(empty[V, Bar[V, A]]) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sbt | |
[info] Loading global plugins from /<myhome>/.sbt/0.13/plugins | |
[info] Loading project definition from /<myhome>/Documents/devel/LucreSwing/project | |
[info] Set current project to LucreSwing (in build file:/<myhome>/Documents/devel/LucreSwing/) | |
> clean | |
[success] Total time: 0 s, completed Mar 23, 2014 11:04:59 PM | |
> compile | |
[info] Updating {file:/<myhome>/Documents/devel/LucreSwing/}lucreswing... | |
[info] Resolving jline#jline;2.11 ... | |
[info] Done updating. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e = NetAddr("127.0.0.1", 17737); | |
n = 10; | |
/* | |
[ 1, 18 ] | |
[ 2, 19 ] | |
[ 3, 20 ] | |
[ 4, 21 ] | |
[ 5, 23 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ JSCView { | |
saveAsImage { arg fileName, format, all = true; | |
var w, h, pixelFormat, bImg, gImg, imageIO, file, comp, meth; | |
w = jBounds.width; | |
h = jBounds.height; | |
format = format ?? { fileName.splitext[ 1 ]}; | |
pixelFormat = if( format.asSymbol === \png, 2, 1 ); // TYPE_INT_ARGB vs. TYPE_INT_RGB | |
bImg = JavaObject( 'java.awt.image.BufferedImage', server, w, h, pixelFormat ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.sciss.lucre.macros | |
import scala.annotation.StaticAnnotation | |
import scala.reflect.macros.{BlackboxContext => Context} | |
import language.experimental.macros | |
trait Foo[A] | |
class mkCompanion extends StaticAnnotation { | |
def macroTransform(annottees: Any*) = macro mkCompanionMacro.impl |