Jump to content

# Search the Community

Showing results for tags 'code'.

• ### Search By Tags

Type tags separated by commas.

### Forums

• Welcome to Opusmodus
• Announcements
• Pre Sales Questions
• Support Forum
• Support & Troubleshooting
• OMN Lingo
• Function Examples
• Score and Notation
• Live Coding Instrument
• Library Setup
• MIDI Setup
• Question & Answer
• Suggestions & Ideas
• Zoom into Opusmodus
• Sharing
• Made In Opusmodus
• User Extensions Source Code

### Calendars

• Community Calendar

• Software

### Categories

• OMN The Language
• Tutorial Guide
• CLM Examples

### Categories

• Getting Started
• HowTo
• Live Coding
• Music Theory and Analysis
• How-to in 100 sec
• Presentation
• Convention

• Members

• 0 Comments

• 0 Replies

• 0 Reviews

• 0 Views

Found 30 results

1. ## code Infinity-series applied to scales/modes

Hello All As I continue my fascination with the fractal structures contained in Per Norgard's infinity series, I am wondering whether it might be possible to apply the infinity to particular scales or modes? Say I want to generate an infinity-series based on a pre-existing scales/modes (like in G major) or by any self-defined mode such as (make-scale 'c2 49 :alt '(1 2 1 1)) Any help much appreciated as always. Kind regards Brian
2. ## code quasi-unsiono(-rnd-walk) by modifying proportions

