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.

harmonics function

Featured Replies

Using this expression

(harmonics 'a2 8 :quantize nil :type :hertz)

I am getting

(110.0 220.0 329.62756 440.0 546.4174 659.2551 772.751 880.0)

but I am expecting

(110.0 220.0 330.0 440.0 550.0 660.0 770.0 880.0)

What am I understanding wrong?

Best, Achim

(setf harm (harmonics 'a2 8 :quantize 1/2 :type :hertz))
=> (110.0 220.0 329.62756 440.0 554.3653 659.2551 783.99085 880.0)

(hertz-to-pitch harm)
=> (a2 a3 e4 a4 cs5 e5 g5 a5)

(hertz-to-pitch '(110.0 220.0 330.0 440.0 550.0 660.0 770.0 880.0))
=> (a2 a3 e4 a4 c5.. e5 fs5.. a5)
  • Author

What is quantize NIL doing?

49 minutes ago, born said:

What is quantize NIL doing?

Nothing.

Jesper

  • Author

:quantize nil
(110.0 220.0 329.62756 440.0 546.4174 659.2551 772.751 880.0)

:quantize 1/2
(110.0 220.0 329.62756 440.0 554.3653 659.2551 783.99085 880.0)

not exactly the same numbers ...
question remains.

Your first example doesn't quantize, and your second example quantizes to the closest semitone, I guess.

Sorry, didn't read carefully enough in my deleted answer.

Jesper

  • Author

Sorry to insist in this, but my first example is somehow quantizing because the result should be
(110.0 220.0 330.0 440.0 550.0 660.0 770.0 880.0)

when calculating a harmonic scale in frequencies and not
(110.0 220.0 329.62756 440.0 546.4174 659.2551 772.751 880.0)

Achim

Only Janusz knows.

Could it be that the default is a tempered scale?

(harmonics 'a2 8 :quantize nil :type :hertz)

=>(110.0 220.0 329.62756 440.0 546.4174 659.2551 772.751 880.0)

(* 220 (expt 2 7/12)) ;;tempered fifth

=>329.62756

Jesper

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.