Skip to content

Instantly share code, notes, and snippets.

View AvneeshSarwate's full-sized avatar

Avneesh Sarwate AvneeshSarwate

View GitHub Profile
@AvneeshSarwate
AvneeshSarwate / generic_pattern_template.scd
Created October 20, 2022 15:31
a general pattern template that can be hacked for abstrac sequencing needs
(
t = TempoClock.new;
f = Routine.new({(0..).do({|ind| ind.yield})});
~cat = "meow";
p = Pbind(
/*arbitrary pattern to specify the rhythm - can make it a Pfunc that references external variables
so that the rhythm can be generatively controlled by external data (eg midi or osc or whatever)
*/
\delta, Pfunc({|argEv| var wt = ((f.next+1)*1.0); [argEv, wt].postln; wt.rand}),
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.animatable.Animatable
import org.openrndr.animatable.easing.Easing
import org.openrndr.draw.*
import org.openrndr.extra.olive.oliveProgram
fun main(args: Array<String>) {
application {
@AvneeshSarwate
AvneeshSarwate / sketch1.kts
Last active April 14, 2022 04:18
orx one-file sketches
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.color.mix
import org.openrndr.draw.*
import org.openrndr.extra.olive.oliveProgram
import org.openrndr.extras.color.presets.MEDIUM_AQUAMARINE
import org.openrndr.extras.color.presets.TOMATO
import kotlin.math.cos
import kotlin.math.sin
@AvneeshSarwate
AvneeshSarwate / FeedbackTemplate.kt
Created February 8, 2022 15:36
Feedback drawing
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.*
import org.openrndr.extra.olive.oliveProgram
import kotlin.math.cos
import kotlin.math.sin
fun main(args: Array<String>) {
application {
@AvneeshSarwate
AvneeshSarwate / Log_output.txt
Last active February 8, 2022 05:59
Program with olive hot-reload error
/Users/avneeshsarwate/Library/Java/JavaVirtualMachines/azul-16.0.2/Contents/Home/bin/java -javaagent:/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar=53523:/Applications/IntelliJ IDEA CE.app/Contents/bin -Dfile.encoding=UTF-8 -classpath /Users/avneeshsarwate/openrndr-template/build/classes/kotlin/main:/Users/avneeshsarwate/openrndr-template/build/resources/main:/Users/avneeshsarwate/.m2/repository/org/openrndr/openrndr-ffmpeg/0.5.1-SNAPSHOT/openrndr-ffmpeg-0.5.1-SNAPSHOT.jar:/Users/avneeshsarwate/.m2/repository/org/openrndr/extra/orx-gui/0.5.1-SNAPSHOT/orx-gui-0.5.1-SNAPSHOT.jar:/Users/avneeshsarwate/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.6.10/e80fe6ac3c3573a80305f5ec43f86b829e8ab53d/kotlin-stdlib-jdk8-1.6.10.jar:/Users/avneeshsarwate/.m2/repository/org/openrndr/extra/orx-git-archiver/0.5.1-SNAPSHOT/orx-git-archiver-0.5.1-SNAPSHOT.jar:/Users/avneeshsarwate/.m2/repository/org/openrndr/extra/orx-olive/0.5.1-SNAPSHOT/orx-olive-0.5.1-SNAPSHOT.jar:/Users/avneeshsarw
document.body.innerHTML = `
<div id="videoContainer"></div>
<div id="textEntryContainer">
<textarea id="urlInput" name="w3review" rows="4" cols="50">
paste from the google sheet here
</textarea>
<button id="playlistButton">click here to make playlist</button>
</div>
@AvneeshSarwate
AvneeshSarwate / closureBinder.js
Last active January 18, 2021 04:40
JS closure livecoding
//how to install/import an editor with native es6 modules without having
//to deal with JS builds
// npm install ace-builds
/*
import * as acemodule from './node_modules/ace-builds/src-noconflict/ace.js';
let editor = ace.edit('container-div');
*/
// https://stackoverflow.com/a/49245333
// https://github.com/AvneeshSarwate/graphicsLivecoding/blob/master/editorSetup.js
(
var clock, midiOut, midiNote, bpm;
MIDIClient.init;
MIDIClient.destinations.postln;
//define these however you like
midiNote = 60;
bpm = 20;
@AvneeshSarwate
AvneeshSarwate / arduinoLEDPrototype.js
Created May 28, 2018 22:18
prototyping arduino/led graphics on 60x50 pixel display
var w = 1280*1.2,
h = 720*1.2;
function setup(){
createCanvas(w, h);
}
var cos = Math.cos;
var sin = Math.sin;
var sinN = n => (sin(n)+1)/2; //sin normalized [0-1]
var cosN = n => (cos(n)+1)/2; //cos normalized [0-1]
@AvneeshSarwate
AvneeshSarwate / basic.html
Created December 19, 2017 02:39
Tone.Sequence not running on iOS
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>StartAudioContext</title>
<script type="text/javascript" src="StartAudioContext.js"></script>
<script type="text/javascript" src="Tone.js"></script>
</head>
<body>