/**
This script exemplifies the use of SuperCollider on Bela.
When a project contains a _main.scd
file, sclang
is started
and the content of the file is executed.
If you want to interact with SuperCollider running on the board
from within the SuperCollider IDE on your computer, check out
the 12-SuperCollider/remote examples instead.
Those files also include more code examples to interface with
Bela-specific UGens.
*/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// live audio input | |
( | |
SynthDef(\anintest, { |out, sustain = 1, speed = 1, begin = 0, end = 1, pan, accelerate, amp = 1, offset| | |
var env, sound, rate, phase; | |
phase = Line.ar(begin, end, sustain); | |
rate = (begin + 1) * (speed + Sweep.kr(1, accelerate)); | |
sound = SinOsc.ar( AnalogIn.ar( 0 ).poll.exprange( 200, 5000 ), 0, 0.1 ); | |
OffsetOut.ar(out, | |
DirtPan.ar(sound, ~dirt.numChannels, pan, amp) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- | |
Importing MIDI to TidalCycles | |
Beethoven 7th Symphony II Allegretto | |
Time signature: 2/4 | |
Key: C Major |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while read p; do | |
f="${p//font-/}*" | |
f="${f//-}" | |
# echo "$f" | |
if [[ -z `find /Users/xxx/Library/Fonts -iname "$f"` ]]; then | |
echo "not found: $f" | |
brew cask install "$p" | |
else | |
echo "found: $f" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do | |
let key = "[0 2 4]/6" | |
mScale = Sc.chromatic | |
melody = "[[7 4 5](5,8)]*2" | |
harmony = "0" | |
tonic = "[0(3,8) [<[-7*2 -5*2] [3*2 5*2]>]]" | |
bScale = mScale | |
bass = tonic | |
d1 $ slow 2 | |
$ (|+| n key) $ stack [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Sound.Tidal.SpectralTricks -- https://github.com/datamads/SpectralTricks | |
import Sound.Tidal.Scales as Sc | |
import Sound.Tidal.Chords as Ch | |
let (accel,_) = pF "accel" (Just 0) | |
(bits,_) = pI "bits" (Just 0) | |
(carPartial,_) = pF "carPartial" (Just 0) | |
(detune,_) = pF "detune" (Just 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Init where | |
-- import Sound.Tidal.SpectralTricks | |
-- import qualified Sound.Tidal.Scales as Scales | |
-- import qualified Sound.Tidal.Chords as Chords | |
import Sound.Tidal.Utils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do -- suf | |
bps (140/120) | |
t1 (j 0) . m . sl 4 | |
-- . fE [3,4] (jux rev) . fE [2,5] (iter 4 . fa 3 . degBy 0.5) | |
-- . rarely ((> sustain "0.2") . fa 2 . degBy 0.9) | |
$ stack [ | |
n (fmap (+12) $ | |
-- almostNever (oa (3/8) 19) $ rarely (fmap (subtract 12)) $ | |
"[-4 0 3]*2 [-5 -2 3]*2 [-7 -4 0]*2 [[-7 -4 0] [-7 1 -4]]") > s "superpiano" | |
,n ("[-4, -16] [-9, -21] [-7, -19] [~ [-11, -23]]") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do -- bey | |
bps (83/120) | |
t1 (j 0) . m | |
$ stack [ | |
-- rarely (brak . fa 2) $ | |
s "[pcmbd:5 [~ pcmbd:5] ~ ~ ]" > end "0.3" > sp "0.9" > go "0.9:0" | |
,-- almostNever ((> sp "2") . fa 8 . (> pan rand)) . rarely (brak . fa 2) $ | |
s "[[~ pcmsn:17]*2]"-- [~ ~ ~ [~ pcsn:17*4?]]]" | |
> rvb "0.1:0.1" > go "1:2" | |
,--almostNever (str 8 . chop 4 . (> pan rand)) $ |
Suppose you are trying to program two Bela's at the same time (yes this was an actual need of mine).
You can achieve this using Bela's build_project.sh
script [1] and some tweaking.
First you need to change the IP address and DHCP settings of one of your Bela's [2], so that you can connect to your two devices separately and simultaneously.