Stepwise patterning 🌀 Bulka

Stepwise patterning (экспериментально)

Это развивающаяся область strudel, и поведение может измениться или быть переименовано в будущих версиях. Отзывы и идеи приветствуются!

Введение

Обычно в strudel единственной точкой отсчета для большинства преобразований patterns является cycle. Теперь также возможно работать с шагами (steps) через растущий набор функций.

Например, обычно когда вы используете fastcat для объединения двух patterns, cycles будут сжаты в половину cycle каждый:

fastcat("bd hh hh", "bd hh hh cp hh").sound()

С новой stepwise функцией stepcat, шаги двух patterns будут равномерно распределены по cycle:

stepcat("bd hh hh", "bd hh hh cp hh").sound()

По умолчанию шаги подсчитываются в соответствии с ‘верхним уровнем’ в mini-notation. Например, "a [b c] d e" имеет пять событий в cycle, но считается как четыре шага, где [b c] считается как один шаг.

Однако вы можете отметить другой метрический уровень для подсчета шагов, используя ^ в начале sub-pattern. Если мы сделаем это с subpattern в нашем примере: "a [^b c] d e", то pattern теперь будет считаться имеющим восемь шагов. Это потому, что ‘b’ и ‘c’ каждый считаются как отдельные шаги, а события в pattern в два раза длиннее, и поэтому считаются как два шага каждое.

Управление темпом шагов

Некоторые stepwise функции сами по себе не кажутся делающими много, например, эти два примера функции expand звучат абсолютно одинаково, несмотря на разные значения расширения:

"c a f e".expand(2).note().sound("folkharp")
"c a f e".expand(4).note().sound("folkharp")

Количество шагов на cycle изменяется за кулисами, но само по себе это ничего не делает. Однако вы услышите разницу, когда используете другую stepwise функцию вместе с ней, например stepcat:

stepcat("c a f e".expand(2), "g d").note()
.sound("folkharp")
stepcat("c a f e".expand(4), "g d").note()
.sound("folkharp")

Вы должны услышать, что expand увеличивает длительность шагов первого subpattern пропорционально второму.

Вы также можете изменить скорость pattern в соответствии с заданным количеством шагов на cycle с помощью функции pace:

stepcat("c a f e".expand(2), "g d").note()
.sound("folkharp")
.pace(8)
stepcat("c a f e".expand(4), "g d").note()
.sound("folkharp")
.pace(8)

Первый пример имеет десять шагов, а второй пример - 18 шагов, но затем оба воспроизводятся со скоростью 8 шагов на cycle.

Аргумент expand также может быть pattern, и будет обрабатываться в stepwise манере. Это означает, что patterns из изменяющихся значений в аргументе будут объединены с помощью stepcat:

note("c a f e").sound("folkharp").expand("3 2 1 1 2 3")

Это приводит к плотному pattern, потому что разные расширенные версии сжаты в один cycle. pace снова удобен здесь для замедления pattern до определенного количества шагов на cycle:

note("c a f e").sound("folkharp").expand("3 2 1 1 2 3").pace(8)

Ранние версии многих из этих функций имели префикс s_, а функция pace ранее была известна как steps. Они все еще существуют как псевдонимы, но поведение могло измениться, и скоро они будут удалены. Пожалуйста, обновите ваши patterns!

Stepwise функции

pace

Experimental

