Skip to content

Instantly share code, notes, and snippets.

Avatar

Peter Salomonsen petersalomonsen

View GitHub Profile
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
View song.js
/**
* Copyright 2020 - Peter Johan Salomonsen
*/
setBPM(100);
addInstrument('pad');
addInstrument('drums');
addInstrument('sawtap');
addInstrument('distlead');
@petersalomonsen
petersalomonsen / Makefile
Last active Jul 7, 2020
WebAssembly music to native executable
View Makefile
# replace with wasm2c location
WASM2C=/home/peter/git/wabt/wasm2c
all:
wasm2c song.wasm -o song.c
gcc -O3 -I$(WASM2C) main.c song.c $(WASM2C)/wasm-rt-impl.c -lm -lsoundio -o song
View song20200520.js
// 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);
View yoshimi_chill.js
// SONGMODE=YOSHIMI
/**
* "Chill And Feel" - (c) 2020 Peter Johan Salomonsen
*/
setBPM(100);
createTrack(5).steps(4,[controlchange(7, 120)]);
createTrack(2).steps(4,[controlchange(7, 100),controlchange(64, 0)]); // piano
View yoshimitest3.js
// SONGMODE=YOSHIMI
setBPM(75);
createTrack(0).steps(4, [e3]);
createTrack(2).play([[ 0.25, a5(0.15, 48) ],
[ 0.75, a5(0.26, 43) ],
[ 0.49, f6(0.58, 72) ],
View yoshimitest2.js
// SONGMODE=YOSHIMI
setBPM(80);
createTrack(0).steps(4, [
e3
]);
createTrack(2).play([[ 3.51, e6(0.50, 59) ],
[ 4.00, d6(0.46, 65) ],
View yoshimiconfig.xml
<?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" />
You can’t perform that action at this time.