Skip to content

Instantly share code, notes, and snippets.

@petersalomonsen
Last active August 21, 2023 19:36
Show Gist options
  • Save petersalomonsen/b337713ac66b7e32bfc8759f35fad926 to your computer and use it in GitHub Desktop.
Save petersalomonsen/b337713ac66b7e32bfc8759f35fad926 to your computer and use it in GitHub Desktop.
sointu test song
global.bpm = 110;
global.pattern_size_shift = 4;
// global.looptimes = 100;
//soloInstrument('kick');
/*soloInstrument('pad1');
soloInstrument('pad2');
soloInstrument('pad3');*/
// soloInstrument('lead1');
//soloInstrument('kick');
//soloInstrument('hihat');
//soloInstrument('snare');
//soloInstrument('squarelead');
// soloInstrument('lead1');
/*
GO4K_ENV ATTAC(0),DECAY(64),SUSTAIN(96),RELEASE(64),GAIN(90)
GO4K_FST AMOUNT(128),DEST(0*MAX_UNIT_SLOTS+2+FST_SET)
GO4K_ENV ATTAC(0),DECAY(70),SUSTAIN(0),RELEASE(0),GAIN(100)
GO4K_DST DRIVE(32), SNHFREQ(128), FLAGS(0)
GO4K_FST AMOUNT(80),DEST(6*MAX_UNIT_SLOTS+1+FST_SET)
GO4K_FOP OP(FOP_POP)
GO4K_VCO
TRANSPOSE(46),DETUNE(64),PHASE(0),GATES(85),COLOR(64),SHAPE(64),GAIN(48),FLAGS(TRISAW)
GO4K_FOP OP(FOP_MULP)
GO4K_FOP OP(FOP_LOADNOTE)
GO4K_FOP OP(FOP_MULP)
GO4K_PAN PANNING(40)
GO4K_OUT GAIN(12), AUXSEND(1)
*/
const sointukick = {
"numvoices": 1,
"units": [
{
type: "envelope",
id: 'env',
parameters: { attack: 5, decay: 64,gain: 100,release: 64, stereo: 0,sustain: 0 }
},
{
type: 'send',
parameters: {amount: 128, port: 4, sendpop: 0, stereo: 0, target: 'env'}
},
{
type: "envelope",
parameters: { attack: 0, decay: 70,gain: 115,release: 0, stereo: 0,sustain: 0 }
},
{
type: 'distort',
parameters: {drive: 32, stereo: 0}
},
{
type: 'send',
parameters: {amount: 128, port: 1, sendpop: 0, stereo: 0, target: 'osc'}
},
{
type: 'pop',
parameters: {stereo: 0}
},
{
type: 'oscillator', id: 'osc', parameters: {color: 64, detune: 55, gain: 45, lfo: 0, phase: 0, shape: 96, stereo: 0, transpose: 46, type: 1, unison: 1}
},
{
type: 'mulp',
parameters: {stereo: 0}
},
{ type: 'filter', parameters: {lowpass: 1, frequency: 30, resonance: 128}},
{
type: 'loadnote',
parameters: {stereo: 0}
},
{
type: 'mulp',
parameters: {stereo: 0}
},
{
type: 'pan',
parameters: {panning: 64, stereo: 0}
},
{ type: 'outaux', parameters: {outgain: 110, auxgain: 18, stereo: 1}},
{type: "loadnote"},{ type: "envelope", parameters: {attack: 0, gain: 128, stereo: 0, decay: 80, sustain: 0, release: 80}},{type: "mulp"},{ type: "sync", parameters: {}},{ type: "pop", parameters: {}}
]
};
addInstrument('kick', {type: 'number', sointu: sointukick});
addInstrument('hihat', {type: 'number', sointu: {
/*GO4K_ENV ATTAC(0),DECAY(64),SUSTAIN(15),RELEASE(32),GAIN(100)
GO4K_VCO
TRANSPOSE(64),DETUNE(64),PHASE(64),GATES(85),COLOR(64),SHAPE(64),GAIN(128),FLAGS(NOISE)
GO4K_FOP OP(FOP_MULP)
GO4K_VCF FREQUENCY(128),RESONANCE(128),VCFTYPE(BANDPASS)
GO4K_FOP OP(FOP_LOADNOTE)
GO4K_FOP OP(FOP_MULP)
GO4K_PAN PANNING(56)
GO4K_OUT GAIN(44), AUXSEND(0)*/
"numvoices": 1,
"units": [
{ type: "envelope", parameters: { attack: 0, decay: 64,gain: 76,release: 32, stereo: 0,sustain: 15 } },
{ type: "noise", parameters: { gain: 128, shape: 64, stereo: 00 } },
{ type: 'mulp', parameters: {stereo: 0}},
{ type: 'filter', parameters: {bandpass: 1, frequency: 128, highpass:
0, lowpass: 0, negbandpass: 0, neghighpass: 0, resonance: 128, stereo:
0}},
{ type: 'loadnote', parameters: {stereo: 0}},
{ type: 'mulp', parameters: {stereo: 0}},
{ type: 'pan', parameters: {panning: 64, stereo: 0} },
{ type: 'outaux', parameters: {outgain: 100, auxgain: 100, stereo: 1}},
{type: "loadnote"},{ type: "envelope", parameters: {attack: 0, gain: 128, stereo: 0, decay: 80, sustain: 0, release: 80}},{type: "mulp"},{ type: "sync", parameters: {}},{ type: "pop", parameters: {}}
]
}});
const bass = {type: 'note', sointu: {
"numvoices": 1,
"units": [
{ type: "envelope", id: 'env', parameters: { attack: 32, decay: 76,gain: 55,release: 75, stereo: 0,sustain: 28 } },
{ type: 'oscillator', parameters: {color: 90, detune: 64, gain: 128, lfo: 0, phase: 32, shape: 96, stereo: 0, transpose: 76, type: 2, unison: 0}},
{ type: 'mulp', parameters: {stereo: 0}},
{ type: 'filter', parameters: {lowpass: 1, frequency: 20, resonance: 128}},
{ type: 'pan', parameters: {panning: 64, stereo: 0} },
{ type: 'outaux', parameters: {outgain: 100, auxgain: 10, stereo: 1}},
{type: "loadnote"},{ type: "envelope", parameters: {attack: 0, gain: 128, stereo: 0, decay: 80, sustain: 0, release: 80}},{type: "mulp"},{ type: "sync", parameters: {}},{ type: "pop", parameters: {}}
]
}
};
addInstrument('bass_1', bass);
addInstrument('bass_2', bass);
addInstrumentGroup('bass', ['bass_1','bass_2']);
const lead2 = {
"numvoices": 1,
"units": [
{ type: "envelope", id: 'env', parameters: { attack: 16, decay: 93,gain: 6,release: 90, stereo: 0,sustain: 100 } },
{ type: 'send', parameters: {amount: 126, port: 4, sendpop: 0, stereo: 0, target: 'env'}},
{ type: 'oscillator', parameters: {color: 115, detune: 60, gain: 4, lfo: 0, phase: 32, shape: 109, stereo: 0, transpose: 64, type: 1, unison: 3}},
{ type: 'mulp', parameters: { stereo: 0}},
{ type: "envelope", id: 'env2', parameters: { attack: 16, decay: 93,gain: 6,release: 90, stereo: 0,sustain: 100 } },
{ type: 'send', parameters: {amount: 126, port: 4, sendpop: 0, stereo: 0, target: 'env2'}},
{ type: 'oscillator', parameters: {color: 115, detune: 68, gain: 4, lfo: 0, phase: 96, shape: 110, stereo: 0, transpose: 64, type: 0, unison: 3}},
{ type: 'mulp', parameters: { stereo: 0}},
{ type: 'filter', parameters: {stereo: 1, lowpass: 1, frequency: 125, resonance: 50}},
{ type: 'filter', parameters: {stereo: 1, lowpass: 1, frequency: 86, resonance: 86}},
{type: 'push', parameters: {stereo: 1}},
{type: 'aux', parameters: {channel: 4, gain: 64, stereo: 1}},
{ type: 'pan', parameters: {panning: 64, stereo: 1} },
{type: 'outaux', parameters: {outgain: 32, auxgain: 128, stereo: 1}},
{type: "loadnote"},
{ type: "envelope", parameters: {attack: 0, gain: 128, stereo: 0, decay: 80, sustain: 0, release: 80}},
{type: "mulp"},
{ type: "sync", parameters: {}},
{ type: "pop", parameters: {}}
]
};
addInstrument('lead2', {type: 'note', sointu: lead2});
addInstrument('lead2_2', {type: 'note', sointu: lead2});
addInstrument('lead2_3', {type: 'note', sointu: lead2});
addInstrument('lead2_4', {type: 'note', sointu: lead2});
addInstrument('lead2_5', {type: 'note', sointu: lead2});
addInstrumentGroup('leads', ['lead2','lead2_2', 'lead2_3','lead2_4','lead2_5']);
addInstrument('snare', {type: 'number', sointu: {
"numvoices": 1,
"units": [
{ type: "envelope", id: 'env', parameters: { attack: 0, decay: 73,gain: 117,release: 73, stereo: 0,sustain: 0 } },
{type: 'send', parameters: {amount: 128, port: 4, sendpop: 0, stereo: 0, target: 'env'}},
{ type: "noise", parameters: { gain: 128, shape: 64, stereo: 0 } },
{ type: 'mulp', parameters: {stereo: 0}},
{ type: 'filter', parameters: {bandpass: 1, frequency: 15, highpass: 0, lowpass: 0, negbandpass: 0, neghighpass: 0, resonance: 100, stereo: 0}},
{ type: "envelope", parameters: { attack: 0, decay: 63,gain: 120,release: 32, stereo: 0,sustain: 0 } },
{ type: "noise", parameters: { gain: 128, shape: 64, stereo: 0 } },
{ type: 'mulp', parameters: {stereo: 0}},
{ type: 'filter', parameters: {bandpass: 1, frequency: 55, highpass: 0, lowpass: 0, negbandpass: 0, neghighpass: 0, resonance: 100, stereo: 0}},
{ type: "envelope", parameters: { attack: 0, decay: 54,gain: 60,release: 32, stereo: 0,sustain: 0 } },
{ type: "noise", parameters: { gain: 120, shape: 64, stereo: 0 } },
{ type: 'mulp', parameters: {stereo: 0}},
{ type: 'filter', parameters: {bandpass: 1, frequency: 95, highpass: 0, lowpass: 0, negbandpass: 0, neghighpass: 0, resonance: 100, stereo: 0}},
{ type: 'addp', parameters: {stereo: 0}},
{ type: 'addp', parameters: {stereo: 0}},
{ type: 'loadnote', parameters: {stereo: 0}},
{ type: 'mulp', parameters: {stereo: 0}},
{ type: 'pan', parameters: {panning: 64, stereo: 0} },
{ type: "outaux", parameters: { outgain: 80, auxgain: 40, stereo: 1 } },
{type: "loadnote"},{ type: "envelope", parameters: {attack: 0, gain: 128, stereo: 0, decay: 80, sustain: 0, release: 80}},{type: "mulp"},{ type: "sync", parameters: {}},{ type: "pop", parameters: {}}
]}});
const warmpad = (pan) => ({
"numvoices": 1,
"units": [
{ type: "envelope", parameters: { attack: 64, decay: 40,gain: 36,release: 70, stereo: 0,sustain: 80 } },
{ type: 'push'},
{ type: 'oscillator', parameters: {color: 120, detune: 58, gain: 33, lfo: 0, phase: 64, shape: 20, stereo: 1, transpose: 64, type: 0, unison: 3}},
{ type: 'mulp', parameters: {stereo: 1}},
{ type: 'filter', id: 'filter', parameters: {lowpass: 1, frequency: 40, resonance: 64, stereo: 1}},
{ type: 'pan', parameters: {panning: pan, stereo: 1} },
{ type: 'push', parameters: {stereo: 1}},
{ type: 'aux', parameters: {channel: 4, gain: 120, stereo: 1}},
{ type: 'outaux', parameters: {outgain: 110, auxgain: 50, stereo: 1}},
{type: "loadnote"},{ type: "envelope", parameters: {attack: 0, gain: 128, stereo: 0, decay: 80, sustain: 0, release: 80}},{type: "mulp"},{ type: "sync", parameters: {}},{ type: "pop", parameters: {}}
]
});
addInstrument('warmpad', {type: 'note', sointu: warmpad(50)});
addInstrument('warmpad_2', {type: 'note', sointu: warmpad(70)});
addInstrument('warmpad_3', {type: 'note', sointu: warmpad(40)});
addInstrument('warmpad_4', {type: 'note', sointu: warmpad(80)});
addInstrument('warmpad_5', {type: 'note', sointu: warmpad(30)});
addInstrument('warmpad_6', {type: 'note', sointu: warmpad(90)});
addInstrumentGroup('warmpads', ['warmpad','warmpad_2', 'warmpad_3', 'warmpad_4', 'warmpad_5', 'warmpad_6']);
addInstrument('Global', {type: 'number', sointu: {
"numvoices": 1,
"units": [
{type: 'in', parameters: {channel: 2, stereo: 1}},
{ type: 'delay',
parameters: {damp: 64, dry: 128, feedback: 125, notetracking: 0, pregain: 30, stereo: 0},
varargs: [1116, 1188, 1276, 1356, 1422, 1492, 1556, 1618]
},
{
type: 'outaux', parameters: {auxgain: 0, outgain: 128, stereo: 1}
},
{type: 'in', parameters: {channel: 4, stereo: 1}},
{ type: 'delay',
parameters: {damp: 64, dry: 64, feedback: 64, notetracking: 0, pregain: 53, stereo: 0},
varargs: [16537, 16537]
},
{
type: 'outaux', parameters: {auxgain: 0, outgain: 128, stereo: 1}
},
{type: 'in', parameters: {channel: 0, stereo: 1}},
{type: 'push', parameters: {channel: 0, stereo: 1}},
{type: 'filter', parameters: {bandpass: 0, frequency: 38, highpass: 1, lowpass: 0, negbandpass: 0, neghighpass: 0, resonance: 128, stereo: 1}},
{type: 'compressor', parameters: {attack: 16, invgain: 105, ratio: 10, release: 54, stereo: 1, threshold: 70}},
{type: 'mulp',parameters: {stereo: 1}},
{type: 'xch',parameters: {stereo: 1}},
{type: 'filter', parameters: {bandpass: 0, frequency: 12, highpass: 1, lowpass: 0, negbandpass: 0, neghighpass: 0, resonance: 90, stereo: 1}},
//{type: 'compressor', parameters: {attack: 16, invgain: 80, ratio: 50, release: 64, stereo: 1, threshold: 55}},
{type: 'compressor', parameters: {attack: 8, invgain: 64, ratio: 15, release: 48, stereo: 1, threshold: 10}},
{type: 'mulp', parameters: {stereo: 1}},
{type: 'addp',parameters: {stereo: 1}},
{
type: 'outaux', parameters: {auxgain: 0, outgain: 128, stereo: 1}
}
]
}});
playPatterns({
kick: pp(4, [
70,0,0,0,
70,0,0,0,
70,0,0,0,
70,0,0,0,
70,0,0,0,
70,0,0,0,
70,0,0,0,
70,0,0,0
]),
"bass": pp(4, [e2(1/2),,e2(1/2),,
,,e2(1/2),,
[,c3],,c3(1/2),,
,,c3(1/2),,
g2,,g2(1/2),,
,,g2(1/2),,
,,g2(1/2),,
[,b2(1/2)],,d3,], 2),
"leads": pp(4, [g6(1/2),,[,fs6(1/2)],,
g6(1/2),,e6(1/2),,
g6(1/2),,fs6(1/2),,
[,g6(1/2)],,e6(1/2),,
g6(1/2),,fs6(1/2),,
g6(1/2),,d6(1/2),,
g6(1/2),,fs6(1/2),,
g6(1/2),,b6,], 5),
"warmpads": pp(4, [[g5(7/4),e5(7/4)],,,,
,,,,
[e5(3/2),c6(3/2)],,,,
,,[d5(6/2),b5(6/2)],], 6),
},1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment