Skip to content

Instantly share code, notes, and snippets.

@starakaj
starakaj / MultiTableLookupOsc.cpp
Created August 12, 2014 23:53
Trying to make a multi-table lookup generator
//
// MultiTableLookupOsc.cpp
// Rhythm Necklace
//
// Created by Sam Tarakajian on 12/08/2014.
// Copyright (c) 2014 Sam Tarakajian. All rights reserved.
//
#include "MultiTableLookupOsc.h"
@starakaj
starakaj / MultiTableLookupOsc.cpp
Last active August 29, 2015 14:05
Trying to make a lookup oscillator that can jump between multiple waveforms
//
// MultiTableLookupOsc.cpp
// Rhythm Necklace
//
// Created by Sam Tarakajian on 12/08/2014.
// Copyright (c) 2014 Sam Tarakajian. All rights reserved.
//
#include "MultiTableLookupOsc.h"
[CATransaction begin];
[CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions];
[self setNeedsDisplay];
[CATransaction commit];
//
// ViewController.m
// SimpleAudioTest
//
// Created by Sam Tarakajian on 8/24/15.
// Copyright © 2015 Sam Tarakajian. All rights reserved.
//
#import "ViewController.h"
@import AudioToolbox;
<pre><code>
----------begin_max5_patcher----------
971.3ocyXkriaiCD8r8WgFc1wfKZwZtMe.yo4XiFFzRz1LsLo.EUmNSP92Gt
JKIKujFcRlFnEo35qp5wGK4usbQ7Nwaz13n+L5onEK91xEKrMYZXg+8EwmHu
UVSZsCK9DSRVepqVwThtxiwqbig2chwqoJ6ff9Fa+Bqgt0NtskhNtxzIv2oh
zrkxI6poUSa17+EiugnJOx3G1JokJGhKRVCVEASv1hzLaQFbMH5Y+jX10NVr
6yeBN.phN0TrVJpER2xBVmmT.Pqlsx40tgw010LlfTnHJ5b83bHWypm2O4vp
5qMTG5hiid1zy2Wtz7X0CF23zun8BAefh9lcSh+iOEAWGZsU80Z6tDOaXEc8
HADuw372jZdhglmHzUhCI2NPbg8tuVPTenFcGugT9Rz9n8OnkCuGGDaM7L7M
Mb77FN51F9peFd.odynQiNA+9C9dW.FXJxucvG7C5CLl+6yxaqYUTYX6dkH4
@starakaj
starakaj / tmsURLReader.js
Created April 12, 2017 17:43
Fetching an Art Object
_fetchArtObjectWithId(id) {
const requestURLString = this._urlForObjectWithId(id);
logger.info(`Fething collection object with id: ${id} at url: ${requestURLString}`);
return new Promise((resolve, reject) => {
const req = https.request(requestURLString, (res) => {
let data = '';
res.on('data', (d) => {
@starakaj
starakaj / tmsURLReader.js
Created April 12, 2017 17:44
URL for a collection object by ID
// from src/tms_csv/src/script/tmsURLReader.js
_urlForObjectWithId(id) {
const requestURL = url.parse(this.rootURL);
requestURL.pathname = `objects/${id}/json`;
this._addCredentialsToURL(requestURL);
return url.format(requestURL);
}
@starakaj
starakaj / csvWriter.js
Created April 12, 2017 17:51
Writing a CSV
const logger = require('./logger.js');
const fs = require('fs');
const csv = require('fast-csv');
module.exports = class CSVWriter {
constructor(path) {
logger.info(`Opening CSV file at ${path}`);
this._path = path;
this._csvStream = csv.createWriteStream({ headers: true });
this._writableStream = fs.createWriteStream(path);
@starakaj
starakaj / gist:cfb1d8ef6eb933457035d59adcac879a
Created May 10, 2017 13:55
Creating a simple collection table
create table collection(
id bigint unsignet primary key,
name varchar(100),
description varchar(512)
);
insert into collection (id, name, description) values
(1, 'Two Geese', 'A painting of two beautiful geese'),
(2, 'Roses in Bloom', 'Blooming roses, obviously'),
(3, 'Still Life with Cake', 'A partially eaten cake, next to a vase.');
create table collection(
id bigint unsigned primary key,
name varchar(100),
description varchar(512)
);
insert into collection (id, name, description) values
(1, 'Two Geese', 'A painting of two beautiful geese'),
(2, 'Roses in Bloom', 'Blooming roses, obviously'),
(3, 'Still Life with Cake', 'A partially eaten cake, next to a vase.');