MultiTone

class sonipy.MultiTone(starttimes, values, bliplength=0.5, fade=True, verbose=False, alertMultitoneCreated=True, **kwargs)

Bases: sonipy.scales.frequency.FrequencyScale

Class for building a MultiTone, and saving it as audio files.

It takes the durations (differences in x values that can be calculated using DurationsScale.getDurations) and y values (values) as inputs to be sonified.

To account for how y scales with pitch, it takes in a dictionary of frequency_args. See the FrequencyScale object docstring to see details about inputs (frequency_min, frequency_max, cents_per_value, value_min, value_max).

To account for how x scales with time, it accepts the durations argument.

For quick and easy use, we recommend use of the SonifyTool wrapper.

Parameters
durationsarr

Durations in ms between time successive blips.

valuesarr

Array of y positions that will correspond to pitch values.

lengthfloat

Duration of each blip in seconds.

fadebool

Flag to toggle including fade on each blip. Recommended to include, especially when blips are dense.

verbosebool

Flag for printing. Default False.

alertMultitoneCreatedbool

Flag for alerting when Multitone created. Default True.

**kwargsdictionary

Dictionary with pitch y value arguments (frequency_min, frequency_max, cents_per_value, value_min, value_max).

Methods Summary

play([autoplay])

Function to play tones interactively in jupyter notebooks, based on ThinkDSP .make_audio() function.

plotBlips()

Plots time vs.

plotSpectrogram([seg_length, win_flag, set_xlim])

Plots a spectrogram of the Tone.

plotSpectrum()

Plots a spectrum of the Tone.

plotTone()

Plots time vs.

save([path, filename, default_tones_folder])

Saves .wav file from multitone system in tones folder.

Methods Documentation

play(autoplay=True)

Function to play tones interactively in jupyter notebooks, based on ThinkDSP .make_audio() function.

Parameters
autoplaybool

Flag on whether to autoplay file.

plotBlips()

Plots time vs. amplitude for all individual blip soundbites.

plotSpectrogram(seg_length=1024, win_flag=True, set_xlim=True)

Plots a spectrogram of the Tone.

Parameters
seg_lengthint

number of samples in each segment

win_flagbool

Boolian flag to apply hamming window to each segment

set_xlimBool

Boolian flag to adjust xlimits between 0 and total time.

plotSpectrum()

Plots a spectrum of the Tone.

plotTone()

Plots time vs. amplitude for total soundfile.

save(path='.', filename='multitone.wav', default_tones_folder='tones/')

Saves .wav file from multitone system in tones folder.