Skip to content

Commit f1553ed

Browse files
committed
Code lint
1 parent ca9e9f6 commit f1553ed

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

src/arduino/app_bricks/sound_generator/__init__.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

src/arduino/app_bricks/sound_generator/effects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def __init__(self, bits: int = 4, reduction: int = 4):
178178
"""
179179
Bitcrusher effect.
180180
Args:
181-
bit_depth (int): Number of bits for quantization (1-16).
181+
bits (int): Bit depth for quantization (1-16).
182182
reduction (int): Redeuction factor for downsampling (>=1).
183183
"""
184184
self.bit_depth = np.clip(bits, 1, 16)

tests/arduino/app_bricks/sound_generator/test_effects.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#
33
# SPDX-License-Identifier: MPL-2.0
44

5-
import pytest
65
from arduino.app_bricks.sound_generator.effects import SoundEffect
76
from arduino.app_bricks.sound_generator import SoundGenerator
87
from arduino.app_utils.audio import WaveGenerator

0 commit comments

Comments
 (0)