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.

figured-bass function

Featured Replies

I think it would be nice to have some figured bass functions. I started with these simplistic functions and I am wondering if anyone has thoughts on how to generalize them. I think it'll probably be best if eventually one would be able to simply input a list of bass notes and figures - something like (figured-bass '(c3 (5 3) d3 (4 3) e3 (6) '(c major)) and the function would return the figured bass realized. 

(defun five-three (degree root type) 
  (tonality-map `(,type :root ,root :map shift) 
              (chordize (pitch-transpose (- degree 1) (interval-to-pitch '(2 2))))))

(five-three 2 'd 'major) 
=> (e4g4b4)

(defun six-three (degree root type) 
  (tonality-map `(,type :root ,root :map shift) 
              (chordize (pitch-transpose (- degree 1) (interval-to-pitch '(2 3))))))

(six-three 3 'c 'minor)
=> (eb4g4c5)

(defun six-four (degree root type) 
  (tonality-map `(,type :root ,root :map shift) 
              (chordize (pitch-transpose (- degree 1) (interval-to-pitch '(3 2))))))

(six-four 5 'e 'minor)
=> (b4e5g5)

 

 

  • Author

Thanks, Stephane!

 

for some reason, the gen-chord3 examples provided with opusmodus don't seem to work. 

 

However, I think perhaps harmonic-progression could do the trick.

For example, the following creates a series of 6/5 chords  (harmonic-progression '(0 3 4 4) '(c major) :size '4 :step '((2 1 2)))

and here are some 4/3 chords - (harmonic-progression '(0 3 4 4) '(c major) :size '4 :step '((2 2 1)))

 

perhaps this is enough - although I do think it gets a bit cumbersome. If you have ideas on how to create a function that would streamline this process, I'd appreciate hearing them. I think something more similar to traditional figured bass notation format would be easier to work with (at least for me....)

 

Thanks!

Avner 

  • Author

So here's what I have so far.  Any suggestions would be welcome

 

;;;; a function that splits a list ;;;;

(defun split-list (lst)
  (if lst
      (if (cddr lst)
          (let ((l (split-list (cddr lst))))
            (list
             (cons (car lst) (car l))
             (cons (cadr lst) (cadr l))))
        `((,(car lst)) ,(cdr lst)))
    '(nil nil)))

 

;;; figured-bass function ;;;;

 

(defun figured-bass-progression (progression)
  (harmonic-progression 
   (car (split-list progression)) '(c major) :size (loop for i in (car (cdr (split-list progression))) collect (+ (length i) 1))
   :step (car (cdr (split-list progression)))))

 

 

;;;; test


(figured-bass-progression '(0 (2 2) 1 (2 2 1) 2 (2 3) 3 (2 1 2) 4 (2 2 2) 5 (2 3) 6 (2 3) 7 (2 2)))==>

(c4e4g4 d4f4g4b4 e4g4c5 f4a4c5d5 g4b4d5f5 a4c5f5 b4d5g5 c5e5g5)

 

 

My questions are: 

 

1. Why would (2 2 1) create a 4/3 chord? Why would (2 1 2) create a 6/5 chord? Shouldn't this be the other way around? 

 

2. Would it be possible to convert this to traditional terminology? So one could write '(f4 (6 5)) and get the chord '(f4a4c5d5)? Obviously, this is not crucial, but I am curious to learn how to program better in lisp.

 

Thanks!

Avner

 

 

 

 

 

  • Author

Thanks Stephane,

 

I must say that I don't quite understand gen-chord3 - every time I evaluate the expression (gen-chord3 '(c4 eb4 g4) '((6 5) (5 3) (4 2))) I get a different result. 

 

Also, what I was hoping to do was to convert traditional figured bass (i.e., use steps in the key) into chords. Perhaps there isn't an easy way to accomplish this in opusmodus right now. 

 

Either way, would you mind explaining why gen-chord3 evaluates to different pitches every time? 

 

Thanks!

Avner 

(gen-chord3 '(c4 eb4 g4) '((6 5) (5 3) (4 2)) :seed 42)

 

Without the :seed argument the result  should be random.

 

/Lasse

Thx for the link to music21.

I thought I had found most algo music thingies but this one i have missed completely.

/Lasse

  • Author

You're very welcome :-)

music21 has so much to offer - I just wish there was an easy way to convert its tools and objects into opusmodus functions.  I really enjoy the workflow of opusmodus and using lisp. Perhaps when opusmodus can read xml files directly into omn it would be easy to combine the two. 

 

All the best,

Avner 

critical thought about this:
I think in the near future this will work through "deep learning". So it is questionable how useful it is to formalize such manual and traditional "activities", such "complex rules systems" in CODE. this question generally arises in areas that focus on imitating and executing existing styles.

greetings

andré

 

...except that makes you a fun and makes you happy - and that is just as important!

added 10 minutes later

so the question will be what can be better, which will be more exciting than what deep learning (or traditional algorithms) can produce. very fast then - in my opinion - the production becomes quite simple and well done, but this has nothing to do with art (if you want) - it will be the "imitation of art", also algorithmic tools pushing you in this direction - is it "music" or the simulation of "music"?. but as VON FOERSTER said: "the map is the territory"... counteracting (radical-constructivistic) the phrase "the map is not the territory"...

 

 

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.