big update

This commit is contained in:
2024-01-08 01:58:04 +01:00
parent 886d8eed62
commit b6231fde39
17 changed files with 224 additions and 225 deletions

View File

@ -1,26 +1,25 @@
# Pattern shortcuts
SuperCollider has a very large and powerful collection of Pattern classes. They allow you to create pretty much every musical pattern you can imagine but it comes with a cost: it is cumbersome to write and read. This is a known problem
since a long time ago. Many live coding frameworks have been created just to
break free of the rigid pattern syntax used by SuperCollider. BuboQuark is not meant to replace the Pattern classes entirely. This would be a bit presumptuous but also counter-productive: there is so much you can do with it already!
SuperCollider has a very large and powerful collection of Pattern classes. They allow you to create pretty much every musical pattern you can imagine but it comes with a cost: they are cumbersome to write and read. The question of patterns seems to be a divisive topic in the broader community. Some use them a lot, some do their absolute best to avoid them.
I just bring a few shortcuts to make it easier to write and read patterns whenever possible. Once again, there is a strong reliance on arrays to do so. This is not the state of the art approach but it is a good compromise between simplicity and flexibility. Once again, I do not break compatibility with the base language.
The difficulty of writing patterns live is a well known challenge. Many live coding frameworks have been created just to
break free of the rigid pattern syntax used by SuperCollider. BuboQuark is not trying to replace the Pattern classes entirely because they are really nice. This would be a bit presumptuous and also counter-productive: there is so much you can do with patterns already!
##### Pdv to write melodies/rhythms
I just bring a few shortcuts to make it easier to write and read patterns whenever possible. Once again, there is a strong reliance on arrays to do so. This is not the state of the art approach but it is a good compromise between simplicity and flexibility. The kind of shortcuts I'm creating here have been used in the community for a long time. Each person typically creates his own shortcuts.
There is a little rather unknown Quark called [Pdv](https://github.com/dmorgan-github/Pdv). This Quark brings a new method to parse a string into a pattern, inspired by the [TidalCycles](https://tidalcycles.org) syntax. There are other Quarks doing just the same thing like [Bacalao](https://github.com/totalgee/bacalao) but they are a little bit more involved. They expect you to adhere to the way the framework works, departing from the base syntax.
### Pdv to write melodies/rhythms
There is a little and rather unknown Quark called [Pdv](https://github.com/dmorgan-github/Pdv). This Quark brings a new method to parse a string into a pattern, inspired by the [TidalCycles](https://tidalcycles.org) syntax. There are other Quarks doing just the same thing like [Bacalao](https://github.com/totalgee/bacalao) but they are a little bit difficult to use. They work inside of a larger framework that you have to adhere to, departing from the base syntax.
**Pdv** is super transparent. It just adds a new method to use on the `deg:` key of your patterns. `Pdv` will take care of turning that list into the `dur` and `degree` keys, facilitating the writing of rhythms and melodies. I have assocciated this method with the `.p` method of the string class. It means that you can use the following syntax to write patterns:
```supercollider
(
[
"fmintro", i: "fm",
// Look at the following line!
deg: "0^4 ~^4 {0 5 7}^4 ~ -5^4 ~^4 {0 5 8 10}^4 ~".p,
o: [4, 5], db: -20, attack: [0.1, 0.3].pwhite,
].pat.play;
)
```
@ -41,9 +40,9 @@ $ - shuffle group of values
, - can be used as visual separator to help readability
```
##### Existing array shortcuts
### Array shortcuts
These shortcuts are syntax sugar for turning a list into a pattern (_e.g._ `[1, 2, 3].pseq`). They work just like the regular Pattern type they correspond to.
These shortcuts are syntax sugar for turning a list into a pattern (_e.g._ `[1, 2, 3].pseq`). They work just like the regular Pattern type they correspond to. I could create a thousand of them but so far, I only cover the most common types.
- `pseq(repeats=inf, offset=0)`: shortcut for `Pseq`
- `pshuf(repeats=1)`: shortcut for `Pshuf`
@ -53,7 +52,9 @@ These shortcuts are syntax sugar for turning a list into a pattern (_e.g._ `[1,
- `pwhite(repeats=inf)`: shortcut for `Pwhite`
- `pseries(repeats=inf)`: shortcut for `Pseries`
##### Euclidian rhythms
Replacing all of them is probably not the best idea. The library is so vast that some Pattern classes are not encountered very often. Some are also quite specific with the type of arguments they require and pushing everything in an Array can hinder code completion / readability.
There is a Quark named Pborklund that brings euclidian rhythms to the SuperCollider pattern library. Do you see yourself typing `Pbjorklund2(5, 8, inf)` everytime you want to use it? I don't. I have created a shortcut for it: `Eu(5, 8, inf)`. That's it. I don't have anything more to say about it.
### Euclidian rhythms
There is a Quark named Pborklund that implements [euclidean rhythms](https://en.wikipedia.org/wiki/Euclidean_rhythm) to the SuperCollider pattern library. Do you see yourself typing `Pbjorklund2(5, 8, inf)` everytime you want to use it? I don't. I have created a shortcut for it: `Eu(5, 8, inf)`. That's it. I don't have anything more to say about it.