# Shift a note pattern up an octave?

**URL:** <https://uzu.lurk.org/t/shift-a-note-pattern-up-an-octave/3764>\
**Category:** TidalCycles\
**Tags:** questions\
**Created:** [31 December 2021 20:20 UTC](https://uzu.lurk.org/t/shift-a-note-pattern-up-an-octave/3764 "2021-12-31T20:20:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ghost\_Chamb3r](https://uzu.lurk.org/user_avatar/uzu.lurk.org/ghost_chamb3r/32/1599_2.png) [@Ghost\_Chamb3r](https://uzu.lurk.org/u/Ghost_Chamb3r)\
**Post date:** [31 December 2021 20:20 UTC](https://uzu.lurk.org/t/shift-a-note-pattern-up-an-octave/3764/1 "2021-12-31T20:20:15Z")

</div>

Hi,  
So I've written a pattern of notes and let's say I want to quickly shift the entire pattern up or down an octave, how would I do that?

```haskell
    d7 $ slow 9 $ note " [[ds0,ds1,e2] ~ [ds0,ds1,as2] ~ ]*4 [[e0,e1,fs2] ~ [e0,e1,b2] ~ ]*4 [[fs0,fs1,fs2] ~ [fs0,fs1,b2] ~ ]*2 [[gs0,gs1,gs2] ~ [gs0,gs1,b2] ~ ]*2 [[ds0,ds1,e2] ~ [ds0,ds1,as2] ~ ]*4 [[e0,e1,fs2] ~ [e0,e1,b2] ~ ]*4 [[fs0,fs1,fs2] ~ [fs0,fs1,b2] ~ ] [[fs0,fs1,fs2] ~ [fs0,fs1,ds3] ~ ] [[gs0,gs1,gs2] ~ [gs0,gs1,ds3] ~ ]*2 [[ds0,ds1,gs2] ~ [ds0,ds1,ds3] ~ ]*4 [[e0,e1,fs2] ~ [e0,e1,b2] ~ ]*4 [[fs0,fs1,as2] ~ [fs0,fs1,b2] ~ ]*2 [[gs0,gs1,as2] ~ [gs0,gs1,b2] ~ ]*2" # s "Decepticon" # crush "< 16 14 10 >" # room 0.3 # orbit 3

```

Is there something I could add before the "$ note" command like "$ up 12" for 12 semitones or something like that?

---

<div class="post-metadata">

**Author:** ![wshbmusic](https://uzu.lurk.org/user_avatar/uzu.lurk.org/wshbmusic/32/1403_2.png) [@wshbmusic](https://uzu.lurk.org/u/wshbmusic)\
**Post date:** [31 December 2021 21:17 UTC](https://uzu.lurk.org/t/shift-a-note-pattern-up-an-octave/3764/2 "2021-12-31T21:17:13Z")

</div>

My favorite way to do this is by actually enclosing the note pattern in parenthesis and then adding 12 (or any note displacement amount) to the end of that pattern, like so...

```haskell
d7 
  $ slow 9
  $ note ("[[ds0,ds1,e2] ~ [ds0,ds1,as2] ~ ]*4 [[e0,e1,fs2] ~ [e0,e1,b2] ~ ]*4 [[fs0,fs1,fs2] ~ [fs0,fs1,b2] ~ ]*2 [[gs0,gs1,gs2] ~ [gs0,gs1,b2] ~ ]*2 [[ds0,ds1,e2] ~ [ds0,ds1,as2] ~ ]*4 [[e0,e1,fs2] ~ [e0,e1,b2] ~ ]*4 [[fs0,fs1,fs2] ~ [fs0,fs1,b2] ~ ] [[fs0,fs1,fs2] ~ [fs0,fs1,ds3] ~ ] [[gs0,gs1,gs2] ~ [gs0,gs1,ds3] ~ ]*2 [[ds0,ds1,gs2] ~ [ds0,ds1,ds3] ~ ]*4 [[e0,e1,fs2] ~ [e0,e1,b2] ~ ]*4 [[fs0,fs1,as2] ~ [fs0,fs1,b2] ~ ]*2 [[gs0,gs1,as2] ~ [gs0,gs1,b2] ~ ]*2"
          |+ 12) -- this is what you want to add to the code, as well as enclosing the pattern in parenthesis so that it is all passed as 1 input to note
    # s "Decepticon"
    # crush "< 16 14 10 >"
    # room 0.3
    # orbit 3

```

you can also pattern the note offset as well if you want.

---

<div class="post-metadata">

**Author:** ![Ghost\_Chamb3r](https://uzu.lurk.org/user_avatar/uzu.lurk.org/ghost_chamb3r/32/1599_2.png) [@Ghost\_Chamb3r](https://uzu.lurk.org/u/Ghost_Chamb3r)\
**Post date:** [31 December 2021 22:35 UTC](https://uzu.lurk.org/t/shift-a-note-pattern-up-an-octave/3764/3 "2021-12-31T22:35:50Z")

</div>

This is brilliant, thank you!

---

<div class="post-metadata">

**Author:** ![cleary](https://uzu.lurk.org/user_avatar/uzu.lurk.org/cleary/32/177_2.png) [@cleary](https://uzu.lurk.org/u/cleary)\
**Post date:** [1 January 2022 10:57 UTC](https://uzu.lurk.org/t/shift-a-note-pattern-up-an-octave/3764/4 "2022-01-01T10:57:41Z")

</div>

Also you can do:

```haskell
note pat
# s "arpy" 
|+ up 12

```

Which I think is synonymous with:

```haskell
note pat
# s "arpy" 
|+ note 12

```

Less flexible (and more characters to type) :

```haskell
note pat
# s "arpy" 
# octave 6

```

---

<div class="post-metadata">

**Author:** ![geikha](https://uzu.lurk.org/user_avatar/uzu.lurk.org/geikha/32/2701_2.png) [@geikha](https://uzu.lurk.org/u/geikha)\
**Post date:** [7 January 2022 02:11 UTC](https://uzu.lurk.org/t/shift-a-note-pattern-up-an-octave/3764/5 "2022-01-07T02:11:45Z")

</div>

i like octave, although it does get messy sometimes between samples and synths. you are expecting a c6 for example but you sample was already pitched 1 octave up so you get a c7 that's harsh af. but still, i like it. i have it abbreviated as `oc`
