# Defining a pattern as string for use in hydra

**URL:** https://uzu.lurk.org/t/defining-a-pattern-as-string-for-use-in-hydra/6045
**Category:** Strudel
**Tags:** questions
**Created:** [26 December 2025 13:18 UTC](https://uzu.lurk.org/t/defining-a-pattern-as-string-for-use-in-hydra/6045 "2025-12-26T13:18:52Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![nscott32](https://uzu.lurk.org/user_avatar/uzu.lurk.org/nscott32/32/3456_2.png) [@nscott32](https://uzu.lurk.org/u/nscott32)
#### Post date: [26 December 2025 13:18 UTC](https://uzu.lurk.org/t/defining-a-pattern-as-string-for-use-in-hydra/6045/1 "2025-12-26T13:18:52Z")

</div>

I would like to be able to define a pattern as a string in one of the format accepted by tidal (note, struct, etc) so that I can then process it and reuse it in hydra.

For example I have a note pattern with silences:

```haskell
  "[0 - - 0] [- 3] [- 3 - -] [-2]"

```

I want to use it in hydra `kaleid` function using `H`, however the `-` aren’t correct values for `kaleid` and this triggers errors in the console.I would like to programatically replace values like `-` =\> `0` before feeding it to `H` in hydra.  
Is that possible?

The problem I am facing currently is that I can’t call `.replaceAll` on the string as they seem to all be preprocessed and converted to an object.

---

<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 January 2026 08:30 UTC](https://uzu.lurk.org/t/defining-a-pattern-as-string-for-use-in-hydra/6045/2 "2026-01-26T08:30:32Z")

</div>

Have you managed to find a way? I’m also interested…
