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.

bind-index suggestion

Featured Replies

I really appreciate the addition of bind-index in update v4.0.31506 https://opusmodus.com/forums/topic/4133-opusmodus-4031506-update/#comment-14316. This makes reading and comprehending code much easier. Great - thanks @opmo .

Question:

@opmo Can bind-index be modified, such that the arrows feature described below is mimicked?

This would make code even cleaner (at least in case of functions where x is in first argument position.


;; New syntax v4.0.31506
;; Example from https://opusmodus.com/forums/topic/4133-opusmodus-4031506-update/#comment-14316
(bind-index 'mat
  (gen-noise 8 :seed 42)
  (vector-smooth 0.3 x)
  (vector-to-pitch '(c3 c5) x)
  (pitch-transpose 12 x)
  (tonality-map '(major :map 'octave) x)
  (make-omn :pitch x
            :length '(h)
            :span :pitch))
; => (h g4 mf g4 f4 c4 a4 f5 a5 c6)

;; Compare with arrows
(-<>
 (gen-noise 8 :seed 42)
 (vector-smooth 0.3 <>)
 (vector-to-pitch '(c3 c5) <>)
 (pitch-transpose 12 <>)
 (tonality-map '(major :map 'octave) <>)
 (make-omn :pitch <>
           :length '(h)
           :span :pitch))
; => (h g4 mf g4 f4 c4 a4 f5 a5 c6)

;; Summary:
;; bind-index is functionally equivalent to original arrows-syntax :-)
;; except for the fact that bind-index is more powerful
;; as one can refer to an explicite intermediate pipeline result.


;;; ---------------------


;; But there's one feature which has yet not been 
;; carried over from arrows to bind-index
;;
;; arrows has a feature where former pipeline result
;; is implicitely added even if <> is not meantioned
;; this works for functions where <> has 1st argument position

(-<>
 (gen-noise 4 :seed 42)
 (gen-divide 2 <>)
 (flatten)) ;; no x here
; => (0.45572352 0.3392996 0.19626139 0.81495554)

(bind-index 'x-
 (gen-noise 4 :seed 42)
 (gen-divide 2 x)
 (flatten)) ;; no x here
; => throghs an error as x is missing

(bind-index 'x-
 (gen-noise 4 :seed 42)
 (gen-divide 2 x)
 (flatten x)) ;; x included and required currently
; => works
; => (0.45572352 0.3392996 0.19626139 0.81495554)

The bind-index construct is a simple variable assignment and does not attempt to alter standard Common Lisp function forms: (flatten).

I am planning to remove the Arrows library from OM. Users who wish to continue using it will need to install and load it separately through Quicklisp.

  • Author

Regading arrows removal: Understood, keeping external dependencies minimal is always a good idea.

At the end I am happy that OM has introduced some piping functionality.

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

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.