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

Are rewrite-lsystem and its friends based on L-Lisp by Knut Arild Erstad (Erstad, 2002; http://www.ii.uib.no/~knute/lsystems/llisp.html)

If not, they look and work surprisingly similar. For example, I can just use complex examples as the following from Erstad's documentation, and they work in OM.

 

;; Mycelis muralis (from ABoP, p. 87--90)
(defclass mycelis (l-system)
  ((axiom :initform '((I 20) Fa (A 0)))
   (ignore-list :initform '(+ /))
   (homomorphism-depth :initform 10)
   (frame-delay :initform 0.5)
   (frame-list :initform '((0 100)))
   (limits :initform '((-2 -1 -1) (2 14 1)))))

(defmethod l-productions ((ls mycelis))
  (choose-production ls
    ;; Growing apex
    ((A x)
     (with-lc (S) (--> (T 0)))
     (if (> x 0)
	 (--> (A (1- x)))
	 (--> [ (+ 30) Fb ] Fa (/ 180) (A 2))))
    ;; Stem segment: propagates signals
    (Fa
     (with-lc (S) (--> Fa S))
     (with-rc ((T c)) (--> (T (1+ c)) Fa)))
    ;; Undeveloped branch segment
    (Fb
     (with-lc ((T c) Fa) (--> (I (1- c)) Fa (A 3))))
    ;; Delayed signal
    ((I c)
     (if (zerop c)
	 (--> S)
	 (--> (I (1- c)))))
    ;; Signals disappers
    (S (--> nil))
    ((T c) (--> nil))
    ))


(rewrite-lsystem 'mycelis :depth 7)

 

If this is Erstad's code, then it would be appropriate to acknowledge this in the documentation etc., and helpful for users to point at the much more extensive documentation of the original software. There are very many more features of this generator that users cannot guess from the existing documentation.

 

Thanks!

 

Torsten

 

Erstad, K. A. (2002) L-systems, twining plants, Lisp. Master’s thesis thesis. University of Bergen. [online]. Available from: http://www.vcn.bc.ca/~griffink/lisp_lsystems.pdf (Accessed 21 December 2016).
  • 11 months later...

Dear Torsten/Janusz

 

Is there a way to see the Lisp Code underneath the existing functions

 of Opusmodus in order to learn ?

 

Best,

Julio

Dear Janusz,

 

I presume that under each function there is a code that is hidden for the sake of elegance and for practical reasons.

Actually, when using Opusmodus built-in functions we are working in a "pseudo-code".

For example, last week André Meier wrote the code below, for tweaking lenghts. This could be transformed

 in a OM built-inl function, in a way that we could not see the entire code, only the call of the function.

I'm asking where can I see the entire lisp code of the built in functions in order to learn to code my own

 functions, like André and Torsten.

Best,

Julio

 

 

André Meier Function "lenght-staccato"

 

(defun length-staccato (n alist)
  (let ((newlengths)
        (new-omn (omn-merge-ties (flatten  alist)))
        (time-sign (get-time-signature alist)))
    (progn 
      (setf newlengths (loop for i in (omn :length new-omn)
                         when (> i 0)
                         append (if (= n i)
                                  (list i)
                                  (list n (* -1 (abs (- i n)))))
                         
                         else collect i))
      (if (omn-formp alist)
        (omn-to-time-signature (make-omn :length newlengths
                                         :pitch (omn :pitch new-omn)
                                         :velocity (omn :velocity new-omn)
                                         :articulation (omn :articulation new-omn))
                               time-sign)
        newlengths))))


(length-staccato 1/16 '(q -q q q))
(length-staccato 1/16 '(q e4 mp q tasto q -q q q))
(length-staccato 1/16 '((e. c4 eb4 fs4 a4 tie) (s a4 e. cs4 e4 g4 e bb4 tie) (e bb4 e. d4 f4 gs4 s b4)))

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.