TSE (libsoni.core.tse)
- libsoni.core.tse.sonify_tse_clicks(time_positions: ndarray | None = None, click_pitch: int = 69, click_fading_duration: float = 0.25, click_amplitude: float = 1.0, offset_relative: float = 0.0, sonification_duration: int | None = None, fading_duration: float = 0.05, normalize: bool = True, fs: int = 22050) ndarray [source]
Sonifies array of time positions with clicks.
- Parameters:
time_positions (np.ndarray (np.float32 / np.float64) [shape=(N, )]) – Array with time positions for clicks.
click_pitch (int, default = 69) – Pitch for click signal.
click_fading_duration (float, default = 0.25) – Fading duration for click signal, in seconds
click_amplitude (float, default = 1.0) – Amplitude for click signal.
offset_relative (float, default = 0.0) – Relative offset for the beginning of a click. 0 indicates that the beginning of the click event is at the time position, 1 indicates the ending of the click event corresponds to the time position.
sonification_duration (int, default = None) – Determines duration of sonification, in samples.
fading_duration (float, default = 0.05) – Determines duration of fade-in and fade-out at beginning and end of the sonification, in seconds.
normalize (bool, default = True) – Determines if output signal is max-normalized to [-1,1].
fs (int, default = 22050) – Sampling rate, in samples per seconds.
- Returns:
tse_sonification (np.ndarray (np.float32 / np.float64) [shape=(M, )]) – Sonified time positions.
- libsoni.core.tse.sonify_tse_multiple_clicks(times_pitches: List[Tuple[ndarray, int]] | None = None, click_fading_duration: float = 0.25, click_amplitude: float = 1.0, offset_relative: float = 0.0, sonification_duration: int | None = None, fading_duration: float = 0.05, normalize: bool = True, fs: int = 22050) ndarray [source]
Given multiple arrays in form of a list, this function creates the sonification of different sources.
- Parameters:
times_pitches (List[Tuple[np.ndarray, int]]) – List of tuples comprising the time positions and pitches of the clicks
sonification_duration (int, default = None) – Duration of the output waveform, given in samples.
click_fading_duration (float, default = 0.25) – Duration for click signal.
click_amplitude (float, default = 1.0) – Amplitude for click signal.
offset_relative (float, default = 0.0) – Relative offset coefficient for the beginning of the given audio sample. 0 indicates that the beginning of the sample is at the time position. 1 indicates the ending of the sample corresponding to the time position.
sonification_duration (int, default = None) – Determines duration of sonification, in samples.
fading_duration (float, default = 0.05) – Determines duration of fade-in and fade-out at beginning and end of the sonification, in seconds.
normalize (bool, default = True) – Determines if output signal is max-normalized to [-1,1].
fs (int, default = 22050) – Sampling rate, in samples per seconds.
- Returns:
tse_sonification (np.ndarray (np.float32 / np.float64) [shape=(M, )]) – Sonified time positions.
- libsoni.core.tse.sonify_tse_multiple_samples(times_samples: List[Tuple[ndarray, ndarray]] | None = None, offset_relative: float = 0.0, sonification_duration: int | None = None, fading_duration: float = 0.05, normalize: bool = True, fs: int = 22050) ndarray [source]
Given multiple arrays in form of a list, this function creates the sonification of different sources.
- Parameters:
times_samples (List[Tuple[np.ndarray, np.ndarray]]) – List of tuples comprising the time positions and samples
offset_relative (float, default = 0.0) – Relative offset coefficient for the beginning of the given audio sample. 0 indicates that the beginning of the sample is at the time position. 1 indicates the ending of the sample corresponding to the time position.
sonification_duration (int, default = None) – Determines duration of sonification, in samples.
fading_duration (float, default = 0.05) – Determines duration of fade-in and fade-out at beginning and end of the sonification, in seconds.
normalize (bool, default = True) – Determines if output signal is max-normalized to [-1,1].
fs (int, default = 22050) – Sampling rate, in samples per seconds.
- Returns:
tse_sonification (np.ndarray (np.float32 / np.float64) [shape=(M, )]) – Sonified waveform in form of a 1D Numpy array.
- libsoni.core.tse.sonify_tse_sample(time_positions: ndarray | None = None, sample: ndarray | None = None, offset_relative: float = 0.0, sonification_duration: int | None = None, fading_duration: float = 0.05, normalize: bool = True, fs: int = 22050) ndarray [source]
Sonifies time positions with warped versions of a custom sample (e.g., metronome sounds).
- Parameters:
time_positions (np.ndarray (np.float32 / np.float64) [shape=(N, )]) – Array with time positions for clicks.
sample (np.ndarray (np.float32 / np.float64) [shape=(K, )]) – Sample to be used.
offset_relative (float, default = 0.0) – Relative offset coefficient for the beginning of a click. 0 indicates that the beginning of the click event is at the time position. 1 indicates the ending of the click event corresponds to the time position.
sonification_duration (int, default = None) – Determines duration of sonification, in samples.
fading_duration (float, default = 0.05) – Determines duration of fade-in and fade-out at beginning and end of the sonification, in seconds.
normalize (bool, default = True) – Determines if output signal is max-normalized to [-1,1].
fs (int, default = 22050) – Sampling rate, in samples per seconds.
- Returns:
tse_sonification (np.ndarray (np.float32 / np.float64) [shape=(M, )]) – Sonified time positions.