Jump to content
View in the app

A better way to browse. Learn more.

Opusmodus

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

When working with Opusmodus, it is very common to run many times a script containing some random process and you may want to keep and redo the last output for refine it or whatever.

It can be also good to save multiples output from a script with an index number attached to the output name.

In this post, i will show you how to achieve this two technics.


1.Seed record:


The first operation is to generate randomly a seed value and bind it to a variable:

(setf my-seed (rnd-range 1 10000))


Pass it to the init-seed function

(init-seed my-seed)

Now you can evaluate you score many times and when the output is ok for you, recall the last random seed by evaluating the seed variable name, the seed number will be showed in the listener. Just copy and past it as the value of init-seed function in place of "my-seed".

Here’s a small score example:

(setf my-seed (rnd-range 1 10000))
(init-seed my-seed)
(setf size 12)
(setf pitch (rnd-sample (rnd-number size 1 16) (list (make-scale 'a4 12 :alt '(2 1 2 3)))))
(setf len (gen-tuplet 1 1 'm '? 'w (mapcar 'length pitch)))
(setf phrase (make-omn
              :pitch pitch
              :length len
              ))
(def-score flute
           (
            :key-signature 'chromatic
            :time-signature '(4 4)
            :tempo 112
            :layout (flute-layout 'flt)
            )

(flt
 :omn phrase
 :channel 1
 :sound 'gm
 :program 'flute
 )
)


Now if you want to recall the last seed, you can evaluate my-seed and copy the result from the listener into the init-seed function:

(init-seed 37281)

.....


2. Indexing Midi files:

 

You can add a compile-score function at the end of your score script and give it some instructions regarding the output format AND a possible versioning system.

 

A small score example:

Evaluate this score several times and you will find in your midi folder each output indexed:
Flute2-001
Flute2-002
Flute2-003
....
 

(setf size2 12)
(setf pitch2 (rnd-sample (rnd-number size2 1 16) (list (make-scale 'a4 12 :alt '(2 1 2 3)))))
(setf len2 (gen-tuplet 1 1 'm '? 'w (mapcar 'length pitch2)))
(setf phrase2 (make-omn
              :pitch pitch2
              :length len2
              ))
(def-score flute2
           (
            :key-signature 'chromatic
            :time-signature '(4 4)
            :tempo 112
            :layout (flute-layout 'flt)
            )

(flt
 :omn phrase2
 :channel 1
 :sound 'gm
 :program 'flute
 )
)
(compile-score 'flute2 :output :midi :file "Flute2" :new-index t)

SB.

 

 

does "seed" works also on the basic LISP random-function? or on OM only?

thanx

  • 2 weeks later...

Create an account or sign in to comment


Copyright © 2014-2025 Opusmodus™ Ltd. All rights reserved.
Product features, specifications, system requirements and availability are subject to change without notice.
Opusmodus, the Opusmodus logo, and other Opusmodus trademarks are either registered trademarks or trademarks of Opusmodus Ltd.
All other trademarks contained herein are the property of their respective owners.

Powered by Invision Community

Important Information

Terms of Use Privacy Policy

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.