This file contains 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
var Botkit = require('botkit') | |
var token = process.env.SLACK_TOKEN | |
var controller = Botkit.slackbot({ | |
// reconnect to Slack RTM when connection goes bad | |
retry: Infinity, | |
debug: false | |
}) |
This file contains 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
{ | |
"name": "toy-slack-bot", | |
"version": "1.0.0", | |
"description": "A sample Node.js Slackbot", | |
"main": "index.js", | |
"scripts": { | |
"start": "node index.js" | |
}, | |
"dependencies": { | |
"beepboop-botkit": "^1.4.0", |
This file contains 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
Proposition | |
----------- | |
Vinyl is making a comeback, sales have grown every year in the UK for the last 9 years. | |
50% YoY growth in 2015 UK. Turntables were the most popular audio item sold on | |
Amazon during the run up to Christmas 2015. | |
People now discover music through digital services, the common way to bookmark this | |
music is with playlists. We make it easy to go from playlist to physical vinyl. | |
Shipping can form a large percentage of the total price for vinyl (typically 10-50%) | |
so we help to find sellers who can combine shipping for multiple items. |
This file contains 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
// Return a random sequence with a given length of notes | |
void generateSequence(int notes[], int num_notes, int range) { | |
// Make sure pin 0 is unconnected | |
randomSeed(analogRead(0)); | |
for (int i=0;i<num_notes;i++) { | |
notes[i] = random((1-range), (range-1)); | |
} | |
} |
This file contains 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
int quantizePot(int pin, int range) { | |
float sensorValue = analogRead(pin); | |
// assume pot value is 0 - 1024 | |
// quantize to value between 1 and range | |
float value = ((sensorValue / 1024) * (range-1)) + 1; | |
return (int)lround(value); | |
} |
This file contains 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
#include <SoftwareSerial.h> | |
SoftwareSerial midi(5, 6); // RX, TX | |
#define MIDINOTEON 144 //144 = 10010000 in binary, note on command | |
void setup() { | |
midi.begin(31250); // Set MIDI baud rate: 31250 | |
} |
This file contains 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
NoteOn(velocity=127, note=60) | |
wait (1) | |
NoteOn(velocity=0, note=60) |
NewerOlder