Skip to content

Instantly share code, notes, and snippets.

View petersalomonsen's full-sized avatar

Peter Salomonsen petersalomonsen

View GitHub Profile
/**
* Copyright (c) 2019 - Peter Johan Salomonsen - All rights reserved
*/
global.bpm = 110;
global.pattern_size_shift = 4;
// global.looptimes = 100;
// soloInstrument('bass');
@petersalomonsen
petersalomonsen / grooveisinthecode.js
Last active October 4, 2019 20:38
Music: Groove is in the code
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');
/**
* "WASM song"
* Copyright (c) 2019-2020 - Peter Johan Salomonsen - All rights reserved
*/
global.bpm = 123;
global.pattern_size_shift = 4;
// global.looptimes = 100;
/**
* 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);
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 / buildandrun.sh
Created February 11, 2020 19:04
sin vs math.sin benchmark
./node_modules/.bin/asc -O3 --use Math=JSMath --runtime none test.ts -o test.wasm
node test.js
@petersalomonsen
petersalomonsen / 4klangfirstattempt.js
Last active March 18, 2020 18:52
"4klang first attempt" remake for WASM livecode env
/**
*
* "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;
// 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 ));
// SONGMODE=YOSHIMI
setBPM(80);
createTrack(0).steps(4, [
e3
]);
createTrack(2).play([[ 3.51, e6(0.50, 59) ],
[ 4.00, d6(0.46, 65) ],
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Yoshimi-data>
<Yoshimi-data Yoshimi-author="Alan Ernest Calvert" Yoshimi-major="1"
Yoshimi-minor="6">
<INFORMATION>
<string name="XMLtype">Parameters</string>
</INFORMATION>
<BASE_PARAMETERS>
<par name="max_midi_parts" value="16" />
<par name="max_kit_items_per_instrument" value="16" />