Inter-onset interval

Full module path: melody_features.feature_definitions.inter_onset_interval.

Also importable via import melody_features as mf (for example mf.pitch_range).

Inter-onset interval feature definitions.

ioi(starts)[source]

The sequence of inter-onset intervals.

An inter-onset interval (IOI) is the elapsed time from one note onset to the next note onset. Unlike note duration, it includes any overlap or silence between consecutive notes because it depends only on onset times.

Parameters:

starts (list[float]) – List of note start times

Returns:

List of time intervals between consecutive onsets

Return type:

list[float]

ioi_mean(starts)[source]

The arithmetic mean of inter-onset intervals.

Parameters:

starts (list[float]) – List of note start times

Returns:

Mean of inter-onset intervals

Return type:

float

Note

This is called average_time_between_attacks in jSymbolic.

ioi_standard_deviation(starts)[source]

The standard deviation of inter-onset intervals.

Parameters:

starts (list[float]) – List of note start times

Returns:

Standard deviation of inter-onset intervals

Return type:

float

Note

This is called variability_of_time_between_attacks in jSymbolic.

ioi_ratio(starts)[source]

The sequence of ratios between successive inter-onset intervals.

First, consecutive onset times are converted to inter-onset intervals (IOIs). Each output value is then IOI[i] / IOI[i - 1]. Values greater than 1 indicate that the current onset gap is longer than the previous one, values less than 1 indicate a shorter gap, and 1 indicates no change.

Parameters:

starts (list[float]) – List of note start times

Returns:

Sequence of IOI ratios

Return type:

list[float]

ioi_ratio_mean(starts)[source]

The arithmetic mean of successive inter-onset interval ratios.

The ratio sequence is computed as IOI[i] / IOI[i - 1] for each pair of adjacent inter-onset intervals. This summary is above 1 when IOIs tend to lengthen, below 1 when they tend to shorten, and close to 1 when adjacent IOIs tend to have similar lengths.

Parameters:

starts (list[float]) – List of note start times

Returns:

Mean of IOI ratios

Return type:

float

ioi_ratio_standard_deviation(starts)[source]

The sample standard deviation of successive inter-onset interval ratios.

This feature measures the variability of IOI[i] / IOI[i - 1] across the melody. Larger values indicate less regular proportional change between neighboring onset gaps.

Parameters:

starts (list[float]) – List of note start times

Returns:

Standard deviation of IOI ratios

Return type:

float

ioi_range(starts)[source]

The range of inter-onset intervals.

Parameters:

starts (list[float]) – List of note start times

Returns:

Range of inter-onset intervals (0.0 if fewer than two onsets)

Return type:

float

ioi_contour(starts)[source]

The sequence of IOI-ratio contour values (-1: shorter, 0: same, 1: longer).

Parameters:

starts (list[float]) – List of note start times

Returns:

Sequence of contour values

Return type:

list[int]

Note

This contour is computed from ratios of consecutive IOIs, so it requires at least three onsets.

ioi_contour_mean(starts)[source]

The arithmetic mean of ordinal IOI contour values.

IOI contour values are -1 for shorter, 0 for unchanged, and 1 for longer successive inter-onset intervals. The mean summarizes the balance of lengthening versus shortening onset gaps.

Parameters:

starts (list[float]) – List of note start times

Returns:

Mean of contour values

Return type:

float

ioi_contour_standard_deviation(starts)[source]

The sample standard deviation of ordinal IOI contour values.

IOI contour values encode whether successive inter-onset intervals shorten, stay the same, or lengthen. This feature measures how variable those ordinal changes are across the melody.

Parameters:

starts (list[float]) – List of note start times

Returns:

Standard deviation of contour values

Return type:

float

ioi_histogram(starts)[source]

A histogram of inter-onset intervals.

Parameters:

starts (list[float]) – List of note start times

Returns:

Histogram of inter-onset intervals

Return type:

dict