Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| with-superdirt [2022/03/14 00:03] – created renick | with-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:// | ||
| + | |||
| + | The link below will explain what SuperDirt is but following the installation instructions in the link is **NOT** recommended. | ||
| + | |||
| + | [[https:// | ||
| + | ====== Install Super Dirt Samples ===== | ||
| + | One way is to run this inside supercollider: | ||
| < | < | ||
| - | .load ./ | + | Quarks.checkForUpdates({Quarks.install(" |
| - | .load ./ | + | </code> |
| - | .load ./konduktiva-superdirt-revised.js | + | |
| - | .load ./ | + | |
| - | // you need the scheduler | + | Check if it has been installed at: |
| + | < | ||
| + | /home/user/ | ||
| + | </ | ||
| + | WARNING: Change user to your username. | ||
| - | setupScheduler(e) | + | OR |
| - | e.startScheduler() | + | |
| - | // you change | + | If that did not work you will have to go to download |
| + | Unzip that and rename the unzipped directory as "// | ||
| + | then move it to: | ||
| + | < | ||
| + | / | ||
| + | </ | ||
| + | WARNING: Change user to your username. | ||
| - | e.changeTempo(80) | + | ====== Inform Konduktiva of Super Dirt Samples Location ===== |
| - | e.changeTempo(180) | + | |
| - | setupSuperDirtPlayer(e,' | + | Check if //e.superDirtPath// |
| - | simpleSamplePattern (e, ' | + | |
| - | simpleRhythmPattern (e, | + | Manually update superDirtSamplesPath variable: |
| + | < | ||
| + | e.superDirtPath = "/ | ||
| + | </ | ||
| + | WARNING: Change user to your username. | ||
| + | |||
| + | ====== Update startup.scd file ===== | ||
| + | Paste contents in ~/ | ||
| + | < | ||
| + | /* | ||
| + | This is an example startup file. You can load it from your startup file | ||
| + | (to be found in Platform.userAppSupportDir +/+ " | ||
| + | */ | ||
| + | |||
| + | |||
| + | ( | ||
| + | s.reboot { // server options are only updated on reboot | ||
| + | // configure the sound server: here you could add hardware specific options | ||
| + | // see http:// | ||
| + | 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" | ||
| + | s.options.numWireBufs = 64; // increase this if you get " | ||
| + | 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, | ||
| + | ~dirt.loadSoundFiles; | ||
| + | // for example: ~dirt.loadSoundFiles("/ | ||
| + | // s.sync; // optionally: wait for samples to be read | ||
| + | ~dirt.start(57120, | ||
| + | |||
| + | // optional, needed for convenient access from sclang: | ||
| + | ( | ||
| + | ~d1 = ~dirt.orbits[0]; | ||
| + | ~d4 = ~dirt.orbits[3]; | ||
| + | ~d7 = ~dirt.orbits[6]; | ||
| + | ~d10 = ~dirt.orbits[9]; | ||
| + | ); | ||
| + | }; | ||
| + | |||
| + | s.latency = 0.3; // increase this if you get " | ||
| + | }; | ||
| + | ); | ||
| + | </ | ||
| + | ====== 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,' | ||
| + | K.simpleSamplePattern (e, ' | ||
| + | K.simpleRhythmPattern (e, | ||
| { | { | ||
| voice: ' | voice: ' | ||
| Line 26: | Line 92: | ||
| patternLength: | patternLength: | ||
| IOIs: [1,1,1,1], | IOIs: [1,1,1,1], | ||
| - | bools: [true,true,true,true] | + | bools: [true,false,true,false] |
| } | } | ||
| ) | ) | ||
| - | + | e.players.kick.rhythmMap | |
| - | -------------------------------------------------------------------------- | + | e.players.kick.maskMap |
| - | + | ||
| - | testKick | + | |
| - | testKick | + | |
| - | testKick | + | |
| - | testKick.add(e) | + | |
| e.play(' | e.play(' | ||
| - | e.stop(' | + | </ |
| + | It should sound something like this: | ||
| + | {{ : | ||
| - | setupSuperDirtPlayer(e,' | + | Next to hear more sounds run this code: |
| - | simpleSamplePattern (e, ' | + | <code javascript> |
| - | testHat = new RhythmPattern ('hat',' | + | K.setupSuperDirtPlayer(e,' |
| - | testHat | + | K.simpleSamplePattern (e, ' |
| + | testHat = new K.RhythmPattern(' | ||
| testHat.add(e) | testHat.add(e) | ||
| + | e.players.hat.rhythmMap = ' | ||
| + | e.players.hat.maskMap = ' | ||
| e.play(' | e.play(' | ||
| + | </ | ||
| + | This sound should be added: | ||
| + | {{ : | ||
| - | setupSuperDirtPlayer(e,' | + | Run this to hear 2 more sounds: |
| - | simpleSamplePattern (e, ' | + | <code javascript> |
| - | testClap = new RhythmPattern ('clap',' | + | K.setupSuperDirtPlayer(e,' |
| - | testClap | + | K.simpleSamplePattern (e, ' |
| + | testClap = new K.RhythmPattern (' | ||
| testClap.add(e) | testClap.add(e) | ||
| + | e.players.clap.rhythmMap = ' | ||
| + | e.players.clap.maskMap = ' | ||
| e.play(' | e.play(' | ||
| - | setupSuperDirtPlayer(e,' | + | K.setupSuperDirtPlayer(e,' |
| - | simpleSamplePattern (e, ' | + | K.simpleSamplePattern (e, ' |
| - | testTom = new RhythmPattern ('tom',' | + | testTom = new K.RhythmPattern (' |
| - | testTom | + | |
| testTom.add(e) | testTom.add(e) | ||
| + | e.players.tom.rhythmMap = ' | ||
| + | e.players.tom.maskMap = ' | ||
| e.play(' | e.play(' | ||
| - | |||
| - | e.stopAll() | ||
| - | e.allPlayerStatus() | ||
| </ | </ | ||
| + | These two sounds should be added. | ||
| + | {{ : | ||
| + | {{ : | ||
| + | |||
| + | All four together shoulkd sound like this: | ||
| + | {{ : | ||