Skip to main content

Module utils

Module utils 

Source
Expand description

Утилиты и вспомогательные функции Utility functions and helpers for the patchbay.

Provides value converters, metronome timing, note-type conversion, test helpers, and test-signal generation.

Structs§

EventRecorder
Records events for testing purposes.
Metronome
A metronome for synchronisation with BPM.
RecordedEvent
A single recorded event.
TestSignalGenerator
Generates test signals for verification and debugging.
TestSignalParams
Parameters for a test signal.
ValueConverter
Converts values between different scales using a specified transform.

Enums§

NoteType
A musical note type for duration calculations.
TestSignalType
Type of test signal.

Functions§

freq_to_midi_note
Convert a frequency in Hz to the nearest MIDI note number.
midi_note_to_freq
Convert a MIDI note number to frequency in Hz.
midi_to_normalized
Convert a MIDI value (0–127) to a normalised float (0.0–1.0).
normalized_to_midi
Convert a normalised float (0.0–1.0) to a MIDI value (0–127).
note_duration_to_seconds
Convert a note type to duration in seconds at the given BPM.