with-superdirt

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
with-superdirt [2022/03/14 00:03] – created renickwith-superdirt [2024/06/06 07:24] (current) steve.wang
Line 1: Line 1:
 ====== Example of using Konduktiva with SuperDirt through Helper Functions ====== ====== Example of using Konduktiva with SuperDirt through Helper Functions ======
  
 +**Overview: ** This tutorial will teach you how to use SuperDirt with Konduktiva. Installation instructions for SuperDirt is also provided here.
 +
 +**Things To Note:** This tutorial assumes you have already installed Konduktiva successfully using the [[https://github.com/renickbell/konduktiva|Konduktiva installation]] instructions.
 +
 +The link below will explain what SuperDirt is but following the installation instructions in the link is **NOT** recommended.
 +
 +[[https://github.com/musikinformatik/SuperDirt|SuperDirt Explanation]]
 +====== Install Super Dirt Samples =====
 +One way is to run this inside supercollider:
 <code> <code>
-.load ./konduktiva-revised-2.js +Quarks.checkForUpdates({Quarks.install("SuperDirt", "v1.7.2"); thisProcess.recompile()}) 
-.load ./testingKonduktiva-revised.js +</code>
-.load ./konduktiva-superdirt-revised.js +
-.load ./defaultSuperDirtPlayers-revised.js+
  
-// you need the scheduler to make sure that the players all do their thing on time; this is what keeps everything going at some tempo+Check if it has been installed at: 
 +<code> 
 +/home/user/.local/share/SuperCollider/downloaded-quarks/Dirt-Samples/ 
 +</code> 
 +WARNING: Change user to your username.
  
-setupScheduler(e) +OR 
-e.startScheduler()+
  
-// you change the tempo like this+If that did not work you will have to go to download the zip from [[https://github.com/tidalcycles/Dirt-Samples|this github page]]. 
 +Unzip that and rename the unzipped directory as "//Dirt-Samples//" 
 +then move it to: 
 +<code> 
 +/home/user/.local/share/SuperCollider/downloaded-quarks/Dirt-Samples/ 
 +</code> 
 +WARNING: Change user to your username.
  
-e.changeTempo(80) +====== Inform Konduktiva of Super Dirt Samples Location =====
-e.changeTempo(180)+
  
-setupSuperDirtPlayer(e,'kick'+Check if //e.superDirtPath// is defined if it is not you will have have to manually define it with the step below. If it is defined move on to the **Update startup.scd file** part.
-simpleSamplePattern (e, 'kick', '808bd', 4)+
  
-simpleRhythmPattern (e, +Manually update superDirtSamplesPath variable: 
 +<code> 
 +e.superDirtPath = "/home/user/.local/share/SuperCollider/downloaded-quarks/Dirt-Samples/" 
 +</code> 
 +WARNING: Change user to your username. 
 + 
 +====== Update startup.scd file ===== 
 +Paste contents in ~/.config/SuperCollider/startup.scd  
 +<code> 
 +/* 
 +This is an example startup file. You can load it from your startup file 
 +(to be found in Platform.userAppSupportDir +/+ "startup.scd"
 +*/ 
 + 
 + 
 +
 +s.reboot { // server options are only updated on reboot 
 + // configure the sound server: here you could add hardware specific options 
 + // see http://doc.sccode.org/Classes/ServerOptions.html 
 + s.options.numBuffers = 1024 * 256; // increase this if you need to load more samples 
 + s.options.memSize = 8192 * 32; // increase this if you get "alloc failed" messages 
 + s.options.numWireBufs = 64; // increase this if you get "exceeded number of interconnect buffers" messages  
 + s.options.maxNodes = 1024 * 32; // increase this if you are getting drop outs and the message "too many nodes" 
 + s.options.numOutputBusChannels = 2; // set this to your hardware output channel size, if necessary 
 + s.options.numInputBusChannels = 2; // set this to your hardware output channel size, if necessary 
 + // boot the server and start SuperDirt 
 + s.waitForBoot { 
 + ~dirt = SuperDirt(2, s); // two output channels, increase if you want to pan across more channels 
 + ~dirt.loadSoundFiles;   // load samples (path containing a wildcard can be passed in) 
 + // for example: ~dirt.loadSoundFiles("/Users/myUserName/Dirt/samples/*"); 
 + // s.sync; // optionally: wait for samples to be read 
 + ~dirt.start(57120, 0 ! 12);   // start listening on port 57120, create two busses each sending audio to channel 0 
 + 
 + // optional, needed for convenient access from sclang: 
 +
 + ~d1 = ~dirt.orbits[0]; ~d2 = ~dirt.orbits[1]; ~d3 = ~dirt.orbits[2]; 
 + ~d4 = ~dirt.orbits[3]; ~d5 = ~dirt.orbits[4]; ~d6 = ~dirt.orbits[5]; 
 + ~d7 = ~dirt.orbits[6]; ~d8 = ~dirt.orbits[7]; ~d9 = ~dirt.orbits[8]; 
 + ~d10 = ~dirt.orbits[9]; ~d11 = ~dirt.orbits[10]; ~d12 = ~dirt.orbits[11]; 
 + ); 
 + }; 
 + 
 + s.latency = 0.3; // increase this if you get "late" messages 
 +}; 
 +); 
 +</code> 
 +====== Playing music With Supercollider ===== 
 + 
 +Open Supercollider and ensure you have Konduktiva loaded to K and any example MusicalEnvironment. Next run this code to hear some drumb noises: 
 +<code javascript> 
 +K.setupSuperDirtPlayer(e,'kick'
 +K.simpleSamplePattern (e, 'kick', '808bd', 4) 
 +K.simpleRhythmPattern (e,
     {     {
         voice: 'kick',         voice: 'kick',
Line 26: Line 92:
         patternLength: 4,         patternLength: 4,
         IOIs: [1,1,1,1],         IOIs: [1,1,1,1],
-        bools: [true,true,true,true]+        bools: [true,false,true,false]
     }     }
 ) )
- +e.players.kick.rhythmMap = 'testKick' 
--------------------------------------------------------------------------- +e.players.kick.maskMap = 'testKick'
- +
-testKick new RhythmPattern ('kick','testKick',4,[1,1,1,1],[true,true,true,true]) +
-testKick new RhythmPattern ('kick','testKick',4,[1,1,1,1],[true,false,true,false]) +
-testKick +
-testKick.add(e)+
 e.play('kick') e.play('kick')
-e.stop('kick')+</code> 
 +It should sound something like this: 
 +{{ :superdirt-supercollider-testkick-audio.mp3 |}}
  
-setupSuperDirtPlayer(e,'hat'+Next to hear more sounds run this code: 
-simpleSamplePattern (e, 'hat', 'electro1', 0) +<code javascript> 
-testHat = new RhythmPattern ('hat','testHat',4,[0.5,1,1,1,0.5],[false,true,true,true,true]) +K.setupSuperDirtPlayer(e,'hat'
-testHat+K.simpleSamplePattern (e, 'hat', 'electro1', 0) 
 +testHat = new K.RhythmPattern('hat',4,[0.5,1,1,1,0.5],[false,true,true,true,true])
 testHat.add(e) testHat.add(e)
 +e.players.hat.rhythmMap = 'straight'
 +e.players.hat.maskMap = 'hat'
 e.play('hat') e.play('hat')
 +</code>
 +This sound should be added:
 +{{ :superdirt-supercollider-testhat-audio.mp3 |}}
  
-setupSuperDirtPlayer(e,'clap'+Run this to hear 2 more sounds: 
-simpleSamplePattern (e, 'clap', 'drumtraks', 1) +<code javascript> 
-testClap = new RhythmPattern ('clap','testClap',4,[1,1,1,1],[false,true,false,true]) +K.setupSuperDirtPlayer(e,'clap'
-testClap +K.simpleSamplePattern (e, 'clap', 'drumtraks', 1) 
 +testClap = new K.RhythmPattern ('clap',4,[1,1,1,1],[false,true,false,true])
 testClap.add(e) testClap.add(e)
 +e.players.clap.rhythmMap = 'straight'
 +e.players.clap.maskMap = 'clap'
 e.play('clap') e.play('clap')
  
-setupSuperDirtPlayer(e,'tom'+K.setupSuperDirtPlayer(e,'tom'
-simpleSamplePattern (e, 'tom', 'made', 0) +K.simpleSamplePattern (e, 'tom', 'made', 0) 
-testTom = new RhythmPattern ('tom','testTom',4,[0.5,1,1,1,0.5],[true,false,true,false,true,true]) +testTom = new K.RhythmPattern ('tom',4,[0.5,1,1,1,0.5],[true,false,true,false,true,true])
-testTom +
 testTom.add(e) testTom.add(e)
 +e.players.tom.rhythmMap = 'straight'
 +e.players.tom.maskMap = 'tom'
 e.play('tom') e.play('tom')
- 
-e.stopAll() 
-e.allPlayerStatus() 
 </code> </code>
 +These two sounds should be added.
 +{{ :superdirt-supercollider-testclap-audio.mp3 |}}
 +{{ :superdirt-supercollider-testtom-audio.mp3 |}}
 +
 +All four together shoulkd sound like this:
 +{{ :superdirt-supercollider-together-audio.mp3 |}}
  • with-superdirt.1647241407.txt.gz
  • Last modified: 2022/03/14 00:03
  • by renick