unreal.SoundUtilitiesBPFunctionLibrary

class unreal.SoundUtilitiesBPFunctionLibrary(outer=None, name='None')

Bases: unreal.BlueprintFunctionLibrary

Sound Utilities Blueprint Function Library A library of Sound related functions for use in Blueprints

C++ Source:

  • Plugin: SoundUtilities

  • Module: SoundUtilities

  • File: SoundUtilities.h

classmethod convert_decibels_to_linear(decibels)float

Converts decibel to linear scale

Parameters

decibels (float) – The decibels to convert to a linear gain scalar

Returns

The resulting linear gain

Return type

float

classmethod convert_linear_to_decibels(linear, floor)float

Converts linear scale volume to decibels

Parameters
  • linear (float) – The linear scalar value to convert to decibels

  • floor (float) – The floor value to check against

Returns

The decibel value of the inputted linear scale

Return type

float

classmethod get_bandwidth_from_q(q)float

Helper function to get bandwidth from Q

Parameters

q (float) – The Q value to convert to bandwidth

Returns

The bandwidth value that corresponds to the given Q value

Return type

float

classmethod get_beat_tempo(beats_per_minute=120.0, beat_multiplier=1, divisions_of_whole_note=4)float

Calculates a beat time in seconds from the given BPM, beat multiplier and divisions of a whole note.

Parameters
  • beats_per_minute (float) –

  • beat_multiplier (int32) –

  • divisions_of_whole_note (int32) –

Returns

Return type

float

classmethod get_frequency_from_midi_pitch(midi_note)float

Calculates Frequency values based on MIDI Pitch input

Parameters

midi_note (int32) – The MIDI note to calculate the frequency of

Returns

The frequency in Hz that corresponds to the MIDI input

Return type

float

classmethod get_frequency_multiplier_from_semitones(pitch_semitones)float

Returns the frequency multiplier to scale a base frequency given the input semitones

Parameters

pitch_semitones (float) – The amount of semitones to alter a frequency by

Returns

The frequency multiplier that corresponds to the given change in semitones

Return type

float

classmethod get_gain_from_midi_velocity(velocity)float

Given a velocity value [0,127], return the linear gain

Parameters

velocity (int32) – The MIDI velocity value to calculate the gain of

Returns

The gain corresponding to the MIDI value

Return type

float

classmethod get_linear_frequency_clamped(value, domain, range)float

Returns the linear frequency of the input value. Maps log domain and range values to linear output (good for linear slider representation/visualization of log frequency). Reverse of GetLogFrequencyClamped.

Parameters
  • value (float) – The logarithmic value to convert to linear frequency

  • domain (Vector2D) – The domain to use when converting between linear and logarithmic scales

  • range (Vector2D) – The range to use when converting between linear and logarithmic scales

Returns

The linear frequency of the given logarithmic input

Return type

float

classmethod get_log_frequency_clamped(value, domain, range)float

Returns the log frequency of the input value. Maps linear domain and range values to log output (good for linear slider controlling frequency)

Parameters
  • value (float) – The linear value to convert to logarithmic frequency

  • domain (Vector2D) – The domain to use when converting between linear and logarithmic scales

  • range (Vector2D) – The range to use when converting between linear and logarithmic scales

Returns

The log frequency of the given input

Return type

float

classmethod get_midi_pitch_from_frequency(frequency)int32

Calculates MIDI Pitch values based on frequency input

Parameters

frequency (float) – The frequency in Hz to convert into MIDI

Returns

The MIDI note closest to the inputted frequency

Return type

int32

classmethod get_pitch_scale_from_midi_pitch(base_midi_note, target_midi_note)float

Calculates Pitch Scalar based on starting frequency and desired MIDI Pitch output

Parameters
  • base_midi_note (int32) – The MIDI note corresponding to the starting frequency

  • target_midi_note (int32) – The MIDI note corresponding to the desired final frequency

Returns

The amount to scale the pitch of the base note by, in order for its pitch to match the target MIDI note

Return type

float

classmethod get_q_from_bandwidth(bandwidth)float

Helper function to get Q from bandwidth

Parameters

bandwidth (float) – The bandwidth value to convert to Q

Returns

The Q value that corresponds to the given bandwidth value

Return type

float