Skip to content

Instantly share code, notes, and snippets.

Avatar

Peter Salomonsen petersalomonsen

View GitHub Profile
View lakemandelbrot.glsl
#version 100
precision highp float;
uniform vec2 resolution;
uniform float time;
vec3 hsv2rgb(vec3 c)
{
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
View song.js
/*
* Copyright (c) 2021 - Peter Johan Salomonsen
*/
setBPM(85);
addInstrument('piano');
addInstrument('string');
addInstrument('drums');
addInstrument('guitar');
View song.js
/*
* Copyright (c) 2021 - Peter Johan Salomonsen
*/
setBPM(100);
addInstrument('BoltToysPluck');
addInstrument('SphericalBowl');
addInstrument('KnotPressureModeled');
addInstrument('empty1');
@petersalomonsen
petersalomonsen / song.js
Last active Sep 4, 2021
Protracker Scripting - Amiga protracker module created in Javascript / Assemblyscript https://petersalomonsen.com/webassemblymusic/livecodev2/?gist=b9f7239aebb0c22d1d82a55520775afc
View song.js
// SONGMODE=PROTRACKER
import { writeMod, cmd, clr } from './lib/protrackermodwriter.js';
import { createSamples } from './lib/instrumentgenerator.js';
import { createSampleEcho, insertNotesIntoPattern, insertSampleNotesIntoPattern, toPatternArray, createEmptyPatternArray } from './lib/patterntools.js';
onmessage = function(msg) {
const samples = createSamples(msg.data.WASM_SYNTH_BYTES, [
(instance) => {
instance.setChannelValue(0, 69 - (12 ));
@petersalomonsen
petersalomonsen / .gitignore
Last active Apr 5, 2021
WebAssembly music Revision 2021 Executable music competition entry by Peter Salomonsen
View .gitignore
node_modules
@petersalomonsen
petersalomonsen / song.js
Last active Jan 6, 2021
Physical modeling synthesis experiments with AssemblyScript
View song.js
/*
* Copyright (c) 2020 - Peter Johan Salomonsen
*/
setBPM(105);
addInstrument('piano');
addInstrument('string');
addInstrument('drums');
addInstrument('brass');
View song.js
/**
* "Fall"
*
* Spotify: https://open.spotify.com/track/0UtYDJwUGQO4OvCmPnGvZT?si=pB48erfcSeud45DKaWtfmQ
* Soundcloud: https://soundcloud.com/psalomo/fall
*
* Copyright 2020 - Peter Johan Salomonsen
*/
setBPM(100);
View song.js
// SONGMODE=YOSHIMI
setBPM(75);
createTrack(3).steps(4, [
controlchange(7, 83) // strings volume
]);
createTrack(1).steps(4, [
View song.js
/**
* Copyright 2020 - Peter Johan Salomonsen
*/
setBPM(120);
addInstrument('pad');
addInstrument('drums');
addInstrument('sawtap');
addInstrument('distlead');
View song.js
// SONGMODE=YOSHIMI
setBPM(75);
// ------- bass
createTrack(1).steps(4, [
d3(0.1),,d3(0.1),,
,d3(0.1),,d4(0.05),]);
// -------- piano