Skip 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.

New Pipeline Syntax - Take #1 (OM - Score Examples - Jazz - Blue Mount)

Featured Replies

Background:

OM version 4.0.31432, introduced the new alternative pipeline syntax (https://opusmodus.com/forums/topic/4014-using-arrows-package-in-om-threading-macros-pipeline-syntax/).

Benefits:

Depending on personal taste (tolerance for nesting) the new alternative pipeline syntax may

  • simplify coding during iterative development and

  • make longer code pipelines easier to read and comprehend.

Example:

Here is a first OM canonical example (taken from OM docs), contrasting standard LISP vs pipeline syntax.

See code for bass and section below.

Standard LISP Syntax:

;;;; START === Standard LISP Syntax ================
;;;;
;;;; Source: OM - Score Examples - Jazz - Blue Mount.opmo
;;;;
;;---------------------------------------------------------
;; Blue mount
;; Jazz style generator
;;---------------------------------------------------------

;; Library definition for Bassline motives 
(def-library JBass1
             (:section jb8tps
              jb0 (length-span '2/1 '(q. c2 mf q. c3 f q g2 mf e eb2 p
                                         f2 fs2 mp g2 eb2 f2 mf g2))
              jb1 (length-span '2/1 '(e c2 f - - q c2 e g1 mp a1 mf bb1 f))
              jb2 (length-span '2/1 '(q. c2 f g2 mf q c3 q. c2 f g2 mf q d3))))

;; Library definition for left hand piano motives
(def-library JPianoMg4th
             (:section jp8tps
              jp0 (length-span '2/1 '(-e q c3f3b3 - s d3g3c4 e3a3d4
                                         -e g3c4f4 -q f3b3e4 - -))
              
              jp1 (length-span '2/1 '(e d3g3c4 q g3c4f4
                                        -e e3a3d4 f3b3e4 -h))
              
              jp2 (length-span '2/1 '(-e q b3e4a4 a3d4g4 -q s e3a3d4
                                 f3b3e4 -e f3b3e4 -q))))

;; Library definition for drums patterns
;; (from midi to score Opusmodus option)
(def-library StudioTightKitPttn
             (:section stkp8tps
              stkp1 '(s c2fs2 -s fs2 - e2fs2 - fs2 f3
                        c2fs2gs2 - s fs2 - e2fs2 - c2fs2 -s)
              
              stkp2 '(s c2fs2 -s fs2 - e2fs2 - fs2 f3
                        c2fs2 a3 e2fs2 -s e2fs2 -s g3 d2)
              
              stkp3 '(s c2fs2cs3gs3 -e s d2 fs2 e2
                        f3gs3e3 -e -s fs2 -s fs2 - d2fs2 e2)
              
              stkp4 '(s c2fs2cs3gs3 -e s d2 fs2 -
                        fs2f3gs3 -e s a3 e2 - e2 - g3 d2)))

;; Modal harmonic path
(setf path (tonality-series 
            '(dorian dorian lydian dorian mixolydian aeolian)
            ;'(bebop-dominant)
            :root '(d4 d4 f4 d4 g3 a3) :map '(octave)))
            ;:root '(a3)))

;; Generation of bass line
(setf bass1 (library 'JBass1 'Jb8tps nil :random 8)) 

;; Transposition of bassline
(setf bass1.transp (pitch-transpose 12 bass1))

;; Map to harmonic path     
(setf bass1.omn (tonality-map path bass1.transp))

;; Motivic choice in library for lef hand and tonality mapping
(setf pianomg1.omn
      (tonality-map
       path (library 'JPianoMg4th 'jp8tps nil :random 8)))

;; Pitches for right hand melody improvisation
;; Vector for melodic contour for Right hand
(setf vector (vector-smooth 0.12 (gen-noise 1024)))

