Skip to content

Instantly share code, notes, and snippets.

Peter Salomonsen petersalomonsen

Block or report user

Report or block petersalomonsen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View amigashuffle.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 / 4klangfirstattempt.js
Last active Mar 18, 2020
"4klang first attempt" remake for WASM livecode env
View 4klangfirstattempt.js
/**
*
* "4klang first attempt" - originally made for 4klang, remake for livecode wasm env.
*
* Copyright (c) 2019-2020 - Peter Johan Salomonsen - All rights reserved
*
*/
global.bpm = 106;
global.pattern_size_shift = 4;
@petersalomonsen
petersalomonsen / buildandrun.sh
Created Feb 11, 2020
sin vs math.sin benchmark
View buildandrun.sh
./node_modules/.bin/asc -O3 --use Math=JSMath --runtime none test.ts -o test.wasm
node test.js
View webchip.js
/**
* Copyright (c) 2019 - Peter Johan Salomonsen - All rights reserved
*/
global.bpm = 110;
global.pattern_size_shift = 4;
var pianoVoices = [];
for(let n=1;n<=8;n++) {
pianoVoices.push('piano'+n);
@petersalomonsen
petersalomonsen / mix.ts
Last active Feb 29, 2020
instrumentstemplate
View mix.ts
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';
View wasmsong.js
/**
* "WASM song"
* Copyright (c) 2019-2020 - Peter Johan Salomonsen - All rights reserved
*/
global.bpm = 123;
global.pattern_size_shift = 4;
// global.looptimes = 100;
@petersalomonsen
petersalomonsen / wasmsong2.js
Last active Feb 29, 2020
Intro song for the music talk at WebAssembly summit 2020. Also available on spotify / soundcloud, song name is "Hondarribia" ( by Peter Salomonsen )
View wasmsong2.js
/**
*
* "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
*
View shuffle.mix.ts
import { StereoSignal } from "../synth/stereosignal.class";
import { Freeverb } from "../fx/freeverb";
import { DelayLine } from "../fx/delayline";
import { SAMPLERATE } from "../environment";
import { TriBandStereoCompressor } from "../fx/tribandstereocompressor";
import { EQBand } from "../fx/eqband";
import { SubPiano } from "../instruments/piano/subpiano";
import { Kick2 } from "../instruments/drums/kick2.class";
@petersalomonsen
petersalomonsen / grooveisinthecode.js
Last active Oct 4, 2019
Music: Groove is in the code
View grooveisinthecode.js
global.bpm = 120;
global.pattern_size_shift = 4;
global.WASM_SYNTH_LOCATION = 'https://gist.githubusercontent.com/petersalomonsen/e49e3b861b57a9bbb8769b7cace43311/raw/08b47509211dbec1f578bb9590dd7b03b3084e2d/grooveisinthecode.wasm';
// global.looptimes = 100;
/*soloInstrument('pad1');
soloInstrument('pad2');
soloInstrument('pad3');*/
// soloInstrument('lead1');
View webchipmusic.js
/**
* Copyright (c) 2019 - Peter Johan Salomonsen - All rights reserved
*/
global.bpm = 110;
global.pattern_size_shift = 4;
// global.looptimes = 100;
// soloInstrument('bass');
You can’t perform that action at this time.