Skip to content

Instantly share code, notes, and snippets.

val in = Mix.mono(SinOsc.ar)
val cs = s"${in.getClass.getName}$$"
val cc = Class.forName(cs)
val mApply = cc.getMethods.find(_.getName == "apply").get
val fModule = cc.getField("MODULE$")
val c = fModule.get(null)
val out = mApply.invoke(c, SinOsc.ar)
assert(in == out)
#!/bin/sh
# cf. http://superuser.com/questions/91935/how-to-chmod-all-directories-except-files-recursively
find /media/hhrutz/MnemoN/WRITE/LeereNull150618_1 -type d -exec chmod 555 {} +
find /media/hhrutz/MnemoN/WRITE/LeereNull150618_1 -type f -exec chmod 444 {} +
val d = file("/media/hhrutz/MnemoN/BackupEzra091201/Users/rutz/Documents/Pictures/Scans/Ryoanji2009-04-04/")
def toMonoPNG(in: File, inExt: String = "tif"): Unit = {
val inFiles = in.children.filter(_.ext.toLowerCase == inExt).sortBy(_.name)
println("#!/bin/bash\n")
inFiles.foreach { inF =>
val outF = inF.replaceExt("png")
val cmd = s"convert -threshold 50% '$inF' '$outF'"
println(cmd)
}
for f in <source-dir>/*.TIF; do echo "Converting $f"; convert -quality 80 "$f" "$(basename "$f" .TIF).jpg"; done
// import de.sciss.file._
val fmtIn = new java.text.SimpleDateFormat("'B'HH'h'mm'm'ss's'ddMMMyyy'.wav'")
val fmtOut = new java.text.SimpleDateFormat("yyMMdd_HHmmss'.wav'")
def rename(dir: File, prefix: String): Unit = {
require(dir.isDirectory)
dir.children.foreach { fIn =>
try {
val date = fmtIn.parse(fIn.name)
val fs = java.nio.file.FileSystems.getDefault
val w = fs.newWatchService()
val dir = userHome/"Documents"/"jack"
val name = "fifo.log"
val p = dir.toPath
val wk = p.register(w, java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY)
new Thread {
override def run(): Unit = {
val f = dir / name
val f = userHome/"Documents"/"jack"/"fifo.log"
val fin = new java.io.BufferedReader(new java.io.FileReader(f))
new Thread {
override def run(): Unit = {
var ln = null: String
do {
ln = fin.readLine()
if (ln != null) println(s"LINE: $ln")
} while (ln != null)
@Sciss
Sciss / mkpdf.sh
Created April 24, 2015 12:09
Make a clean build via pdflatex, including biblatex and nomenclature
#!/bin/bash
echo ":::: CLEAN BUILD OF $1 ::::"
cd "$(dirname "$0")" # go into directory of script
rm -f ${1}.toc
rm -f ${1}.run.xml
rm -f ${1}.out
rm -f ${1}.nlo
object ? {
implicit def some[A](x: A): ? [A] = new ? (Some(x))
implicit def wrap[A](opt: Option[A]): ? [A] = new ? (opt)
implicit def unwrap[A](x: ? [A]): Option[A] = x.option
}
final case class ? [A](private val option: Option[A]) extends AnyVal {
override def toString = option.toString
def ? [B] (fun: A => B) : Option[B] = option map fun
def !! : A = option.get
}

In order to build SuperCollider 3.6.5 from source on Linux (Debian), the following steps were necessary on a fresh system:

sudo apt-get install build-essential
sudo apt-get install cmake
sudo apt-get install libfftw3-dev
sudo apt-get install libqt4-dev
sudo apt-get install libqtwebkit-dev
sudo apt-get install libjack-jackd2-dev
sudo apt-get install libsndfile1-dev