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

Dear Friends

I´m working on sketches for a piano piece.

I declared some variable setf´s for manipulating pitches, rhythms, etc.

In the def score instance below, almost in the end of script, OM is evaluating

 a non-declared variable pat-pitches2. "pat-pithes2" or "pat-pitches" is not in any place of this

 script, altought I used this in other file. Can OM pick variables from other files ? 

 

Why OM is behaving like this ? Seems crazy.

 

Best,

Julio

 

:pitch (ambitus '(g1 g3)(chordize-list (gen-divide '(1 1 1 1 1 1 1 1) (pitch-transpose-n '(0 0 -12 0) pat-pitches2))))
;;; HOW OM IS EVALUATING the variable pat-pitches2 - IT is NOT declared in any place of this file !!!!
   :velocity velocity2

 

 

 

 

  • Author

Great ! Thanks you Janusz

 

Maybe a good idea would be some kind of FLUSH function that cleans the environment,

so we don't need to close and reopen the program ;)

 

Best,

Julio

This is how lisp works :smile:

Any variable you use in your score needs to be evaluated first.
 

simple test

(setf var '(1 2 3 4))
var
=> (1 2 3 4)

(setf var '(a b c d)
var
=> (a b c d)

 

Now the var result is (a b c d)

  • Author

Got It !

You must take caution with previous evaluations.

I was afraid it was a windows bug.

Solved now.

Thanks !

Julio

> Maybe a good idea would be some kind of FLUSH function that cleans the environment,

> so we don't need to close and reopen the program ;)

 

Setting (and overwriting!) "global variables" with setf results in side effects, which can be difficult to control. 

 

Because of that, experienced Lisp programmers use side effects like overwriting "global variables" only rarely and when really necessary, and instead work with constants and "local variables". 

 

For quick hacking or testing using setf is very convenient and should not be dismissed, but if you are looking for a way to avoid restarting to create a clean slate then use "local variables".

 

Best,

Torsten 

 

In Lisp parlance, these are dynamic and lexical variables, not quite the same thing as local and global variables in other languages, but perhaps these terms are more easy to understand :)

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.