# How to change the pitch of the audioplayer output file in minim?

**URL:** https://discourse.processing.org/t/how-to-change-the-pitch-of-the-audioplayer-output-file-in-minim/29197
**Category:** Libraries
**Created:** [April 7, 2021, 4:58pm UTC](https://discourse.processing.org/t/how-to-change-the-pitch-of-the-audioplayer-output-file-in-minim/29197 "2021-04-07T16:58:27Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![yeppii](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/yeppii/32/12180_2.png) [@yeppii](https://discourse.processing.org/u/yeppii)
#### Post date: [April 7, 2021, 4:58pm UTC](https://discourse.processing.org/t/how-to-change-the-pitch-of-the-audioplayer-output-file-in-minim/29197/1 "2021-04-07T16:58:27Z")

</div>

I’m making a piano-like app, and I have a sound file. I want it to play at different pitches every time I press a key. I cant figure out how to change the pitch. How can I do this?

---

<div class="post-metadata">

### Author: ![micuat](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micuat/32/19407_2.png) [@micuat](https://discourse.processing.org/u/micuat)
#### Post date: [April 7, 2021, 7:15pm UTC](https://discourse.processing.org/t/how-to-change-the-pitch-of-the-audioplayer-output-file-in-minim/29197/2 "2021-04-07T19:15:31Z")

</div>

it seems like you can change the playback speed, which will change pitch by simply playing faster or slower (so the duration will change too)

> **[Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/25895/minim-how-do-i-pitch-shift-a-sample)**
>
> Processing is an electronic sketchbook, a language and a worldwide community. This is its forum.

note that (if I understand correctly) minim does not do audio processing. If you want to keep the playback duration, you need a technique called pitch shifting, which is not just playing faster or slower but some processing is involved, and minim doesn’t do it. If you want to go further in this direction I recommend looking into puredata / cycling max / supercollider and connect these tools to processing using OSC.
