Today I started to work on a simple project that I hope becomes a routine almost every day. I delved into Patterns in SuperCollider again and hacked together a simple beat with 808 samples and with very little time left today added a very simple broken bassline/synth line.
Two important aspects of this little endeavor, for now: a) making *something* everyday, and b) making open source music – well libre open source code that generates music.
Making (composing) something everyday is an important practice for every artist. I’m not sure if this is gonna work for me, as I frequently start something and then abandon it, but nothing will change if one doesn’t try it. I want to play with something everyday, even if it’s a short melody line in Renoise or something new in SuperCollider, I just want to spend minimum half an hour on it. Not everything will probably be SuperCollider (although I have a fantasy to switch completely to SC and compose everything there, including heavy club tracks!), and there will be days when I’ll not manage.
So, today’s project is obviously a beginning. The full code is below, with a link to a zip with scd and samples, and also on Gitlab (https://gitlab.com/lukap/DailyBeats2018/tree/master/180805). Personally it feels that this was an important little refreshing lesson to remember how to use Patterns, what Pbind does and how to put patterns running in parallel together with Ppar.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
// Daily Beat #1 - 5. August 2018 // this code is (c) Luka Prinčič and licenced under conditions of // GNU GPL & Creative Commons BY-SA 4.0 licence ( // run this to load samples and SynthDefs /// postln(" ============================================== >>> Hello Daily Beats! "); Server.default.waitForBoot { // where are we? var dir = PathName(thisProcess.nowExecutingPath).pathOnly; // load samples ~sampleSmp = PathName(dir +/+ "smp/").files; ~sampleBfrList = List(); ~sampleBfr = List(); postln(" \n~~~ Freeing buffers ..." ); s.freeAllBuffers; // clean slate just in case postln("~~~ Loading samples ..." ); ~sampleSmp.do({ |item, i| postln(" " + i + "" + item.folderName +/+ item.fileName); ~sampleBfrList.add(item.fileName); // this is collection of filenames // actually load into Buffers ~sampleBfr.add(Buffer.readChannel(s, item.fullPath, channels:[0])); // [0] forces mono! }); SynthDef("smpPlayer", { |out = 0, bufnum = 0, amp = 0.5 | var sound; sound = PlayBuf.ar(1, bufnum, BufRateScale.kr(bufnum), doneAction: Done.freeSelf); Out.ar([0,1], sound * amp); postln("\n~~~ Loaded smpPlayer ..." ); }).add; // a quick hack, could be much improved SynthDef("bass", { |out, midi = 32 , amp = 0.9, nharms = 10, pan =0, gate = 1 | var audio = Blip.ar(midi.midicps, nharms, amp); var env = Linen.kr(gate, doneAction: Done.freeSelf); OffsetOut.ar(out, Pan2.ar(audio, pan, env)); }).add; }; ) ( // run this to start the patterns and sound TempoClock.default.tempo = 160/60; ~bass = Pbind(\instrument, \bass, \amp, 0.5, \nharms, Pseq([4, 5, 2], inf), \dur, Pseq([2, 1], 5), \midi, Pseq([32,Pshuf([32,44,47,23])], inf) ); // to make it a bit more 'semantic' - buffer numbers to variables ~bdB = 0; ~snB = 1; ~clB = 2; ~hhB = 3; ~ohB = 4; ~bd = Pbind(\instrument, \smpPlayer, \bufnum, ~bdB, \amp, 0.7, \dur, Pseq([3.4,0.6,4], 2) ); ~sn = Pbind(\instrument, \smpPlayer, \bufnum, ~snB, \amp, 0.7, \dur, Pseq([Rest(2),2], 4) ); ~hh = Pbind(\instrument, \smpPlayer, \bufnum, ~hhB, \amp, 0.8, \dur, Pseq([ Pseq([1.1/3,0.9/3], 6), Pseq([1/4],16), Pseq([1.1/3,0.9/3], 5), Pseq([1/6],4), Pseq([1/4],16) ]) ); ~oh = Pbind(\instrument, \smpPlayer, \bufnum, ~ohB, \amp, 0.5, \dur, Pseq([Rest(7),1], 2), ); ~cl = Pbind(\instrument, \smpPlayer, \bufnum, ~clB, \amp, 0.5, \dur, Pseq([Rest(4.5),3.5], 2), ); ~part1 = Ppar([~bd, ~sn, ~hh, ~oh, ~cl, ~bass], 8); ~part1.play; ) |
tar.gz with the code and samples: DailyBeats2018-master.tar.gz