DurationsScale¶
- class sonipy.DurationsScale(scale)¶
Bases:
objectThis class builds the x component of the sonification - the durations scale. It populates the namespace of duration objects based on the x scale (x value / time (ms)) input.
See getScale() function docstring for details on input options avaliable to you.
- Parameters
- scalefloat
A time durations scale in units of x value / time (ms).
Methods Summary
getDurations(x)Calculates millisecond pitch durations for variable data, based upon deltas between input x values.
plotDurations([figsize, kwargs])Plots histogram of time duration between succesive blips (in ms).
Prints minimum and maximum d(time) values and sound durations to help user understand time and sound min/max changes.
Methods Documentation
- getDurations(x)¶
Calculates millisecond pitch durations for variable data, based upon deltas between input x values. Note the last deltas will by default equal the dtime_max * scale.
- Parameters
- xarr
Array of x positions that will correspond to blip times.
- Returns
- arr
Durations in ms between time successive blips.
- plotDurations(figsize=(4, 5), kwargs={'bins': 100})¶
Plots histogram of time duration between succesive blips (in ms).
- Parameters
- binsint
Number of bins within histogram plot.
- argsdict
Matplotlib histogram input arguments.
- Returns
- arr
Matplotlib fig, ax.
- printEdgeCases()¶
Prints minimum and maximum d(time) values and sound durations to help user understand time and sound min/max changes.