npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@musical-patterns/pattern-hafuhafu

v1.0.212

Published

rhythmic circularity; blocks within themselves

Downloads

27

Readme

Hafuhafu

rhythmic circularity; blocks within themselves

kernel cycles

Start with a kernel, and make a cycle of kernels from it.

A kernel is the principal input of Hafuhafu. It's a short, repeating melody/ostinato/rhythm/contour/etc.

Each next kernel is the previous one, just with every other note removed. They have the same total notes though, because you keep playing it over and over, so as long as the kernel length is odd, all elements are preserved, so now they are simply in a new order. For example a kernel [1,2,3,4,5] would become [2,4,1,3,5] because if you look at a sequence of [1,2,3,4,5] repeating: 1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5, and now take every other note: 2,4,1,3,5,2,4,1,3,5, you can see we have a new repeating pattern. If we simply dropped every other note, the notes in the new pattern would last twice as long, so the music would seem to go half as fast. However, if we gradually increase the tempo to offset this impact, doubling it by the time we have faded out the departing notes, then we arrive at a place very similar to where we started. We could repeat this process indefinitely. [2,4,1,3,5] in turn becomes [4,3,2,1,5] which in turn becomes [3,1,4,2,5] which in turn returns to [1,2,3,4,5]. That's a kernel cycle.

sieve

You don't always have to take just every other note. If you take every third note instead, that's sieve of 3.

iteration

Each time a kernel has evolved into the next kernel, an iteration has completed.

layer

Each iteration usually has several layers at different speeds, or pitches, or volumes. Each layer usually spans multiple iterations, changing speed, pitch, or volume across them.

sieve fractal

As the layer count increases, the sieve layers on top of itself. Some notes have only been sieved once, others twice, still others thrice. The more you've been sieved, the more gone you are.

mode

Two modes: droste and zeno. Two different popular conceptions of infinite process.

In droste mode, you are barreling through a tunnel of kernels within kernels. The previous one disappears around your periphery; the destination is infinitesimal in the distance. Layers fade in from nothing, have their day in the sun, then fade back out to nothing. Each iteration's inactive layer is silent. It stands in the place for all the layers yet to come, still too far away and quiet to hear.

In zeno mode, you asymptotically approach a destination, but will never reach it. Half of the notes keep dying away, but half always still remain. Each iteration's inactive layer is at full gain.

progress

Progress gets measured in a few different ways, but all of them are normalized to a scalar between 0 and 1:

  • element progress - a flat ratio of how many elements you are through the iteration to the total elements of the iteration, without respect to how long the notes are.
  • duration progress - taking into account the duration of the notes (so if the pattern is slowing down, your duration progress will be ahead of the element progress at first before they catch up and tie at the end of each iteration)
  • layer progress - if a layer spans 3 iterations, then it would be at layer progress 1/3 by the end of the first, 2/3 by the end of the second, and 3/3 by the end of the third.

Each of these progresses are helpful for calculating different things throughout the process.

reverse

By default Hafuhafu speeds up and fades out, but you can also slow down and fade in!