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.

Slonimsky Patterns

Featured Replies

Hi,

  • I’ve experimented with Opusmodus GPT and created this tool for my personal use. However, I thought it might be helpful for some of you, so I’m sharing it.

    GEN-SLONIMSKY-PATTERN

    Synopsis

    (gen-slonimsky-pattern octaves divisions
      &key
        interpolation infrapolation ultrapolation
        root direction
        dedupe dedupe-mode dedupe-tolerance
        limit-to-octave
        trim-with-gen-trim
        interpolation-permutation
        remove-consecutive-repeats
        transpose
        rotate)

    Description

    GEN-SLONIMSKY-PATTERN generates a Slonimsky-like procedural pitch pattern as an Opusmodus pitch list.

    Conceptually, the function builds a chain of “principal tones” across a span of octaves (converted to a total chromatic span), subdivided into divisions. For each principal tone, it can optionally insert:

    • an infrapolation pitch (below the principal tone),

    • one or more interpolation pitches (offsets around each principal tone),

    • an ultrapolation pitch (above the principal tone).

    After construction, the pattern can be octave-wrapped, de-duplicated (exactly or with a tolerance), trimmed to a target size, filtered for repeats, then optionally transposed and rotated.

    The function returns either one pitch list or a list of pitch-lists, depending on :interpolation-permutation.

    Parameters

    Required

    • octaves
      Number of octaves covered by the pattern. Internally, the chromatic span is (* 12 octaves).

    • divisions
      Number of divisions across the total span. The step size is computed as:

      • step = (/ (* 12 octaves) divisions)

      The principal-tone loop iterates i = 0 .. divisions (inclusive), so endpoints are included.

    Keyword options

    Pattern content

    • :interpolation (default: NIL)
      A list of numeric offsets (in MIDI units) inserted after each principal tone. Each k produces an inserted pitch at pt + (dir-sign * k).

    • :infrapolation (default: NIL)
      If non-NIL, inserts one pitch below each principal tone: pt - infrapolation (respecting direction sign as implemented).

    • :ultrapolation (default: NIL)
      If non-NIL, inserts one pitch above each principal tone: pt + (dir-sign * ultrapolation).

    • :root (default: 'c4)
      Root pitch (Opusmodus pitch symbol). Converted to MIDI via PITCH-TO-MIDI.

    • :direction (default: :up)
      Either :up or :down. Controls the sign of principal-tone stepping and of interpolation offsets.

    De-duplication

    • :dedupe (default: NIL)
      Enables de-duplication after optional octave-wrapping.

    • :dedupe-mode (default: :consecutive)

      • :consecutive removes only consecutive duplicates.

      • :all removes duplicates globally (first occurrence kept).

    • :dedupe-tolerance (default: 0)
      If 0, duplicates are detected by exact MIDI equality.
      If > 0, two MIDI values are considered equal if their absolute difference is <= dedupe-tolerance.

    Octave limiting

    • :limit-to-octave (default: NIL)

      • NIL: no wrapping

      • T: wraps every MIDI value into the octave [root, root+12) (relative to the MIDI value of root), then converts back to pitches.

    Trimming / sizing

    • :trim-with-gen-trim (default: NIL)
      If true, calls GEN-TRIM to force a computed target size. GEN-TRIM trims or extends a list to the requested length.

      The internal target size is computed as:

      target-size = divisions
                  + (length interpolation)
                  + (if infrapolation 1 0)
                  + (if ultrapolation 1 0)

      (Note: principal tones are generated with endpoints included, but the trimming target is computed as shown above.)

    Interpolation permutation

    • :interpolation-permutation (default: NIL)
      Controls only the ordering/selection of the :interpolation list; principal tones remain fixed.

      Supported values:

      • NIL → uses interpolation as given.

      • :all → generates all permutations of interpolation via PERMUTE and returns a list of pitch-lists (one per permutation).

      • :messiaen → applies MESSIAEN-PERMUTATION to the interpolation list. For length 2, the code forces :type :openby default. (MESSIAEN-PERMUTATION is documented with :type options such as :open / :closed.)

      • (:messiaen type) → uses MESSIAEN-PERMUTATION with an explicit :type.

      • (:nth n) → takes the nth permutation from (permute interpolation) and builds a single pattern.

    Repeat filtering

    • :remove-consecutive-repeats (default: NIL)
      If true, applies (filter-repeat 1 ...) to the trimmed pitch list. FILTER-REPEAT limits repetitions; with n = 1 it removes consecutive repeats.

    Post transforms (new)

    • :transpose (default: NIL)
      If non-NIL, applies (pitch-transpose transpose sequence) to the final pitch list.

    • :rotate (default: NIL)
      If non-NIL, applies (pitch-rotate rotate sequence) to the (optionally transposed) result. PITCH-ROTATE supports rotation-number as a number or list, and has keyword options such as :chord (default T).

    Return value

    • If :interpolation-permutation is :all → returns a list of pitch-lists (one per permutation variant).

    • Otherwise → returns a single pitch list.

    Pitch conversion uses MIDI-TO-PITCH for the final MIDI list back to pitch symbols.

    Examples

    ;; Basic example + consecutive de-dupe + target trimming
    (gen-slonimsky-pattern 1 2 :root 'c4 :direction :up
                           :interpolation '(1 6)
                           :dedupe t :dedupe-mode :consecutive
                           :trim-with-gen-trim t)
    ;; target-size = 2 + 2 = 4
    
    
    ;; With infra + ultra, trimmed to target size
    (gen-slonimsky-pattern 1 2 :root 'c4 :direction :up
                           :interpolation '(1 6)
                           :infrapolation 1
                           :ultrapolation 2
                           :trim-with-gen-trim t)
    ;; target-size = 2 + 2 + 1 + 1 = 6
    
    
    ;; Messiaen permutation of interpolations (principal tones unchanged)
    (gen-slonimsky-pattern 1 2
                           :root 'c4 :direction :up
                           :interpolation '(1 6)
                           :trim-with-gen-trim nil
                           :interpolation-permutation :messiaen)
    
    
    ;; Messiaen permutation + remove consecutive repeats
    (gen-slonimsky-pattern 1 2
                           :root 'c4 :direction :up
                           :interpolation '(1 6)
                           :trim-with-gen-trim nil
                           :interpolation-permutation :messiaen
                           :remove-consecutive-repeats t)
    
    
    ;; Transpose then rotate (melodic rotation)
    (gen-slonimsky-pattern 1 2
                           :root 'c4 :direction :up
                           :interpolation '(1 6)
                           :interpolation-permutation :messiaen
                           :remove-consecutive-repeats t
                           :transpose 2
                           :rotate 1)
    
    
    ;; Rotation with a longer interpolation set
    (gen-slonimsky-pattern 1 2
                           :root 'c4
                           :interpolation '(1 6 8)
                           :trim-with-gen-trim t
                           :rotate 2)
    
    
    ;; Random interpolation offsets + random rotation amount
    (gen-slonimsky-pattern 1 2
                           :root 'c4
                           :interpolation (rndn (rndn 1 2 5) 1 11)
                           :trim-with-gen-trim nil
                           :rotate (rndn 1 0 11))

    Related documented functions (used internally)

    • PITCH-TO-MIDI (list &key quantize remain)

    • MIDI-TO-PITCH (values &key quantize remain)

    • GEN-TRIM (n sequence ...) (trims/extends to length)

    • FILTER-REPEAT (repeat limiting / consecutive control)

    • PERMUTE (sequence) (all permutations)

    • MESSIAEN-PERMUTATION ... :type ... (permutation strategies, e.g., :open, :closed)

    • PITCH-ROTATE (rotation-number sequence &key chord section exclude ambitus)

gen-slonimsky-pattern.lisp

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.