Skip to content

Instantly share code, notes, and snippets.

View petersalomonsen's full-sized avatar

Peter Salomonsen petersalomonsen

View GitHub Profile
@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
// 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
node_modules
@petersalomonsen
petersalomonsen / wasmsong2.js
Last active January 12, 2021 12:25
Intro song for the music talk at WebAssembly summit 2020. Also available on spotify / soundcloud, song name is "Hondarribia" ( by Peter Salomonsen ) Go to: https://petersalomonsen.com/webassemblymusic/livecodev2/?gist=5b795090ead4f192e7f5ee5dcdd17392
/**
*
* "Hondarribia" - Intro song for the music talk at WebAssembly summit 2020
*
* Also available at spotify / soundcloud
* https://open.spotify.com/track/72SIjtJwJWggfl2nvHPptE?si=xUh-n4h7QCuR2McQCYie3Q
* https://soundcloud.com/psalomo/hondarribia
*
* Copyright (c) 2019-2020 - Peter Johan Salomonsen - All rights reserved
*
@petersalomonsen
petersalomonsen / song.js
Last active January 6, 2021 17:04
Physical modeling synthesis experiments with AssemblyScript
/*
* Copyright (c) 2020 - Peter Johan Salomonsen
*/
setBPM(105);
addInstrument('piano');
addInstrument('string');
addInstrument('drums');
addInstrument('brass');
// SONGMODE=YOSHIMI
setBPM(80);
const lbd = () => c3(1/8,8);
const mbd = () => c3(1/8,35);
const bd = () => c3(1/8,45);
const lsd = () => e3(1/16,20);
const sd = () => e3(1/4,120);
/**
* "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
// SONGMODE=YOSHIMI
setBPM(75);
createTrack(3).steps(4, [
controlchange(7, 83) // strings volume
]);
createTrack(1).steps(4, [
/**
* Copyright 2020 - Peter Johan Salomonsen
*/
setBPM(120);
addInstrument('pad');
addInstrument('drums');
addInstrument('sawtap');
addInstrument('distlead');
@petersalomonsen
petersalomonsen / mix.ts
Last active September 29, 2020 19:59
instrumentstemplate
import { SineOscillator } from '../synth/sineoscillator.class';
import { SawOscillator } from '../synth/sawoscillator.class';
import { Envelope } from '../synth/envelope.class';
import { StereoSignal } from "../synth/stereosignal.class";
import { notefreq } from '../synth/note';
import { Noise } from '../synth/noise.class';
import { BandPass } from '../fx/bandpass';
import { SAMPLERATE } from '../environment';
import { BiQuadFilter, FilterType, Q_BUTTERWORTH } from '../synth/biquad';
import { createInstrumentArray } from '../common/mixcommon';
// SONGMODE=YOSHIMI
setBPM(75);
// ------- bass
createTrack(1).steps(4, [
d3(0.1),,d3(0.1),,
,d3(0.1),,d4(0.05),]);
// -------- piano