Tabread4~ or granular player implementation

Hey There !

I’m excited to share with you my latest contribution to the DaisySP project – the GranularPlayer module. I’ve opened a pull request, and I’m looking forward to your feedback and suggestions. You can find the pull request here.

About the GranularPlayer

The GranularPlayer module is designed to playback arrays of samples offering independent control over time-stretching and pitch-shifting. Here are some key features:

  • Playback Speed Control: This module allows you to adjust the playback speed. You can set it to 1 for normal playback, 2 to double the original playback speed, 0.5 to halve the original speed, or use negative values to play the sample in reverse.
  • Transposition: You can transpose the sample in cents (with 100 cents equal to one semitone). This feature enables creative pitch-shifting effects, allowing you to raise or lower the pitch as needed.
  • Grain Size Control: You can adjust the grain size in milliseconds, ranging from 1 millisecond to your desired value. This capability lets you manipulate the granularity of your sound.
  • Dual Grains with Overlapping Envelopes: The GranularPlayer module is implemented using two grains of sound, each multiplied by a half cosine envelope with 180-degree phase difference. This design is inspired by the “grain.player~” object in Pure Data’s else lib, by Alexandre Porres, which, in turn, draws inspiration from the B section of an audio example in Miller Puckette’s Pure Data examples.

Folder Organization

I’ve organized this module under a new “Sampling” folder. The reason behind this categorization is that the GranularPlayer module incorporates several features that didn’t quite fit neatly into any of the existing categories within the DaisySP repository. The creation of the “Sampling” category serves a dual purpose. Firstly, it provides a logical home for this module, making it easier for developers and users to find and utilize it. Secondly, I hope that this new category can serve as an inspiration for other developers to explore and develop modules based on various sampling algorithms. I’ve also taken care of the necessary changes in the Makefile and CMakeLists.txt to ensure a seamless integration of the “Sampling” category into the DaisySP project.

  • Demonstration Video and Sample Sound Effect

I am also sharing a demonstration video to showcase it in action. In the video, I am using a small array that contains the iconic sound effect of Super Mario growing after eating a mushroom. This choice was intentional, as it’s both small enough to fit into the flash memory of the Daisy Seed and culturally recognizable, making it a fun sound to experiment with.

The decision to use a small sample and an array pointer input, rather than a file system in SDRAM or an SD card module, is to keep the module as agnostic as possible. This way, users can easily pass a pointer to their array and the array’s size, making it straightforward to integrate the GranularPlayer into their projects.

Link for the showcase video: DaisySP GranularPlayer Module Showcase

3 Likes