# A polymorphic transpose function?

**URL:** <https://uzu.lurk.org/t/a-polymorphic-transpose-function/2255>\
**Category:** TidalCycles\
**Tags:** questions\
**Created:** [6 October 2020 12:19 UTC](https://uzu.lurk.org/t/a-polymorphic-transpose-function/2255 "2020-10-06T12:19:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![crashingbooth](https://uzu.lurk.org/user_avatar/uzu.lurk.org/crashingbooth/32/1619_2.png) [@crashingbooth](https://uzu.lurk.org/u/crashingbooth)\
**Post date:** [6 October 2020 12:19 UTC](https://uzu.lurk.org/t/a-polymorphic-transpose-function/2255/1 "2020-10-06T12:19:16Z")

</div>

When I doing things with pitch in Tidal, about half the time I'm using pitched samples (like 'bass') and the other half using the synths. When I want transpose the former I use `(|+ up ...)` and for the latter `(|+ n ...)`. Often I'd like to drop my pitched lines into `stack` and transpose them in unison.

But `(|+ up ...)` will override any pitches for a synth, and `(|+ n ...)` will change the sample index not the pitch for a sample. So I often find myself making a mess whenever I try transpose lines en masse. It's a bit too much overhead to keep track of which lines are which and duplicate all the transposing code.

I'm wondering what the complexity is for having a polymorphic "transpose" function, since `sound` patterns encompass both types.

I'm sure others have been up against this too. Is this even possible? Or is this something to just put in as a feature request? If it seems more or less straightforward, could anyone give me hint of what this might look like

---

<div class="post-metadata">

**Author:** ![yaxu](https://uzu.lurk.org/user_avatar/uzu.lurk.org/yaxu/32/2_2.png) [@yaxu](https://uzu.lurk.org/u/yaxu)\
**Post date:** [6 October 2020 13:05 UTC](https://uzu.lurk.org/t/a-polymorphic-transpose-function/2255/2 "2020-10-06T13:05:11Z")

</div>

Hey @crashingbooth,  
These days `up` is an alias for `note`.  
As far as I know, `note` (and therefore `up`) will do what you want.. For a sample, it will transpose, for a synth, it will select a different note.

So to clarify, `n` and `note` do the same for synths (and I think midi). For samples, `n` will select a different sample and `note` will pitch it up/down in semitones.

So I think in your case if you just use `note` (or `up`) all the time it should work out fine.

---

<div class="post-metadata">

**Author:** ![crashingbooth](https://uzu.lurk.org/user_avatar/uzu.lurk.org/crashingbooth/32/1619_2.png) [@crashingbooth](https://uzu.lurk.org/u/crashingbooth)\
**Post date:** [6 October 2020 14:13 UTC](https://uzu.lurk.org/t/a-polymorphic-transpose-function/2255/3 "2020-10-06T14:13:27Z")

</div>

Ah okay. My hands type `n` automatically, so that will be hard habit to break, but using `up` with synths all the time totally solves my problem. Thanks!
