Skip to content

Instantly share code, notes, and snippets.

View davejachimiak's full-sized avatar

Dave Jachimiak davejachimiak

View GitHub Profile
@davejachimiak
davejachimiak / Spike: Audio layering.md
Last active August 11, 2022 18:25
Research relating to: app.shortcut.com/wistia-pde/story/2262/spike-audio-layering

Spike: Audio layering

Research Objectives

Because render pipeline has support for layering audio, we need to research what it will take to support this in the UI - like adding a background track, and adjusting the volume on both the main track and background track.

Engineering Approach

  • Figure out what payload the Render Pipeline contract expects
    • Answer: RP is expecting an audioMix type, an input, multiple audio inputs -- an example of that being below.
  • Test hardcoding the input of a background track to supply RP and make sure you're getting the expected output.
// This file is part of www.nand2tetris.org
// and the book "The Elements of Computing Systems"
// by Nisan and Schocken, MIT Press.
// File name: projects/12/Memory.jack
/**
* Memory operations library.
*/
class Memory {
static int MEMORY, HEAP_BASE, NEXT_POINTER, SIZE, HEAP_LIMIT, OOM, freeList, i;
{
"$schema": "http://json-schema.org/schema#",
"additionalProperties": false,
"definitions": {
"pathType": {
"type": "string",
"pattern": "^(\\/?((\\.{2})|([a-z0-9][a-z0-9\\-.]*[a-z0-9]+)|([a-z0-9]*))($|\\/))+$",
"minLength": 1
}
},
@davejachimiak
davejachimiak / frp.md
Created October 11, 2015 01:43
A Collection of Papers on Functional Reactive Programming
  • Functional Reactive Animation. 1997. Conal Elliott and Paul Hudak.
  • Functional Reactive Programming From First Principles. 2000. Paul Hudak and Zhanyong Wan.
  • Genuinely Functional User Interfaces. 2001. Antony Courtney and Conal Elliott.
  • Event-Driven FRP. 2002. Zhanyong Wan, Walid Taha, and Paul Hudak.
  • Functional Reactive Programming, Continued. 2002. Henrik Nilsson, Antony Courtney, and John Peterson.
  • Push-Pull Reactive Programming. 2009. Conal Elliott
  • Asynchronous Functional Reactive Programming for GUIs. 2013. Stephen Chong and Evan Czaplicki.
@davejachimiak
davejachimiak / Makefile
Created August 8, 2015 02:27
A lispy arithmetic REPL
all:
/usr/local/Cellar/bison/3.0.4/bin/bison lispcalc.y && gcc -lm -o lispcalc lispcalc.tab.c
@davejachimiak
davejachimiak / sicp-1.18.hs
Created October 25, 2014 20:04
sicp 1.18
-- [Design an *iterative* process for multiplying to integers that] uses a
-- logarithmic number of steps.
double :: Integer -> Integer
double x = x + x
halve :: Integer -> Integer
halve x = x `div` 2
multiply :: Integer -> Integer -> Integer
@davejachimiak
davejachimiak / sicp1.17.hs
Created October 25, 2014 19:24
sicp 1.17 in haskell
-- ...
-- ...
-- [Assume your language doesn't have a multiplication function or
-- table. Given `double` and `half` functions,] design a
-- multiplication procedure that uses a logarithmic number of steps.
double :: Integer -> Integer
double x = x + x
halve :: Integer -> Integer
var Evented;
Evented = {
on: function(event, callback) {
var _base;
(_base = this.callbacks)[event] || (_base[event] = []);
return this.callbacks[event].push(callback);
},
trigger: function(event) {
var args, callbacks;
-- SICP 1.12
--
-- The following pattern of numbers is called Pascal's triangle.
--
-- 1
-- 1 1
-- 1 2 1
-- 1 3 3 1
-- 1 4 6 4 1
-- ...
@davejachimiak
davejachimiak / sicp-1.1.hs
Last active August 29, 2015 14:07
SICP 1.11
-- SICP 1.11
--
-- A function f is defined by the rule that f(n) = n if n < 3 and
-- f(n) = f(n - 1) + 2f(n - 2) + 3f(n - 3) if n >= 3. Write a
-- procedure computes f by means of a recursive process.
--
f :: Integer -> Integer
f n
| n < 3 = n
| otherwise = f (n - 1) + 2 * f (n - 2) + 3 * f (n - 3)