;;; ----------------------------------------------------------------------------------------------- ;;; A QUASI-UNISONO by proportional length-differences ;;; SAME PITCHES IN ALL VOICES INCLUDING START/END-PITCH ;;; ----------------------------------------------------------------------------------------------- ;;; a random-pitch-seq (rnd-walk) ;;; ;;; immediate-pitch-repetitions are building the rhythm ;;; ;;; with MODIFY-PROPORTIONS i'm generating "proportional variants" of this rhythm, in this example ;;; by 16 generations -> then i take the generations 1, 8, and 15 for each voice ;;; ;;; by "(filter-repeat 1 sequence)" i swallow the immediate-pitch-repetitions for correct ;;; of PITCH- and RHYTHM-phases ;;; ;;; ----------------------------------------------------------------------------------------------- ;;; FUNCTION (defun modify-proportions (n prop-list &key (style 'sharpen)) (let ((rest-pos (loop for i in prop-list for cnt = 0 then (incf cnt) when (< i 0) collect cnt)) (prop-list (abs! prop-list)) (liste)) (progn (setf liste (append (list prop-list) (loop repeat n when (or (= (length (find-above 1 prop-list)) 1) (= (length (find-unique prop-list)) 1)) collect prop-list else collect (setf prop-list (loop for i in prop-list for cnt = 0 then (incf cnt) collect (cond ((= cnt (position (find-closest 2 (find-above 1 prop-list)) prop-list)) (if (equal style 'sharpen) (1- i) (1+ i))) ((= cnt (position (find-max prop-list) prop-list)) (if (equal style 'sharpen) (1+ i) (1- i))) (t i))))))) (loop for i in liste collect (loop for k in i for cnt = 0 then (incf cnt) when (memberp cnt rest-pos) collect (* -1 k) else collect k))))) ;;; ----------------------------------------------------------------------------------------------- ;;; GENERATING SCORE (setf sequence (gen-walk 100 :step '(0 0 0 0 0 0 0 1 2) :start 'c5)) (setf rhy 1/32) ;;; ----------------------------------------------------------------------------------------------- (def-score quasi-unisono (:title "quasi-unisono" :key-signature 'atonal :time-signature '(4 4) :tempo 90) (instr1 :omn (make-omn :length (gen-length (nth 1 (modify-proportions 16 (count-repeat sequence) :style 'sharpen)) rhy) :pitch (filter-repeat 1 sequence)) :channel 1 :port 0 :sound 'gm) (instr2 :omn (make-omn :length (gen-length (nth 8 (modify-proportions 16 (count-repeat sequence) :style 'sharpen)) rhy) :pitch (filter-repeat 1 sequence)) :channel 2 :port 0 :sound 'gm) (instr3 :omn (make-omn :length (gen-length (nth 15 (modify-proportions 16 (count-repeat sequence) :style 'sharpen)) rhy) :pitch (filter-repeat 1 sequence)) :channel 3 :port 0 :sound 'gm)) there is no BUG when i work without "omn-to-time-signature", but is also not necessary!
3. ## code gen-sieves

have fun! andré ;;; TWO SIEVE-generators ;;; simple and multiple (the simple-function is part of multiple) ;;;;;;;;;;;;;;;;;;;;;;;;; (defun gen-sieve (ambitus.omn intervals) (midi-to-pitch (loop with ambitus.midi = (pitch-to-midi ambitus.omn) with interval.cnt = -1 for pitch = (first ambitus.midi) then (setq pitch (+ (nth interval.cnt intervals) pitch)) when (<= pitch (second ambitus.midi)) collect pitch into bag else return bag do (incf interval.cnt) when (= interval.cnt (length intervals)) do (setq interval.cnt 0)))) (gen-sieve '(c4 g7) '(2 1)) ;;;;;;;;;;;;;;;;;;;;;;;;; (defun gen-multiple-sieve (sieve-rules) ;sieve-rules => '((ambitus.omn intervals) (ambitus.omn intervals) (ambitus.omn intervals)) (midi-to-pitch (sort (remove-duplicates (loop for i in sieve-rules append (pitch-to-midi (gen-sieve (first i) (second i))))) #'<))) (gen-multiple-sieve '(((c4 g7) (2 1 12)) ((c1 g7) (3 5))))
4. ## code pick-sample-from-center

if you want to pick a sample from approx.center (depends on odd/even) of a list... (defun pick-sample-from-center (list span) (let ((center (if (evenp (length list)) (/ (length list) 2) (/ (1+ (length list)) 2))) (span (if (> span (length list)) (length list) (append span)))) (loop repeat span with startpoint = (if (evenp span) (- center (/ span 2)) (- center (/ (1+ span) 2))) for i = startpoint then (incf startpoint) collect (nth i list)))) ;;;EXAMPLES: (pick-sample-from-center '(1 2 3 4 5 4 3 2 1) 7) => (2 3 4 5 4 3 2) (pick-sample-from-center '(1 2 3 4 5 4 3 2 1) 3) => (4 5 4) (pick-sample-from-center '(1 2 3 4 5 4 3 2 1) 6) => (3 4 5 4 3 2) (pick-sample-from-center '(1 2 3 4 5 4 3 2 1) 20) ; (if (> span length) => input-list as output => (1 2 3 4 5 4 3 2 1)
5. ## code gen-pitch-line (from vector)

;;; ------------------------------------------------------------------------------ ;;; GEN-PITCH-LINE ;;; Pitch generation function based on noise vectors conversion with a large choice of ;;; types of noises, compress ratio for the vector, filtering repetitions and ambitus. (defun gen-pitch-line (nb-pitch &key (compress 1) (ambitus '(c4 c6)) seed filter-repeat (type :white)) (do-verbose ("gen-pitch-line") (rnd-seed seed) (labels ((white (nb-pitch &key (compress 1) (ambitus '(c4 c6)) seed filter-repeat type) (if filter-repeat (gen-trim nb-pitch (filter-repeat filter-repeat (vector-to-pitch ambitus (vector-smooth compress (gen-white-noise nb-pitch :seed seed :type type))))) (vector-to-pitch ambitus (vector-smooth compress (gen-white-noise nb-pitch :seed seed :type type))))) (pink (nb-pitch &key (compress 1) (ambitus '(c4 c6)) seed filter-repeat) (if filter-repeat (gen-trim nb-pitch (filter-repeat filter-repeat (vector-to-pitch ambitus (vector-smooth compress (gen-pink-noise nb-pitch :seed seed))))) (vector-to-pitch ambitus (vector-smooth compress (gen-pink-noise nb-pitch :seed seed))))) ) (cond ((equal type ':white) (white nb-pitch :compress compress :ambitus ambitus :filter-repeat filter-repeat :seed (seed) :type :normal)) ((equal type ':binary) (white nb-pitch :compress compress :ambitus ambitus :filter-repeat filter-repeat :seed (seed) :type :binary)) ((equal type ':cauchy) (white nb-pitch :compress compress :ambitus ambitus :filter-repeat filter-repeat :seed (seed) :type :cauchy)) ((equal type ':chi-square-2) (white nb-pitch :compress compress :ambitus ambitus :filter-repeat filter-repeat :seed (seed) :type :chi-square-2)) ((equal type ':double-exponential) (white nb-pitch :compress compress :ambitus ambitus :filter-repeat filter-repeat :seed (seed) :type :double-exponential)) ((equal type ':exponential) (white nb-pitch :compress compress :ambitus ambitus :filter-repeat filter-repeat :seed (seed) :type :exponential)) ((equal type ':extreme) (white nb-pitch :compress compress :ambitus ambitus :filter-repeat filter-repeat :seed (seed) :type :extreme)) ((equal type ':gaussian) (white nb-pitch :compress compress :ambitus ambitus :filter-repeat filter-repeat :seed (seed) :type :gaussian)) ((equal type ':logistic) (white nb-pitch :compress compress :ambitus ambitus :filter-repeat filter-repeat :seed (seed) :type :logistic)) ((equal type ':lognormal) (white nb-pitch :compress compress :ambitus ambitus :filter-repeat filter-repeat :seed (seed) :type :lognormal)) ((equal type ':triangular) (white nb-pitch :compress compress :ambitus ambitus :filter-repeat filter-repeat :seed (seed) :type :triangular)) ((equal type ':low-pass) (white nb-pitch :compress compress :ambitus ambitus :filter-repeat filter-repeat :seed (seed) :type :low-pass)) ((equal type ':high-pass) (white nb-pitch :compress compress :ambitus ambitus :filter-repeat filter-repeat :seed (seed) :type :high-pass)) ((equal type ':pink) (pink nb-pitch :compress compress :ambitus ambitus :filter-repeat filter-repeat :seed (seed))))))) #| USAGE (gen-pitch-line 24 :compress 0.42 :type :white :filter-repeat 1) (gen-pitch-line 24 :compress 0.42 :type :pink :filter-repeat 1) (gen-pitch-line 24 :compress 0.42 :type :extreme :filter-repeat 1) (gen-eval 8 '(make-omn :pitch (gen-pitch-line 24 :compress 0.42 :type :white :filter-repeat 1) :length (euclidean-rhythm 16 1 16 's :type 2) ) :seed 33) |# ;;; ------------------------------------------------------------------------------ SB.
×

• Lessons

• #### Downloads

• Buy
• Clubs
×
• Create New...