# Pitch set up or enter notes in hz

**URL:** <https://in-thread.sonic-pi.net/t/pitch-set-up-or-enter-notes-in-hz/7309>\
**Category:** Support, Help & Resources\
**Created:** [December 2, 2022, 11:29am UTC](https://in-thread.sonic-pi.net/t/pitch-set-up-or-enter-notes-in-hz/7309 "2022-12-02T11:29:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kleepo](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/kleepo/32/1105_2.png) [@Kleepo](https://in-thread.sonic-pi.net/u/Kleepo)\
**Post date:** [December 2, 2022, 11:29am UTC](https://in-thread.sonic-pi.net/t/pitch-set-up-or-enter-notes-in-hz/7309/1 "2022-12-02T11:29:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![emlyn](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/emlyn/32/1460_2.png) [@emlyn](https://in-thread.sonic-pi.net/u/emlyn)\
**Post date:** [December 2, 2022, 12:08pm UTC](https://in-thread.sonic-pi.net/t/pitch-set-up-or-enter-notes-in-hz/7309/2 "2022-12-02T12:08:40Z")

</div>

You can play notes in Hz with the `hz_to_midi` fn:

```ruby
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:

```ruby
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:

```ruby
{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}

```

---

<div class="post-metadata">

**Author:** ![Kleepo](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/kleepo/32/1105_2.png) [@Kleepo](https://in-thread.sonic-pi.net/u/Kleepo)\
**Post date:** [December 2, 2022, 1:19pm UTC](https://in-thread.sonic-pi.net/t/pitch-set-up-or-enter-notes-in-hz/7309/3 "2022-12-02T13:19:07Z")

</div>

Thank you very much, I will try this…
