Jump to content
Sign in to follow this  
opmo

Opusmodus 1.2.23428

Recommended Posts

Opusmodus 1.2.23428


New:
vector-to-envelope
sum-to-size
snippet - Audition default parameters.

 

Function name change:

vector-shift -> vector-envelope2
 

L-System addition:
Allows functions inside a rule.
 

New keyword :seq in filter-repeat

 

 


sum-to-size

This function returns a list of numbers in a given size of equal numbers (plus/minus 1) which add up to a total.

 

Examples:

 

 

(sum-to-size 45 8)
=> (5 5 5 6 6 6 6 6)

 

(sum-to-size 25 7)
=> (3 3 3 4 4 4 4)
(sum-to-size 25 3)
=> (8 8 9)
(sum-to-size 25 11)
=> (2 2 2 2 2 2 2 2 3 3 3)
(sum-to-count 104 8)
=> (13 13 13 13 13 13 13 13)

 

 

 

 

Snippet

Audition default parameters:

 

(defparameter *audition-tempo* 120)
(defparameter *audition-length* 1/4)
(defparameter *audition-pitch* 'c4)
(defparameter *audition-velocity* 'mf)
(defparameter *audition-ignore-ports* t)
(defparameter *audition-sound* 'gm)
(defparameter *audition-channel* 1)
(defparameter *audition-program* 0)
(defparameter *audition-volume* 92)
(defparameter *audition-port* 0)

 

The default ‘Audition’ parameters will allow you to make changes to the ‘Preferences/Audition’ parameters without the need to open the window each time you make a change to port, channel, sound or program. Using the ‘Audition’ parameters as a part of the code will help you in your work flow. This possibility is useful for demonstrations and presentations.

 

Examples:

1.

 

(progn ;;; Cello
  (defparameter *audition-tempo* 72)
  (defparameter *audition-velocity* 'f)
  (defparameter *audition-sound* 'gm)
  (defparameter *audition-channel* 7)
  (defparameter *audition-program* 'cello)
  (defparameter *audition-volume* 100)
)

;(J. S. Bach, Sechs Suiten Sonaten fuer Violoncello solo, Suite I, Preludium, 1722)

'(((leg s g2 mf e3 b3 a3 b3 g3 fs3 g3)
   (leg e3 g3 dig2 fs3 g3 b2 > dig1 d3 > cs3 > b2 >))
  ((leg s cs3 p dig3 g3 dig2 a3 sul g3 dig2 a3 g3 a3 g3)
   (leg cs3 g3 a3 g3 a3 g3 a3 g3))
  ((leg s fs3 p< dig1 a3 < sul d4 < cs4 d4 mf a3 dig4 g3 a3 fs3)
   (leg a3 g3 a3 d3 > sul fs3 > dig3 e3 > d3 >))
  ((leg s e2 p dig1 b2 g3 fs3 g3 b2 g3 b2)
   (leg e2 b2 g3 fs3 g3 b2 g3 b2)))

 

 

2.

 

(progn ;;; Piano
  (defparameter *audition-tempo* 98)
  (defparameter *audition-velocity* 'f)
  (defparameter *audition-sound* 'gm)
  (defparameter *audition-channel* 1)
  (defparameter *audition-program* 'Acoustic-Grand-Piano)
  (defparameter *audition-volume* 100)
)

;(F. Chopin, Etudes, Op. 10, No. 5, 1833)

'((3e gb6 bb6 db6 gb6 eb6 gb6 db6 gb6 bb5 db6 gb5 bb5)
  (3e gb5 bb5 db5 gb5 eb5 gb5 db5 gb5 bb4 db5 gb4 bb4)
  (3e db4 db5 ab4 db5 ab4 ab5 ab4 ab5 eb5 ab5 eb5 eb6)
  (3e eb5 eb6 ab5 eb6 ab5 ab6 ab5 ab6 db6 ab6 db6 db7))

 

 

To send the snippet to a port you need to set the *audition-ignore-ports* to nil and set the *audition-port* to a number of your virtual instrument port:

 

3.

 

(progn ;;; Violin
  (defparameter *audition-tempo* 120)
  (defparameter *audition-velocity* 'mf)
  (defparameter *audition-ignore-ports* nil)
  (defparameter *audition-sound* 'vsl-violin)
  (defparameter *audition-channel* 1)
  (defparameter *audition-program* 0)
  (defparameter *audition-volume* 100)
  (defparameter *audition-port* 1)
  )

 

 

 

 

vector-to-envelope

This function applies ‘ambitus series’ derived from a envelope list into a list of floating-point numbers.

 

Lets examine first how envelope create the ambitus series (low high).

We interleave the envelope with a value 2 first and then we apply a sort function:

 

(setf envelope '(-5.1 -2.3 1.5 -0.8 4.6 10.6))

(sort-asc (gen-interleave 2 envelope))
=> ((-5.1 -2.3) (-2.3 1.5) (-0.8 1.5) (-0.8 4.6) (4.6 10.6))

 

From the envelope above the function creates five ambitus series each with two lists: start (low high) and end (low high).

 

Start        End

((-5.1 -2.3) (-2.3 1.5))

((-2.3 1.5)  (-0.8 1.5))

((-0.8 1.5)  (-0.8 2.1))

((-0.8 2.1)  (-0.8 4.6))

((-0.8 4.6)  (4.6 10.6))

 

Next, the values list (floating-point numbers) is divided by the count of the ambitus series. In our example the count is 5:

 

 

(sum-to-size 128 5)
=> (25 25 26 26 26)

 

 

The final process is to select randomly segment numbers for each of the 5 sublists:

 

With :type 1

 

(rnd-sum 25 '(2 3 5 7 11 13 17 19))
=> (7 3 2 2 11)

 

With :type 2 (length segments)

 

(rnd-sum-to-size 25 8 '(2 3 5 7 11 13 17 19))
=> (2 5 3 3 3 3 3 3)

 

With :type 3 (length segments) - with equal or plus/minus 1 equal numbers.

 

 

(sum-to-size 25 8)
=> (3 3 3 3 3 3 3 4)

 

 

Lets see the result:

 

(list-plot
 (vector-to-envelope '(-5.1 -2.3 1.5 -0.8 4.6 10.6) (gen-white-noise 128)))

 

Screen Shot 2018-06-11 at 16.00.52.png

 

A slightly different result we can achieve with optional :type 2:

 

(list-plot
 (vector-to-envelope '(-5.1 -2.3 1.5 -0.8 4.6 10.6) (gen-white-noise 128) :type 2))

 

Screen Shot 2018-06-11 at 16.01.06.png

 

Most equal distribution of segments is achieved with :type 3:

 

(list-plot
 (vector-to-envelope '(-5.1 -2.3 1.5 -0.8 4.6 10.6) (gen-white-noise 128) :type 3))

 

Screen Shot 2018-06-11 at 16.01.16.png

 

 

Examples:

 

 

(list-plot
 (vector-to-envelope
  (rnd 12 :low -10.0 :high 40.0)
  (gen-white-noise 356)
  :segment '(1 2 3 4 5)))

 

 

Screen Shot 2018-06-11 at 16.09.39.png

 

 

 

(list-plot
 (vector-to-envelope
  (rnd 6 :low -1.0 :high 4.0 :seed 45)
  (gen-white-noise 356)
  :segment '(1 2 3)
  :type 3))

 

 

Screen Shot 2018-06-11 at 16.07.26.png

 

 

 

(list-plot
 (vector-to-envelope
  (rnd 4 :low -1.0 :high 4.0 :seed 45)
  (gen-white-noise 356)
  :segment (primes 12)))

 

 

Screen Shot 2018-06-11 at 16.07.40.png

 

 

(setf env2 '(0.2 0.1 0.5 0.1 0.8 0.5 0.1 0.4 0.2 0.3))

(list-plot
 (vector-to-envelope
  (gen-tendency 4 env2)
  (gen-tendency 356 env2)
  :segment (primes 4)))

 

Screen Shot 2018-06-11 at 16.07.49.png

 

 

 

 

New keyword :seq in filter-repeat

 

(filter-repeat 1 '(a4 gs4 a4 gs4 a4 fs4 gs4 g5 bb5 g5 gs4) :seq 2)
=> (a4 gs4 a4 fs4 gs4 g5 bb5 g5 gs4)

(filter-repeat 1 '(gs4 fs3 a4 fs3 a4 bb5 a4 gs4) :seq 2)
=> (gs4 fs3 a4 bb5 a4 gs4)

(filter-repeat 1 '(gs4 fs3 a4 fs3 fs3 a4 fs3 a4 bb5 a4 gs4) :seq 3)
=> (gs4 fs3 a4 fs3 a4 bb5 a4 gs4)

 

 

 

 

L-System

Example with a function inside a rule:

 

(progn
  (defclass llen (l-system)
    ((axiom :initform '(s e))
     (depth :initform 2)))
  
  (defmethod l-productions ((ls llen))
    (choose-production
     ls
     (s (--> (rnd-pick '((s * e * s /) (s  e -s /))) q / s  e -s /))
     (e (--> s * s * s / q / s  e -s / (rnd-pick '(h -q s -e) :encode nil)))))
  )

 

(rewrite-lsystem 'llen :depth 2)
=> (s * e * s / q / s e -s / q / s e -s / s * s * s / q / s e -s / -q -s /
    s e -s / q / s e -s / * s e -s / q / s e -s / * s e -s / q / s e -s / /
    q / s e -s / q / s e -s / s * s * s / q / s e -s / -e -s / -e)

or

=> (s e -s / q / s e -s / s * s * s / q / s e -s / -q -s / q / s e -s /
    q / s e -s / s * s * s / q / s e -s / -e -s / s * e * s / q / s e
   -s / * s e -s / q / s e -s / * s e -s / q / s e -s / / q / s * e *
    s / q / s e -s / s * s * s / q / s e -s / h -s / h)

. . .

(length-lsystem 'llen :depth 2)
=> (s e -s e t e -s e t e -s t e = = t e -s - - t e -s e t e -s = e -s
    e t e -s = e -s e t e -s = t e -s e t e -s t e = = t e -s -e -s -e)

 

Best wishes,

Janusz

 


 

Share this post


Link to post
Share on other sites

Thank you for this update Janusz, the possibility to specify the snippets audition parameters directly into the code was very useful for me for designing and test instrument by instrument the orchestral template based on EastWest Hollywood orchestra and Plogue Bidule shared into the Template and customisation section.

 

no need to alway click and go to preferences

 

just write some preconfigured code and evaluate it depend on your need

 

Very convenient

 

SB.

 

Share this post


Link to post
Share on other sites

Concerning: snippet - Audition default parameters.

 

I assume the possible tempo values will be limited to the 'preset' choices as presented in actual 'audition' preference window? Or is it now possible through coding option to have any/all continuous possibilities for the audition tempo value?

 

Free choice of tempo would be very helpful for me, as I mainly work in 'Prime Number' bpm values ;-)

 

Thanks in advance

Share this post


Link to post
Share on other sites

Cool! Thanks Janusz ;-)

 

Really enjoying 'vector-to-envelope'.

 

Vey much appreciate the examples, very helpful to visualize function differences and possibilities 'at-a-glance' ;-)

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×