Speeds a pattern up or down, to fit to the given number of steps per cycle.

    sound("bd sd cp").pace(4)
    // The same as sound("{bd sd cp}%4") or sound("<bd sd cp>*4")

    stepcat

    Synonyms: timeCat, timecat

    'Concatenates' patterns like fastcat, but proportional to a number of steps per cycle. The steps can either be inferred from the pattern, or provided as a [length, pattern] pair. Has the alias timecat.

      stepcat([3,"e3"],[1, "g3"]).note()
      // the same as "e3@3 g3".note()
      stepcat("bd sd cp","hh hh").sound()
      // the same as "bd sd cp hh hh".sound()

      stepalt

      Experimental

      Concatenates patterns stepwise, according to an inferred 'steps per cycle'. Similar to stepcat, but if an argument is a list, the whole pattern will alternate between the elements in the list.

        stepalt(["bd cp", "mt"], "bd").sound()
        // The same as "bd cp bd mt bd".sound()

        expand

        Experimental

        Expands the step size of the pattern by the given factor.

          sound("tha dhi thom nam").bank("mridangam").expand("3 2 1 1 2 3").pace(8)

          contract

          Experimental

          Contracts the step size of the pattern by the given factor. See also expand.

            sound("tha dhi thom nam").bank("mridangam").contract("3 2 1 1 2 3").pace(8)

            extend

            Experimental

            extend is similar to fast in that it increases its density, but it also increases the step count accordingly. So stepcat("a b".extend(2), "c d") would be the same as "a b a b c d", whereas stepcat("a b".fast(2), "c d") would be the same as "[a b] [a b] c d".

              stepcat(
                sound("bd bd - cp").extend(2),
                sound("bd - sd -")
              ).pace(8)

              take

              Experimental

              Takes the given number of steps from a pattern (dropping the rest). A positive number will take steps from the start of a pattern, and a negative number from the end.

                "bd cp ht mt".take("2").sound()
                // The same as "bd cp".sound()
                "bd cp ht mt".take("1 2 3").sound()
                // The same as "bd bd cp bd cp ht".sound()
                "bd cp ht mt".take("-1 -2 -3").sound()
                // The same as "mt ht mt cp ht mt".sound()

                drop

                Experimental

                Drops the given number of steps from a pattern. A positive number will drop steps from the start of a pattern, and a negative number from the end.

                  "tha dhi thom nam".drop("1").sound().bank("mridangam")
                  "tha dhi thom nam".drop("-1").sound().bank("mridangam")
                  "tha dhi thom nam".drop("0 1 2 3").sound().bank("mridangam")
                  "tha dhi thom nam".drop("0 -1 -2 -3").sound().bank("mridangam")

                  polymeter

                  Synonyms: pm

                  Experimental

                  Aligns the steps of the patterns, creating polymeters. The patterns are repeated until they all fit the cycle. For example, in the below the first pattern is repeated twice, and the second is repeated three times, to fit the lowest common multiple of six steps.

                    // The same as note("{c eb g, c2 g2}%6")
                    polymeter("c eb g", "c2 g2").note()

                    shrink

                    Experimental

                    Progressively shrinks the pattern by 'n' steps until there's nothing left, or if a second value is given (using mininotation list syntax with :), that number of times. A positive number will progressively drop steps from the start of a pattern, and a negative number from the end.

                      "tha dhi thom nam".shrink("1").sound()
                      .bank("mridangam")
                      "tha dhi thom nam".shrink("-1").sound()
                      .bank("mridangam")
                      "tha dhi thom nam".shrink("1 -1").sound().bank("mridangam").pace(4)
                      note("0 1 2 3 4 5 6 7".scale("C:ritusen")).sound("folkharp")
                         .shrink("1 -1").pace(8)

                      grow

                      Experimental

                      Progressively grows the pattern by 'n' steps until the full pattern is played, or if a second value is given (using mininotation list syntax with :), that number of times. A positive number will progressively grow steps from the start of a pattern, and a negative number from the end.

                        "tha dhi thom nam".grow("1").sound()
                        .bank("mridangam")
                        "tha dhi thom nam".grow("-1").sound()
                        .bank("mridangam")
                        "tha dhi thom nam".grow("1 -1").sound().bank("mridangam").pace(4)
                        note("0 1 2 3 4 5 6 7".scale("C:ritusen")).sound("folkharp")
                           .grow("1 -1").pace(8)

                        tour

                        Experimental

                        Inserts a pattern into a list of patterns. On the first repetition it will be inserted at the end of the list, then moved backwards through the list on successive repetitions. The patterns are added together stepwise, with all repetitions taking place over a single cycle. Using pace to set the number of steps per cycle is therefore usually recommended.

                          "[c g]".tour("e f", "e f g", "g f e c").note()
                             .sound("folkharp")
                             .pace(8)

                          zip

                          Experimental

                          'zips' together the steps of the provided patterns. This can create a long repetition, taking place over a single, dense cycle. Using pace to set the number of steps per cycle is therefore usually recommended.

                            zip("e f", "e f g", "g [f e] a f4 c").note()
                               .sound("folkharp")
                               .pace(8)