Skip to content

Instantly share code, notes, and snippets.

Avatar

Peter Salomonsen petersalomonsen

View GitHub Profile
@petersalomonsen
petersalomonsen / build.sh
Last active April 6, 2023 14:03
sointu renderer
View build.sh
../sointu/sointu-compile -arch amd64 ../sointu/temp_song_file.yml
# if you just want to redner a short version
# node rendershort.mjs
yasm -f macho64 -a x86 temp_song_file.asm --objfile=temp_song_file.o
MACOSX_DEPLOYMENT_TARGET=11 gcc -Wl,-no_pie -arch x86_64 temp_song_file.o test.c -o test
@petersalomonsen
petersalomonsen / song.js
Created May 21, 2022 06:17
WebAssembly Music - Veronika's Waltz
View song.js
/*
* Copyright (c) 2022 - Peter Johan Salomonsen
*/
setBPM(50);
addInstrument('piano');
addInstrument('string');
addInstrument('drums');
addInstrument('guitar');
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 September 4, 2021 10:23
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 April 5, 2021 10:58
WebAssembly music Revision 2021 Executable music competition entry by Peter Salomonsen
View .gitignore
node_modules
@petersalomonsen
petersalomonsen / song.js
Last active January 6, 2021 17:04
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);
@petersalomonsen
petersalomonsen / song.js
Last active October 31, 2020 15:20
mighty
View song.js
// SONGMODE=YOSHIMI
setBPM(75);
createTrack(3).steps(4, [
controlchange(7, 83) // strings volume
]);
createTrack(1).steps(4, [