song_match.cube¶
song_match.cube.note_cube¶
Module containing NoteCube
.
-
class
song_match.cube.note_cube.
NoteCube
(cube: cozmo.objects.LightCube, song: song_match.song.song.Song)[source]¶ Bases:
object
Wrapper class for a
LightCube
to play a note when tapped.-
blink_and_play_note
(blink_duration=0.125) → None[source]¶ Blink the cube and play the corresponding note.
Parameters: blink_duration – How long the cube blinks for in seconds. Returns: None
-
flash
(light: cozmo.lights.Light, num_times: int, delay=0.15) → None[source]¶ Flash a light a certain number of times.
Parameters: - light – The light to flash.
- num_times – The number of times to flash the light.
- delay – Time in seconds between turning the light on and off.
Returns: None
-
classmethod
of
(song_robot, cube_id: int) → song_match.cube.note_cube.NoteCube[source]¶ Static factory method for creating a
NoteCube
fromSongRobot
.Parameters:
-
set_lights
(light: cozmo.lights.Light) → None[source]¶ Wrapper method for
set_lights()
.Returns: None
-
set_lights_off
() → None[source]¶ Wrapper method for
set_lights_off()
.Returns: None
-
song_match.cube.note_cubes¶
Module containing NoteCubes
.
-
class
song_match.cube.note_cubes.
NoteCubes
(note_cubes: List[song_match.cube.note_cube.NoteCube], song: song_match.song.song.Song)[source]¶ Bases:
object
Container class for three
NoteCube
.-
flash_lights
(num_times: int = 4, delay=0.15) → None[source]¶ Flash the lights of each cube.
Parameters: - num_times – The number of times to flash lights.
- delay – Time in seconds between turning the light on and off.
Returns: None
-
flash_lights_green
(num_times: int = 3, delay=0.15) → None[source]¶ Flash the lights of each cube green.
Parameters: - num_times – The number of times to flash green.
- delay – Time in seconds between turning the light on and off.
Returns: None
-
flash_single_cube
(cube_id: int, light: cozmo.lights.Light) → None[source]¶ Flashes the light of a single cube, while turning the lights of the other cubes off.
Parameters: Returns: None
-
flash_single_cube_green
(cube_id: int) → None[source]¶ Convenience method for calling
flash_single_cube()
with agreen_light
.Parameters: cube_id – cube_id
Returns: None
-
flash_single_cube_red
(cube_id: int) → None[source]¶ Convenience method for calling
flash_single_cube()
with ared_light
.Parameters: cube_id – cube_id
Returns: None
-
static
of
() → song_match.cube.note_cubes.NoteCubes[source]¶ Static factory method for creating
NoteCubes
fromSongRobot
.Parameters: song_robot – SongRobot
-
set_lights
(light: cozmo.lights.Light) → None[source]¶ Call
set_lights()
for each cube.Parameters: light – Light
Returns: None
-
set_lights_off
() → None[source]¶ Call
set_lights_off()
for each cube.Returns: None
-
start_and_stop_light_chasers
(time_before_stop=2) → None[source]¶ Starts and stops the light chaser effect for each cube.
Parameters: time_before_stop – Time to wait before the light chaser effect stops (in seconds). Returns: None
-