Skip to content

Instantly share code, notes, and snippets.

View halldorel's full-sized avatar

Halldór Eldjárn halldorel

View GitHub Profile
@halldorel
halldorel / dof.js
Created June 19, 2019 20:35
Inconvergent DOF effect implementation in JS
// Requires npm package canvas-sketch
// Credit: https://inconvergent.net/2019/depth-of-field/
const canvasSketch = require('canvas-sketch');
const settings = {
dimensions: [ 2000, 2000 ]
};
const points = [[[500, 500, 0], [1700, 700, 200]], [[1700, 700, 200], [900, 1000, 0]], ];
const folderName = filenamify(req.body.folderName);
const createSize = (file) => new Promise((resolve, reject) => {
// Returns a promise
console.log("Inside resize", file);
return sharp(file.buffer).resize(file.w, file.w, {
fit: sharp.fit.inside,
withoutEnlargement: true,
})
.toFormat('jpeg')

Keybase proof

I hereby claim:

  • I am halldorel on github.
  • I am halldorel (https://keybase.io/halldorel) on keybase.
  • I have a public key ASCRtZXBVXl9iBBjJLREQrK3xtdlb0MbAAIOrooVpT-5kAo

To claim this, I am signing this object:

s = Server.local
s.boot
s.reboot;
s.options.inDevice = "Built-in Microph"
s.options.inDevice = "Duet USB"
s.options.outDevice = "Built-in Audio"
s.options.outDevice = "Soundflower (2ch)"
s.options.inDevice;
s.options.outDevice;
@halldorel
halldorel / rhythm.ino
Created September 4, 2018 16:01
arduino rhythm player
// Notum pinna númer PIN_NO til að stýra solenoid. Breyta hér til að velja annan pinna
#define PIN_NO 3
// SONG_SPEED segir hversu hratt lagið á að vera
// Hærra gildi, þýðir lengra á milli slaga, sem er hægara tempo
#define SONG_SPEED 500
// DOWN_TIME segir hversu lengi hamarinn er niðri í ms
// ATH að má ekki vera lengra en SONG_SPEED
#define DOWN_TIME 20
@halldorel
halldorel / HEART.ino
Created January 27, 2018 20:35
Heartbeat Arduino sketch with spam rejection 😅
/*
Code to detect pulses from the PulseSensor,
using an interrupt service routine.
Here is a link to the tutorial\
https://pulsesensor.com/pages/getting-advanced
Copyright World Famous Electronics LLC - see LICENSE
Contributors:
Joel Murphy, https://pulsesensor.com
@halldorel
halldorel / Tix Privacy Policy
Last active May 18, 2017 15:54
Tix Scanner Privacy Policy
Privacy Policy of Tix Scanner
In order to receive information about your Personal Data, the purposes and the parties the Data is shared with, contact the Owner.
Data Controller and Owner
Types of Data collected
The owner does not provide a list of Personal Data types collected.
Other Personal Data collected may be described in other sections of this privacy policy or by dedicated explanation text contextually with the Data collection.
The Personal Data may be freely provided by the User, or collected automatically when using this Application.
Any use of Cookies - or of other tracking tools - by this Application or by the owners of third party services used by this Application, unless stated otherwise, serves to identify Users and remember their preferences, for the sole purpose of providing the service required by the User.
Failure to provide certain Personal Data may make it impossible for this Application to provide its services.
Users are responsible for any Personal Data of third parties obtained, publish
Poco Apollo is a generative music piece by Icelandic musician/programmer Halldór Eldjárn. It is built upon NASA’s photo archive from the Apollo Space mission, which consists of ~15.000 photos taken during the missions. The piece is a web app that generates musical soundscapes for the images in the library. It uses common computer vision algorithms to determine the mood of the picture and that is used as the input to the music composition engine.
You can check it out now: http://pocoapollo.hdor.is
I created the piece to open up this incredible photo library. The mood in the pictures is somewhat unusual as some pictures look quite casual unlike the most famous and polished pictures we are so used to seeing, from these missions. Some are even quite bad, but still they are taken during one of the most incredible journeys mankind has embarked upon. The web app selects a picture at random and the browser then starts playing the soundtrack for that picture.
All composition and audio is done in the browser. No da
@halldorel
halldorel / ShowerPower.ino
Last active March 20, 2017 15:18
Script that controls a shower with singing
//
// Voice controlled servos, for Stefán Finnbogason's singing shower project
// Author: Halldor Eldjarn 2017
//
#include <Servo.h>
#define NUM_SHOWERS 4
int inputValues[NUM_SHOWERS];
//
// BassDrumNew.cpp
// Synthesizer
//
// Created by Halldór Eldjárn on 06/08/14.
// Copyright (c) 2014 Edu. All rights reserved.
//
#ifndef __Synthesizer__BassDrum__
#define __Synthesizer__BassDrum__