Skip to content

Class daisysp::GranularPlayer

ClassList > daisysp > GranularPlayer

More...

  • #include <granularplayer.h>

Public Functions

Type Name
GranularPlayer ()
void Init (float * sample, int size, float sample_rate)
float Process (float speed, float transposition, float grain_size)
~GranularPlayer ()

Detailed Description

GranularPlayer Module

Date: November, 2023

Author: Vinícius Fernandes

GranularPlayer is a lookup table player that provides independent time stretching and pitch shifting via granulation. Inspired by the grain.player object from else pure data's library.

Public Functions Documentation

function GranularPlayer

inline daisysp::GranularPlayer::GranularPlayer () 

function Init

void daisysp::GranularPlayer::Init (
    float * sample,
    int size,
    float sample_rate
) 

Initializes the GranularPlayer module.

Parameters:

  • sample pointer to the sample to be played
  • size number of elements in the sample array
  • sample_rate audio engine sample rate

function Process

float daisysp::GranularPlayer::Process (
    float speed,
    float transposition,
    float grain_size
) 

Processes the granular player.

Parameters:

  • speed playback speed. 1 is normal speed, 2 is double speed, 0.5 is half speed, etc. Negative values play the sample backwards.
  • transposition transposition in cents. 100 cents is one semitone. Negative values transpose down, positive values transpose up.
  • grain_size grain size in milliseconds. 1 is 1 millisecond, 1000 is 1 second. Does not accept negative values. Minimum value is 1.

function ~GranularPlayer

inline daisysp::GranularPlayer::~GranularPlayer () 


The documentation for this class was generated from the following file external-docs/DaisySP/Source/Sampling/granularplayer.h