;; Map vector to pitch
(setf pianomd1.p (vector-to-pitch '(d3 d6) vector))

;; Length based on binary-change
(setf pianomd1.l
      (length-span
       (get-span bass1.omn)
       (binary-to-length (gen-binary-change pianomd1.p))))

;; OMN assembly for right hand and tonality mapping
(setf pianomd1.omn
       (tonality-map
        path
        (make-omn
         :pitch pianomd1.p
         :length pianomd1.l
         :velocity (pitch-to-velocity 'mp 'f pianomd1.p))))

;; Processing of the right hand, tie repeated pitches.
(setf pianomd1.omn.p (filter-tie pianomd1.omn))

(setf drums1.omn
      (gen-repeat 
       4 (append
          (library 'StudioTightKitPttn 'stkp8tps 'stkp1 :repeat 3)
          (library 'StudioTightKitPttn 'stkp8tps 'stkp4))))

(def-score BlueMount
    (:key-signature '(c maj)
     :time-signature '(4 4)
     :title "Blue mount"
     :tempo 132
     :composer "S.Boussuge"
     :copyright "Copyright © 2013 S.Boussuge"
     :layout (list
              (piano-layout 'pianomd 'pianomg)
              (bass-layout 'bass)
              (bass-layout 'drums)
              ))
  
  (pianomd
   :omn pianomd1.omn.p
   :channel 1 
   :sound 'gm
   :program 'Acoustic-Grand-Piano
   :pan 82)
(pianomg
   :omn pianomg1.omn
   )
(bass
   :omn bass1.omn 
   :channel 2 
   :sound 'gm
   :program 'Acoustic-Bass
   :pan 42)
  
  (drums
   :omn drums1.omn
   :channel 10
   :pan 64))
;;;; END === Standard LISP Syntax ================


Pipeline Syntax:

;;;; START === Pipeline Syntax ================
;;---------------------------------------------------------
;; Blue mount
;; Jazz style generator
;;---------------------------------------------------------

;; Library definition for Bassline motives 
(def-library JBass1
             (:section jb8tps
              jb0 (length-span '2/1 '(q. c2 mf q. c3 f q g2 mf e eb2 p
                                         f2 fs2 mp g2 eb2 f2 mf g2))
              jb1 (length-span '2/1 '(e c2 f - - q c2 e g1 mp a1 mf bb1 f))
              jb2 (length-span '2/1 '(q. c2 f g2 mf q c3 q. c2 f g2 mf q d3))))

;; Library definition for left hand piano motives
(def-library JPianoMg4th
             (:section jp8tps
              jp0 (length-span '2/1 '(-e q c3f3b3 - s d3g3c4 e3a3d4
                                         -e g3c4f4 -q f3b3e4 - -))
              
              jp1 (length-span '2/1 '(e d3g3c4 q g3c4f4
                                        -e e3a3d4 f3b3e4 -h))
              
              jp2 (length-span '2/1 '(-e q b3e4a4 a3d4g4 -q s e3a3d4
                                 f3b3e4 -e f3b3e4 -q))))

;; Library definition for drums patterns
;; (from midi to score Opusmodus option)
(def-library StudioTightKitPttn
             (:section stkp8tps
              stkp1 '(s c2fs2 -s fs2 - e2fs2 - fs2 f3
                        c2fs2gs2 - s fs2 - e2fs2 - c2fs2 -s)
              
              stkp2 '(s c2fs2 -s fs2 - e2fs2 - fs2 f3
                        c2fs2 a3 e2fs2 -s e2fs2 -s g3 d2)
              
              stkp3 '(s c2fs2cs3gs3 -e s d2 fs2 e2
                        f3gs3e3 -e -s fs2 -s fs2 - d2fs2 e2)
              
              stkp4 '(s c2fs2cs3gs3 -e s d2 fs2 -
                        fs2f3gs3 -e s a3 e2 - e2 - g3 d2)))

;; Modal harmonic path
(setf path (tonality-series 
            '(dorian dorian lydian dorian mixolydian aeolian)
            :root '(d4 d4 f4 d4 g3 a3) :map '(octave)))

;; Bass
(setf bass (-<>
            (library 'JBass1 'Jb8tps nil :random 8)
            (pitch-transpose 12 <>) ;; Transposition of bassline
            (tonality-map path <>) ;; Map to harmonic path     
            ))

;; Piano left hand
(setf piano-left-hand (-<>
                       (library 'JPianoMg4th 'jp8tps nil :random 8)
                       (tonality-map path <>)
                       ))

;; Piano right hand
(setf piano-right-pitch (-<>
                         (gen-noise 1024) ;; Vector for melodic contour
                         (vector-smooth 0.12 <>)
                         (vector-to-pitch '(d3 d6) <>) ;; Map vector to pitch
                         ))
(setf piano-right-length (-<>
                          (gen-binary-change piano-right-pitch) ;; Length based on binary-change
                          (binary-to-length <>)
                          (length-span (get-span bass) <>)
                          ))
(setf piano-right-hand (-<>
                        (make-omn :pitch piano-right-pitch ;; Assemble omn
                                  :length piano-right-length
                                  :velocity (pitch-to-velocity 'mp 'f piano-right-pitch))
                        (tonality-map path <>)
                        (filter-tie <>) ;; tie repeated pitches
                        ))

;; Drums
(setf drums (-<>
             (library 'StudioTightKitPttn 'stkp8tps 'stkp1 :repeat 3)
             (append <> (library 'StudioTightKitPttn 'stkp8tps 'stkp4))
             (gen-repeat 4 <>)
             ))

;; Score
(def-score BlueMount
    (:key-signature '(c maj)
     :time-signature '(4 4)
     :title "Blue mount (modified pipeline syntax)"
     :tempo 132
     :layout (list
              (piano-layout 'piano-right 'piano-left)
              (bass-layout 'bass)
              (bass-layout 'drums)
              ))
  
  (piano-right
   :omn piano-right-hand
   :channel 1 
   :sound 'gm
   :program 'Acoustic-Grand-Piano
   :pan 82)
  (piano-left
   :omn piano-left-hand
   )
  (bass
   :omn bass
   :channel 2 
   :sound 'gm
   :program 'Acoustic-Bass
   :pan 42)
  
  (drums
   :omn drums
   :channel 10
   :pan 64))
;;;; END === Pipeline Syntax ================
  • Cliff changed the title to New Pipeline Syntax - Take #1 (OM - Score Examples - Jazz - Blue Mount)

Create an account or sign in to comment


Copyright © 2014-2026 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

Account

Navigation

Search

Search

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.