All Projects → josephwilk → Mud

josephwilk / Mud

Licence: epl-1.0
MUD is a layer over Overtone to make live composition more powerful and immediate.

Programming Languages

clojure
4091 projects

Projects that are alternatives of or similar to Mud

Lissajous
🎵 A tool for programmatic audio performance in the browser using Javascript.
Stars: ✭ 367 (+532.76%)
Mutual labels:  music, performance
Punkt
Live coding music library/environment for Kotlin
Stars: ✭ 224 (+286.21%)
Mutual labels:  live-coding, music
Jarmlib
jarmlib is Jack Armitage's (mostly TidalCycles) live coding library
Stars: ✭ 42 (-27.59%)
Mutual labels:  live-coding, music
Awesome Live Coding Music
A curated list of awesome Live Coding Music frameworks, libraries and software.
Stars: ✭ 266 (+358.62%)
Mutual labels:  live-coding, music
Sonic Pi
Code. Music. Live.
Stars: ✭ 8,736 (+14962.07%)
Mutual labels:  live-coding, music
Ansible Role Memcached
Ansible Role - Memcached
Stars: ✭ 54 (-6.9%)
Mutual labels:  performance
Copona
A free shopping cart system, based on OpenCart (http://www.opencart.com). An ideal alternative to Opencart, rich to develop - easy to use! Read Wiki for improvements over Opencart.
Stars: ✭ 56 (-3.45%)
Mutual labels:  performance
Musictheory
🎵 Music theory concepts in Go.
Stars: ✭ 53 (-8.62%)
Mutual labels:  music
Profimp
Python import profiler
Stars: ✭ 52 (-10.34%)
Mutual labels:  performance
Vue Music Qq
A qq-music project is based on vue-cli. The pages are simple and smooth
Stars: ✭ 58 (+0%)
Mutual labels:  music
Sound Source Localization Algorithm doa estimation
关于语音信号声源定位DOA估计所用的一些传统算法
Stars: ✭ 58 (+0%)
Mutual labels:  music
Vue Aplayer
🍰 Easy-to-use music player for Vue 2.x
Stars: ✭ 1,087 (+1774.14%)
Mutual labels:  music
A Pop
🎶 HD Music Streaming and Sharing Web App
Stars: ✭ 55 (-5.17%)
Mutual labels:  music
Pc Optimization Hub
collection of various resources devoted to performance and input lag optimization
Stars: ✭ 55 (-5.17%)
Mutual labels:  performance
Express
A discord.js bot for music and moderation free and open source
Stars: ✭ 54 (-6.9%)
Mutual labels:  music
Kirby3 Autoid
Automatic unique ID for Pages, Files and Structures including performant helpers to retrieve them. Bonus: Tiny-URL.
Stars: ✭ 58 (+0%)
Mutual labels:  performance
React Spotify
Spotify React / Redux 🎤🎺🎸🎷
Stars: ✭ 1,064 (+1734.48%)
Mutual labels:  music
Staged Streams.scala
Stars: ✭ 55 (-5.17%)
Mutual labels:  performance
Yavipcore
Net Core Music Interface
Stars: ✭ 1,095 (+1787.93%)
Mutual labels:  music
Samples Module Loading Comparison
Some tests for comparing performance between bundling and unbundling JS
Stars: ✭ 54 (-6.9%)
Mutual labels:  performance

Musical Universes of Discourse

MUD painting

MUD is a layer over Overtone which focuses on immediacy of expression and creation.

Overtone is extremely powerful at the cost of verbosity. Live coding requires quite a lot of code. Snippet expansion can help alleviate but it does hinder the range of expression and clutters the visual experience for the audience reading along with the code.

Install

Add in your project.clj file:

[mud "0.1.2-SNAPSHOT"]

Usage

Timing

Everything you need to drive synths at beats

(use '[mud.core])
(require '[mud.timing :as time])

;;set the rate
(ctl time/root-s :rate 8.)

;;Set timing controls on a Synth

(defsynth seqer
"Plays a single channel audio buffer."
[buf 0 rate 1 out-bus 0 beat-num 0 pattern 0  num-steps 8 
 beat-bus (:count time/main-beat)     ;; Our beat count
 beat-trg-bus (:beat time/main-beat)  ;; Our beat trigger
 amp 0.7
 rate-start 0.1
 rate-limit 0.9]
(let [cnt      (in:kr beat-bus)
      rander (mod cnt 1)
      beat-trg (in:kr beat-trg-bus)
      bar-trg  (and (buf-rd:kr 1 pattern cnt)
                    (= beat-num (mod cnt num-steps))
                    beat-trg)
      vol      (set-reset-ff bar-trg)]
  (out out-bus (* vol amp (scaled-play-buf :num-channels 1 :buf-num buf :rate (t-rand:kr rate-start rate-limit rander) :trigger bar-trg)))))


(defonce kick-seq (buffer 256))
(doall (map #(seqer :beat-num %1 :pattern kick-seq :num-steps 8 :buf (freesound-sample 194114)) (range 0 8)))

(pattern! kick-seq [1 0 0 1 0 0 0]
                   [1 0 0 1 0 0 0]
                   [1 0 0 1 0 1 0])

Callback on beats

We can define callbacks in Clojure land firing on various beat events.

(defonce pulse-s (freesound-sample 194114))

;;Every 256 beat trigger sample
(on-beat-trigger 256 #(mono-player pulse-s))

;;Dividing beats into 32 parts play sample at 31st beat
(sample-trigger 31 32 #(mono-player pulse-s))

;;Or express as a list pattern with 1 => hit.
(sample-trigger [1 0 0 0 1 0 0 0] #(mono-player pulse-s))

;;Fire once on beat 0 dividing beats into 128 parts and then remove callback.
(one-time-beat-trigger 0 128 #(mono-player pulse-s))

;;Callbacks can take the current beat as an argument, useful for varying a sample:
(one-time-beat-trigger 0 128 (fn [beat] (mono-player pulse-s :rate (if (= 0 (mod beat 256)) 1.0 1.1))))

;;Remove all registered triggers
(remove-all-sample-triggers)
(remove-all-beat-triggers)

Chords

Use a single synth/inst def to play chords.

(use '[mud.core])
(use '[mud.chords])

(def singing-chord-g
  (chord-synth general-purpose-assembly 3 :amp 0.0 :noise-level 0.05 :beat-trg-bus (:beat time/beat-1th) :beat-bus (:count time/beat-1th) :attack 0.1 :release 0.1))

(:bufs   singing-chord-g) ;; Access all the bufs of a chord.
(:synths singing-chord-g) ;; Access all the running synths of a chord.

(chord-pattern! singing-chord-g [[:C3 :E3 :F3]])

(ctl (:synths singing-chord-group-g) :amp 0.2)

Fast composition of Chords and degrees

Make it easier to write a score, when switching of scales/chords

(degrees-seq [:f3 1614 :F2 11 :C3 11]) ;;Lowercase -> minor
                                       ;;Uppercase -> major

;;a first inversion, b second inversion, etc.
;; :sus4*2 is a shortcut for [:sus4 :sus4]
(chords-seq [:F3 1 :6b :1c 4 :sus4 :sus4*2])

;;Repeat a group of chords n times. Group is surronded by `[]`
;; Also pass a string rather than an array.
(chords-seq "F3 [1 6b 1c 4 sus4]*8 sus4*2")

Patterns

Writing patterns to buffers.

(use '[mud.core])

(defonce notes-buf (buffer 128))

;;Write a pattern immediately
(pattern! notes-buf (degrees [5 3 7] :minor :F3)) ;; Degrees
(pattern! notes-buf [:A5 :A3 :A7])                ;; Notes

;;Write a pattern on a beat one time (based on main-beat by default)
(one-time-beat-trigger 0 128 #(pattern! notes-buf (degrees [5 3 7] :minor :F3)))

;;Keep writing a pattern every nth beat.
(pattern-repeat! 8 notes-buf #(degrees (shuffle [5 3 7]) :minor :F3))

Euclidean distribution for beats (From 'The Euclidean Algorithm Generates Traditional Musical Rhythms' (Toussaint 2005)).

;;Spread 1 hit over 4
(spread 1 4)   ;;=> [1.0 0.0 0.0 0.0]

;; Spread 3 hit over 8
(spread 3, 8)  ;;=> [1.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0]

;;Spread 7 hit over 11
(spread 7, 11) ;;=> [1.0 0.0 1.0 0.0 1.0 1.0 0.0 1.0 1.0 0.0 1.0] 

;;Rotations to the next strong beat

;;Without rotation a spacing of 332
(spread 3 8)   ;;=> [1.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0) 
;;With rotation a single rotation spacing of 323
(spread 3 8 1) ;;=> [1.0 0.0 0.0 1.0 0.0 1.0 0.0 0.0]

(defonce drum-hits (buffer 128))
(pattern! drum-hits (spread 1 4))

Goals

  • Its centered around using Supercollider for timing rather than Java.
  • Buffers are the default way to express patterns.
  • Keep it Clojure, support Clojures fns to manipulate patterns.

Thanks

  • Elise Huard for the artwork

License

Copyright © 2014-present Joseph Wilk

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].