Commit Graph

78 Commits

Author SHA1 Message Date
Alex McLean b15843f3a7 change behaviour of polymeter, and remove polymeterSteps (#1302)
* change behaviour of polymeter, and remove polymeterSteps

* format
2025-03-04 18:17:37 +00:00
Alex McLean 84581b22aa Fix for squeezejoin and functions using it, including bite (#1286) 2025-02-11 09:02:34 +00:00
Alex McLean 49e9b84962 [breaking change] Sample signals from query onset, rather than midpoint (#1278)
This changes almost everything involving signals, including all use of random numbers.
2025-02-05 15:10:53 +00:00
Alex McLean ce9d23049a Polish, rename, and document stepwise functions (#1262)
* polish, rename, and document stepwise functions: `pace`, `take`, `drop`, `expand`, `contract`, `repeat`, `zip`, `grow`, `shrink`, and `tour`
2025-02-02 20:26:44 +00:00
Alex McLean 638e247a5f Revert "Fix sometimes (#1243)" (#1267)
This reverts commit 00b0341839.
2025-01-28 00:00:03 +01:00
Felix Roos f61916fffa Merge pull request #1226 from heerman/binary
Add binary and binaryN
2025-01-17 19:27:00 +01:00
Alex McLean 00b0341839 Fix sometimes (#1243)
* test and fix for sometimes bug
2025-01-16 11:18:33 +00:00
Luke Heerman 34f4afad01 Rework binary to binaryN 2024-12-10 23:51:32 -05:00
Luke Heerman 947b263b9c Add tests 2024-12-10 23:51:32 -05:00
Alex McLean 6e496b7a4a Fix loop at tactus (#1145)
* fix loopAt tactus
2024-07-27 11:02:38 +02:00
Alex McLean a4bd0ae100 Chop chop (#1078)
* failing test

* support chopping chops
2024-06-24 17:19:22 +01:00
Alex McLean 283a071c86 Fix bug in Fraction.lcm (#1133)
* bugfix lcm
2024-06-18 22:58:08 +01:00
Alex McLean 91bb0a1d36 Add calculateTactus() for turning off calculation of tactus in (#1081)
core functions.
Also while I'm here stop fast/slow from manipulating tactus.
2024-04-29 11:36:10 +01:00
Alex McLean bbf8577f85 More tactus tidying (#1071)
* preserve tactus for register (only non-formatting change is adding args to register)
* support undefined tactus values
2024-04-26 14:12:30 +01:00
Alex McLean a189626e8b Fix stepjoin (#1067)
* sort fractions properly - fixes #1066
2024-04-23 22:37:21 +01:00
Alex McLean 0a3694fb82 Stepwise functions from Tidal (#1060)
* rename new stepwise functions to match tidal, adding s_expand and s_contract
* created a `stepJoin` for stepwise patternification
2024-04-21 21:17:07 +01:00
Alex McLean ebeefc0ac4 More experimental step functions: stepwax, stepwane, steptaper, steptour and taperlist (#1042)
* group tactus-oriented functions
* add stepwax, stepwane, steptaper and steptour
* taperlist
2024-04-08 09:46:18 +01:00
Alex McLean 2fd2bdba60 Feature: tactus marking (#1021)
* rename `beat` option to `stackBy` to `repeat`
* fix parse error reporting
* rename `weight` to `tactus` (it might in the end be pulse, step, or tap)
* tactus marking with ^
* and add some tests
2024-03-27 12:06:05 +00:00
Felix Roos c2ef90d67c rename trig -> reset, trigzero -> restart 2024-03-23 11:22:30 +01:00
Alex McLean 398533877c Beat-oriented functionality (#976)
* annotate pure values with their value, allowing single mininotation values to maintain their labels as pure
* Don't use any 'patternified' arguments if they're all 'pure'
* allow pattern weights (roughly, beats-per-cycle) to be inferred where possible, including from mininotation and across many transformations (e.g. `fast` with a 'pure' factor)
* Add `beatCat`, similar to `timeCat` but funkier
* `silence` has a weight of 1, add alternative `nothing` with a weight of 0, and `gap` function with weight argument
* preserve weight across applicative operations (weight comes with the structure)
* add `stack` alternatives that take advantage of pattern weights to align patterns differently - `stackLeft`, `stackRight`, `stackCentre`, `stackExpand`, with `stackBy` with an argument for patterning the alignment.
2024-03-16 17:24:37 +00:00
Felix Roos 664a19a5c4 refactor: remove now redundant controls imports 2024-02-28 00:36:44 +01:00
Alex McLean 98b7859605 pick, pickmod, inhabit, inhabitmod (#921)
* the args for `pick` are now reversed as standard (old behaviour still supported to avoid breaking change)
* `pick` is also now a pattern method
* `pick` now also accepts a lookup table for pick-by-name as an alternative to pick-by-index from a list
* `inhabit` added with same behaviour as `pick`, except cycles from source patterns are squeezed into events of inhabited patterns
* Also some general doc tidying, sorry for the noise..
* There is also `pickmod` and `inhabitmod`, for wrapping indexes around rather than clamping them
2024-01-18 17:08:29 +00:00
Alex McLean a8db707440 Revert "pick now accepts lookup tables, with alternate cycle squeezing behaviour as new inhabit function" (#920) 2024-01-18 17:04:26 +00:00
Alex McLean 873a412179 pick now accepts lookup tables, with alternate cycle squeezing behaviour as new inhabit function (#918)
- the args for `pick` are now reversed (breaking change!)
- `pick` is also now a method on the inhabited pattern
- `pick` now also accepts a lookup table
- `inhabit` added with same behaviour as `pick`, except cycles from source patterns are squeezed into events of inhabited patterns
- Also some general doc tidying, sorry for the noise..
- There is now also `pickmod` and `inhabitmod`, for wrapping indexes around rather than clamping them
2024-01-18 16:45:39 +00:00
Felix Roos 94fcea1040 codeformat 2023-12-30 23:21:34 +01:00
Bernhard Wagner 1bca05e349 FIXES: palindrome abc -> abccba (#831)
* FIXES: palindrome abc -> abccba

* FIXES: tests for palindrome

---------

Co-authored-by: Bernhard Wagner <gitcommit@nosuch.biz>
2023-12-05 10:15:13 +00:00
Alex McLean 9ceab0f294 Fix chunk, add fastChunk and repeatCycles (#712)
* Match behaviour of chunk with tidal, add fastChunk for old strudel behaviour. Also adds repeatCycles. fixes #689

* documentation
2023-11-01 21:22:33 +00:00
Alex McLean 2d5064bd5b Reinstate slice and splice (#500)
Reinstate slice/splice, fixing up "unit" param using new global cps
2023-03-02 14:44:41 +00:00
Felix Roos 961bbf6f55 Revert "Another attempt at composable functions - WIP (#390)"
This reverts commit cbae355896.
2023-02-27 15:20:49 +01:00
Alex McLean 7c367eb1e8 slice and splice (#466)
Implements `slice` and `splice` from tidal, intended for beat slicing
2023-02-22 11:51:31 +00:00
Alex McLean fdb76867a7 weave and weaveWith (#465)
Added weave and weaveWith from tidal
2023-02-18 00:00:18 +00:00
Alex McLean cbae355896 Another attempt at composable functions - WIP (#390)
Summary of changes:

- Made unary functions composable, including controls. So e.g. s("bd sd").every(3,fast(2).iter(4).n(4)) works the same as s("bd sd").every(3,x => x.fast(2).iter(4).n(4))
- Made operators/alignments composable too, so s("bd sd").every(3, set.squeeze.n(3, 4)) works
- Patterns are not treated as functions, so s("bd sd").every(3, n(5)) is an annoying runtime error. s("bd sd").every(3, set.n(5)) does work though.

Other minor changes:

- standardised alignment 'squeezeOut' as lowercase 'squeezeout'
- made firstCycleValues turn haps sorted in order of 'part'
2023-02-16 23:15:21 +00:00
Alex McLean 46f3b662a7 add pattern methods hurry, press and pressBy (#397) 2023-02-01 15:49:55 +00:00
Felix Roos 9731eb8c5b add ribbon + test + docs 2023-01-19 12:25:12 +01:00
Felix Roos 468ccc6288 add run + test + docs 2023-01-19 11:47:11 +01:00
Alex McLean 45842b1f05 Fix .out(), renaming webaudio's out() to webaudio() (#361)
* breaking test for out()

* rename webaudio's out() to webaudio(), fixes #359
2023-01-08 23:40:15 +00:00
Felix Roos bf1ba6efc0 code format 2022-12-13 21:32:03 +01:00
Alex McLean 56424d29a3 .defragmentHaps() (#299) 2022-12-11 23:21:53 +00:00
Alex McLean 4340f024d3 Reorganise pattern.mjs with a 'toplevel first' regime (#286)
'toplevel first' regime
* loopAt has its optional cps parameter removed, with loopAtCps added for supporting that usage.
* rename bitlevel operations e.g. _and -> band

Co-authored-by: Felix Roos <flix91@gmail.com>
2022-12-10 14:39:03 +00:00
Alex McLean f827201ee0 Switch 'operators' from .whatHow to .what.how, and make sure there are toplevel curried functions for all of them. Rename util.mod to util._mod, to make room for toplevel 'operator' of that name. (#285) 2022-12-07 19:07:55 +00:00
Alex McLean e1a532500e Tidying up core (#256)
* remove _ prefixes except for functions to be patternified
* categorise pattern methods
* experimental support for `.add.squeeze` and friends as alternative to `.addSqueeze`
* `every` is now an alias for `firstOf` with additional `lastOf` (which every will become an alias for next)
2022-11-22 08:51:25 +00:00
Felix Roos e128b02da1 support object arithmetic 2022-11-01 21:31:39 +01:00
Alex McLean 24328ee8ae Fix zero length queries WIP (#234)
* failing tests for zero-width queries

* support zero width timespans in splitArcs. Fixes one test, breaks a load more..

* fix fastGap
2022-10-29 23:23:10 +01:00
Alex McLean 5f381cf153 Patternify range (#231)
* patternify range

* patternify range

* fix test
2022-10-26 22:53:49 +01:00
Alex McLean a5bf8f6732 fix fastgap for events that go across cycle boundaries (#225) 2022-10-06 21:35:45 +01:00
Alex McLean 513e0d748d focus tweak for squeezeJoin - another go at fixing #216 (#221)
Fixes squeezeJoin, and in the process struct/keepif. fixes #216

Co-authored-by: Felix Roos <flix91@gmail.com>
2022-09-24 23:27:25 +01:00
Felix Roos 488ebf8f1a replace old tests
+ ignore tune test for now
+ add happy-dom
2022-08-06 12:22:11 +02:00
alex aca3bea56b Implement inside/outside 2022-05-09 18:43:02 +01:00
alex 4fd843f8cf Implement brak() 2022-05-09 16:56:08 +02:00
alex f8f744dd87 standardise on hap rather than event, especially in function names 2022-05-05 17:20:36 +01:00