VEX IQ Python API
|
Public Member Functions | |
def | __init__ (self) |
def | play (self, note, octave=3, duration=0.5, timeUnits=TimeUnits.SEC) |
Play a musical note on the speaker. More... | |
def | play_raw (self, note, duration=0.5, timeUnits=TimeUnits.SEC) |
Play a musical note on the speaker. More... | |
def | play_wave (self, waveType, waitForCompletion=True) |
play the wave sample More... | |
def | play_melody (self, melody) |
Play a melody form a string in a quasi musical alphabet notiation (cdefgab) More... | |
def | set_sound_effect (self, effect) |
set the sound effect type for subsequent notes played More... | |
def | set_volume (self, volume) |
set the sound volume [1-4] More... | |
def | stop (self) |
Stop playing music. More... | |
def vex.BrainSound.__init__ | ( | self | ) |
def vex.BrainSound.play | ( | self, | |
note, | |||
octave = 3 , |
|||
duration = 0.5 , |
|||
timeUnits = TimeUnits.SEC |
|||
) |
Play a musical note on the speaker.
note | musical note to play: NoteType enum value |
octave | octave of the note [1-7], optional |
duration | time. 0 to start playing without blocking. Default 0.5 |
timeUnits | of time for the duration. Default sec. |
def vex.BrainSound.play_raw | ( | self, | |
note, | |||
duration = 0.5 , |
|||
timeUnits = TimeUnits.SEC |
|||
) |
Play a musical note on the speaker.
note | musical note to play: 0=silence/stop, [1-56] numeric value |
duration | time. 0 to start playing without blocking. Default 0.5 |
timeUnits | of time for the duration. Default sec. |
def vex.BrainSound.play_wave | ( | self, | |
waveType, | |||
waitForCompletion = True |
|||
) |
play the wave sample
waveType | type of the wave sample sound to play [0..15] |
waitForCompletion | wait for the sample to finish playing |
def vex.BrainSound.play_melody | ( | self, | |
melody | |||
) |
Play a melody form a string in a quasi musical alphabet notiation (cdefgab)
melody | string [cdefgab]: musical alphabet for notes, space: pause, +/-: increase/decrease octave of following notes 0-9: set duration of following notes (in 1/8s: 1=eighth note...8 = full note) |
def vex.BrainSound.set_sound_effect | ( | self, | |
effect | |||
) |
set the sound effect type for subsequent notes played
effect | effect type [0..15] |
def vex.BrainSound.set_volume | ( | self, | |
volume | |||
) |
set the sound volume [1-4]
volume | value [1=low...4=high] |
def vex.BrainSound.stop | ( | self | ) |
Stop playing music.