---
title: What is Strudel?
description: Strudel Tutorial
layout: ../../layouts/MainLayout.astro
---
import { MiniRepl } from '../../docs/MiniRepl';
import { JsDoc } from '../../docs/JsDoc';
# Functional JavaScript API
While the mini notation is powerful on its own, there is much more to discover.
Internally, the mini notation will expand to use the actual functional JavaScript API.
For example, this Pattern in Mini Notation:
is equivalent to this Pattern without Mini Notation:
Similarly, there is an equivalent function for every aspect of the mini notation.
Which representation to use is a matter of context. As a rule of thumb, you can think of the JavaScript API
to fit better for the larger context, while mini notation is more practical for individiual rhythms.
## Limits of Mini Notation
While the Mini Notation is a powerful way to write rhythms shortly, it also has its limits. Take this example:
Here, we are using mini notation for the individual rhythms, while using the function `stack` to mix them.
While stack is also available as `,` in mini notation, we cannot use it here, because we have different types of sounds.
## Notes
Notes are automatically available as variables:
An important difference to the mini notation:
For sharp notes, the letter "s" is used instead of "#", because JavaScript does not support "#" in a variable name.
The above is the same as:
Using strings, you can also use "#".
## Alternative Syntax
In the above example, we are nesting a function inside a function, which makes reading the parens a little more difficult.
To avoid getting to many nested parens, there is an alternative syntax to add a type to a pattern:
You can use this with any function that declares a type (like `n`, `s`, `note`, `freq` etc), just make sure to leave the parens empty!
## Pattern Factories
The following functions will return a pattern.
### cat
### seq
### stack
### timeCat
## Combining Patterns
You can freely mix JS patterns, mini patterns and values! For example, this pattern:
...is equivalent to:
... as well as:
")`} />
While mini notation is almost always shorter, it only has a handful of modifiers: \* / ! @.
When using JS patterns, there is a lot more you can do.
## Time Modifiers
The following functions modify a pattern temporal structure in some way.
### Pattern.slow
### Pattern.fast
### Pattern.early
### Pattern.late
### Pattern.legato
### Pattern.struct
### Pattern.euclid
### Pattern.euclidLegato
### Pattern.rev
### Pattern.iter
### Pattern.iterBack
## Conditional Modifiers
### Pattern.every
### Pattern.when
## Accumulation Modifiers
### Pattern.stack
### Pattern.superimpose
### Pattern.layer
### Pattern.off
### Pattern.echo
### Pattern.echoWith
## Concat Modifiers
### Pattern.seq
### Pattern.cat
## Value Modifiers
### Pattern.add
### Pattern.sub
### Pattern.mul
### Pattern.div
### Pattern.round
### Pattern.apply
### Pattern.range
### Pattern.chunk
### Pattern.chunkBack