Skip to content

Instantly share code, notes, and snippets.

View khoparzi's full-sized avatar
💭
Instigating Creativity

khoparzi

💭
Instigating Creativity
View GitHub Profile
@khoparzi
khoparzi / jArm-Tidal-Functions-In.js
Created April 9, 2021 07:58
Continuous modulation and functions from Tidal implemented in JS (for using in Hydra or P5)
sin = ({time}) => Math.sin(time) // sin
sq = ({time}) => ((Math.sin(time) < 0) ? 0 : 1) // square
saw = ({time}) => (time % 1) * 2 - 1 // saw
sinf = (freq) => ({time}) => Math.sin(time*freq) // sin at freq
sqf = freq => ({time}) => ((Math.sin(time*freq) < 0) ? 0 : 1) // square at freq
sawf = (freq) => ({time}) => ((time * freq) % 1) * 2 - 1 // saw at freq
rsinf = (min,max,freq) => ({time}) => Math.sin(time*freq) * max + min // ranged sin at freq
rsqf = (min,max,freq) => ({time}) => ((Math.sin(time*freq) < 0) ? 0 : 1) * max + min // ranged square at freq
@khoparzi
khoparzi / Marching-2021.js
Created March 30, 2021 19:41
Almost a month's worth of Marching.js sketches exploring various experiments with Signed Distance Fields and combinatorial geometries through the month of March 2021. [Marching.js](https://charlieroberts.github.io/marching/playground/) is a JavaScript shader compiler specifically focused on ray marching via signed distance functions.
// 1 Mar 2021
// Alright time for a new 30 day series! I present to you a new round of Marching.js
m = march(
u = Union2(
hl1 = Halve(Onion(Sphere(3), 0.012), Halve.UP),
hl2 = Halve(Onion(Sphere(2), 0.012), Halve.UP),
hl3 = Halve(Onion(Sphere(1), 0.012), Halve.UP),
hl4 = Halve(Onion(Sphere(0.5), 0.012), Halve.UP),
@khoparzi
khoparzi / GitHub-Satellite-India-March-2021.tidal
Last active March 27, 2021 06:03
Code from a live-coded performance at GitHub Satellite Mar 2020 with @samarthgulati
-- _______ __ __ _______ __ _______ __ __ __ __ __
-- | __|__| |_| | |.--.--.| |--. | __|.---.-.| |_.-----.| | |__| |_.-----.
-- | | | | _| || | || _ | |__ || _ || _| -__|| | | | _| -__|
-- |_______|__|____|___|___||_____||_____| |_______||___._||____|_____||__|__|__|____|_____|
------------------------------------------------------------------------------
-- HARMONIUM
d1
-- $ degradeBy 0.2
@khoparzi
khoparzi / GitHub-Universe-2020.tidal
Created December 1, 2020 03:34
Code from a live-coded performance at GitHub Universe Dec 2020 with @samarthgulati
d1
-- $ dubd
-- $ stb 0.3 (chunk 8 (fast 2))
-- $ slow 8 $ chop 16
-- $ smash 8 [2,8,7,2]
-- $ fast 2
$ s "pads" # n 3 # l 1 -- Peace is the mission
-- $ s "pads" # n 20 # l 1 -- Intense pads
-- $ s "pads" # n 21 # l 1 -- Elevate
-- $ basspad # l 1
@khoparzi
khoparzi / Juliana-2020.js
Last active September 28, 2021 18:11
Almost a month's worth of Marching.js sketches exploring various experiments with Julia fractals through the month of July 2020. Marching.js is a JavaScript shader compiler specifically focused on ray marching via signed distance functions.
// Try these at https://charlieroberts.github.io/marching/playground/
// 1 Jul
march(
mb = Julia()
.material(Material('phong', Vec3(.0), Vec3(.5), Vec3(1), 32, Vec3(0))),
Plane(Vec3(0, 0, 1), 0.5).material('white glow')
)
.fog( .2, Vec3(0.25, 0.3, 0) )
@khoparzi
khoparzi / Ritmo-Oslo-10July-2020.tidal
Last active July 12, 2020 15:13
Code from a live-coded performance at MusicLab 5: Lockdown Rave by UiOUiO RITMO Centre for Interdisciplinary Studies in Rhythm, Time and Motion, University of Oslo.
--The 5th edition of MusicLab is an algorave (algorithmic rave) featuring Renick Bell based in Japan, Khoparzi based in India, and researchers in Norway. Renick Bell and Khoparzi will improvise live-coded music on their computers while the audience dances. We will measure audience members' movement using our new MusicLab mobile application that uses smartphones' accelerometers and gyroscopes. We will also ask questions about the experience of the concert.
-- Watch the performance at https://www.youtube.com/watch?v=hJ73IGYawuM&t=865s
-- More information here: https://www.uio.no/ritmo/english/news-and-events/events/musiclab/2020/musiclab-5---lockdown-rave/index.html
-- All the custom functions are described in the end
bpm(160)
load "voxs"
-- Equinox stream
Hi All! I am Khoparzi from Allahabad, India
Playing out to you from Mumbai
d1
-- $ chup
$ microd
$ stb 0.3 (jux (rev))
$ oftflip
d3m' 14
$ oftflip
$ s "808:1*8" # e tn # g 1.3
-- # lpf (4000)
d4
$ microd
$ slice 16 (scramble 4 "0 1 2 3") $ s "minim"
# n 18
# n "<16 18 15>"
@khoparzi
khoparzi / Exploring-The-Edge.tidal
Last active January 19, 2020 10:25
Performance at Exploring The Edge, January 5th 2020 at the India International Centre
d1 $ fastflip $ s "scw*16"
# lpf 2000
# n (irand 100) # loop 7
# posz (-2) # rotz ((sinf 0.2) * 20 - 10) # sep 0.3 # fs 0
d2
$ degradeBy 0.25
$ footwork
$ s "dudak:2" # fs 2
@khoparzi
khoparzi / 20Beats.tidal
Created June 5, 2019 05:34
Just a collection of basic beats suggested by Drum Beats Online in this video https://www.youtube.com/watch?v=mwe4HPOiUms
-- Just a collection of basic beats suggested by Drum Beats Online in this video
-- https://www.youtube.com/watch?v=mwe4HPOiUms
-- n "13" -- Kick
-- n "4" -- Hats
-- n "10" -- Tight Hats
-- n "5" -- Hats alt
-- n "11" -- Open hats
-- n "17" -- Really Open hats
-- n "21" -- Hat pedal