# Syntax struggles with remap()

**URL:** https://uzu.lurk.org/t/syntax-struggles-with-remap/5982
**Category:** Strudel
**Tags:** questions
**Created:** [26 October 2025 11:06 UTC](https://uzu.lurk.org/t/syntax-struggles-with-remap/5982 "2025-10-26T11:06:43Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![firolightfog](https://uzu.lurk.org/user_avatar/uzu.lurk.org/firolightfog/32/3305_2.png) [@firolightfog](https://uzu.lurk.org/u/firolightfog)
#### Post date: [26 October 2025 11:06 UTC](https://uzu.lurk.org/t/syntax-struggles-with-remap/5982/1 "2025-10-26T11:06:43Z")

</div>

I think I fatally misunderstand something with the syntax. Why doesn't remap() simply transform the n() to "4 5 9 4 5"?

```javascript
let remap = register('remap', (mapping, x) => {return mapping[x]})

s("fmpiano")
  .euclid(11,16)
  .n("1 2 3 1 2".remap("0459000000"))
  // .n("1 2 3 1 2").remap("0459000000")
  .scale("C:minor")

```

I also thought of solving the issue without registering but no luck:

```javascript
s("fmpiano")
  .euclid(11,16)
  .n("1 2 3 1 2"
  .when("1", x => x.add("0459000000"[x]).sub(x))
  )
  .scale("C:minor")

```

---

<div class="post-metadata">

### Author: ![firolightfog](https://uzu.lurk.org/user_avatar/uzu.lurk.org/firolightfog/32/3305_2.png) [@firolightfog](https://uzu.lurk.org/u/firolightfog)
#### Post date: [27 October 2025 09:07 UTC](https://uzu.lurk.org/t/syntax-struggles-with-remap/5982/2 "2025-10-27T09:07:01Z")

</div>

Probably I make it more complicated than I should.

Maybe this one?

```javascript
// this doesn't seem to work
s("fmpiano")
  .euclid(11,16)
  .n("1 2 3 1 2".pick("0 4 5 9"))
  .scale("C:minor")

```

```javascript
// this does work but I want to type less
s("fmpiano")
  .euclid(11,16)
  .n("1 2 3 1 2".pick(["0","4","5","9"]))
  .scale("C:minor")

```

---

<div class="post-metadata">

### Author: ![firolightfog](https://uzu.lurk.org/user_avatar/uzu.lurk.org/firolightfog/32/3305_2.png) [@firolightfog](https://uzu.lurk.org/u/firolightfog)
#### Post date: [28 October 2025 10:32 UTC](https://uzu.lurk.org/t/syntax-struggles-with-remap/5982/3 "2025-10-28T10:32:26Z")

</div>

OK, I think maybe I found the solution.

```javascript
s("fmpiano")
  .euclid(11,16)
  .n("1 2 3 1 2".pick(map("0 4 5 9")))
  .scale("C:minor")

```

---

<div class="post-metadata">

### Author: ![firolightfog](https://uzu.lurk.org/user_avatar/uzu.lurk.org/firolightfog/32/3305_2.png) [@firolightfog](https://uzu.lurk.org/u/firolightfog)
#### Post date: [28 October 2025 11:48 UTC](https://uzu.lurk.org/t/syntax-struggles-with-remap/5982/4 "2025-10-28T11:48:19Z")

</div>

The solution delivered by froos on Discord seems to be working just fine.

```javascript
let yoko = register('yoko',(patt)=>patt.queryArc(0,1).map(h=>h.value))

setcpm(66/4)

s("fmpiano")
  .euclid(11,16)
  .n("1 2 3 1 2".pick("0 2 5 9".yoko()))
  .scale("C:minor")

```
