@@ -90,12 +90,13 @@ def __init__(
9090 ):
9191 """Initialize the SoundGeneratorStreamer. Generates sound blocks for streaming, without internal playback.
9292 Args:
93- wave_form (str): The type of wave form to generate. Supported values
94- are "sine" (default), "square", "triangle" and "sawtooth".
9593 bpm (int): The tempo in beats per minute for note duration calculations.
96- master_volume (float ): The master volume level (0.0 to 1.0 ).
94+ time_signature (tuple ): The time signature as (numerator, denominator ).
9795 octaves (int): Number of octaves to generate notes for (starting from octave
9896 0 up to octaves-1).
97+ wave_form (str): The type of wave form to generate. Supported values
98+ are "sine" (default), "square", "triangle" and "sawtooth".
99+ master_volume (float): The master volume level (0.0 to 1.0).
99100 sound_effects (list, optional): List of sound effect instances to apply to the audio
100101 signal (e.g., [SoundEffect.adsr()]). See SoundEffect class for available effects.
101102 """
@@ -258,6 +259,7 @@ def _apply_sound_effects(self, signal: np.ndarray, frequency: float) -> np.ndarr
258259 Apply the configured sound effects to the audio signal.
259260 Args:
260261 signal (np.ndarray): Input audio signal.
262+ frequency (float): Frequency of the note being played.
261263 Returns:
262264 np.ndarray: Processed audio signal with sound effects applied.
263265 """
@@ -312,7 +314,7 @@ def play_polyphonic(self, notes: list[list[tuple[str, float]]], as_tone: bool =
312314 if frequency >= 0.0 :
313315 if base_frequency is None :
314316 base_frequency = frequency
315- if as_tone == False :
317+ if not as_tone :
316318 duration = self ._note_duration (duration )
317319 data = self ._wave_gen .generate_block (float (frequency ), duration , volume )
318320 sequence_waves .append (data )
@@ -489,6 +491,7 @@ def __init__(
489491 0 up to octaves-1).
490492 sound_effects (list, optional): List of sound effect instances to apply to the audio
491493 signal (e.g., [SoundEffect.adsr()]). See SoundEffect class for available effects.
494+ time_signature (tuple): The time signature as (numerator, denominator).
492495 """
493496
494497 super ().__init__ (
@@ -511,12 +514,12 @@ def __init__(
511514 def start (self ):
512515 if self ._started .is_set ():
513516 return
514- if self .external_speaker == False :
517+ if not self .external_speaker :
515518 self ._output_device .start (notify_if_started = False )
516519 self ._started .set ()
517520
518521 def stop (self ):
519- if self .external_speaker == False :
522+ if not self .external_speaker :
520523 self ._output_device .stop ()
521524 self ._started .clear ()
522525
0 commit comments