Pitch set up or enter notes in hz

Hello,
I would like to know if there is a way to set the general pitch (I would like to be able to write in A432hz), or a way to enter the nos directly in hertz.
I have searched the documentation, and only found conversion tools.

Thank you for your help

Laurent

1 Like

You can play notes in Hz with the hz_to_midi fn:

play hz_to_midi(432)

If you want to adjust the tuning so that :a is 432 Hz, you can use the use_transpose fn:

play_pattern [:f, :g, :a]

use_transpose hz_to_midi(432) - hz_to_midi(440)

play_pattern [:f, :g, :a]

The first play_pattern uses standard A440Hz tuning, then after the use_transpose things will use A432Hz, as you can see in the output:

{run: 7, time: 0.0}
 └─ synth :beep, {note: 65.0, sustain: 1.0}
 
{run: 7, time: 0.9997}
 └─ synth :beep, {note: 67.0, sustain: 1.0}
 
{run: 7, time: 1.9997}
 └─ synth :beep, {note: 69.0, sustain: 1.0}
 
{run: 7, time: 2.9997}
 └─ synth :beep, {note: 64.6823, sustain: 1.0}
 
{run: 7, time: 3.9997}
 └─ synth :beep, {note: 66.6823, sustain: 1.0}
 
{run: 7, time: 4.9997}
 └─ synth :beep, {note: 68.6823, sustain: 1.0}
4 Likes

Thank you very much, I will try this…

1 Like