This file contains hidden or 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
# "night owl" jam | |
# sonic pi version: v3.2.1 | |
with_fx :reverb, room: 1 do | |
live_loop :midi_piano do | |
use_real_time | |
note, velocity = sync "/midi:midi_fighter_64:0:3/note_on" | |
with_fx :flanger, wave: 0, decay: 0, delay: 0, max_delay: 0 do | |
synth :pretty_bell, note: note - 12 | |
synth :pluck, note: note - 12, attack: 0, coef: -0.5, sustain: 0, amp: (velocity / 127.0) | |
synth :pluck, note: note, attack: 0, coef: 0.1, sustain: 0, amp: (velocity / 127.0) |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
body { | |
padding: 10px; | |
} |
This file contains hidden or 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
library(rlang) | |
fun <- function(x = 3, y, z = 1) { | |
paste(x, y, z) | |
} | |
# default arguments and regular argument order can be scrambled | |
# yet produce the same call |
This file contains hidden or 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
# test file | |
sample_chunk <- " | |
```{r hello, testing=as.logical(1), another=1 + 1} | |
1 + 1 | |
```" | |
file = "sample.Rmd" | |
writeLines(sample_chunk, con = file) | |
foo_hook <- function(before, options, envir) { | |
# note: this returns raw knitr chunks in list format | |
# has attribute of "chunk_opts" |
This file contains hidden or 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
# lfo for sines | |
lfo0 = (range 0, 2, 0.25).mirror | |
lfo1 = (range 0, 1, 0.025).mirror | |
# lfo for panning | |
lfo2 = (range -1, 1, 0.125).mirror | |
# lfos for bd_haus (dark-side of the beat) | |
lfo3 = (range 0.25, 0.5, 0.025).mirror | |
lfo4 = (range 0.5, 3, 0.125).mirror | |
# let's get wonky with it! slow, slow, slow steps | |
lfo5 = (range 1, 8, 0.005).mirror |
This file contains hidden or 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
--- | |
title: "Python exercises" | |
author: "Nischal Shrestha" | |
# output: library(devtools); library(here); load_all(here()); learnr::tutorial # use this when using a local learnr | |
output: learnr::tutorial | |
runtime: shiny_prerendered | |
--- | |
```{r setup, include=FALSE} | |
# R related |
This file contains hidden or 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
# Electrotribal dance | |
live_loop :bass_drums do | |
amp = 0.0 | |
if (spread 7, 8).reverse.tick | |
sample :bd_haus, rate: 1, attack: 0.01, release: 0.25, amp: amp | |
sleep 0.5 | |
else | |
sample :bd_haus, rate: rrand_i(1, 3), attack: 0.025, sustain: 0.5, release: 0.1, amp: amp + 1 | |
sleep 0.09 |
This file contains hidden or 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
##| Ambient 1 | |
with_fx :reverb, room: 0.8, mix: 0.6 do | |
live_loop :deep_saws do | |
use_synth :saw | |
amp = 0 | |
release = rrand_i(5, 8) | |
attack = rrand(0.8, 3.0) | |
with_fx :lpf, cutoff: 80 do |
This file contains hidden or 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
##| Recreating a Colin Bender arppegio pattern from lockdown day 40 | |
##| Cm, Abmaj, Ebmaj, Bdim | |
##| intervals for readability | |
root = 0 | |
second = 1 | |
third = 2 | |
fourth = 3 | |
fifth = 4 | |
eighth = 7 |