neulab/docprompting-conala huggingface dataset:
note_on() 
 turns a midi note on (note must be off) note_on(note, velocity=None, channel=0) -> None  Turn a note on in the output stream. The note must already be off for this to work correctly.
pitch_bend() 
 modify the pitch of a channel. set_instrument(value=0, channel=0) -> None  Adjust the pitch of a channel. The value is a signed integer from -8192 to +8191. For example, 0 means "no change", +4096 is typically a semitone higher, and -8192 is 1 whole tone lower (though the musical range corresponding to the pitch bend range can also be changed in some synthesizers). If no value is given, the pitch bend is returned to "no change".  New in pygame 1.9.4.
set_instrument() 
 select an instrument, with a value between 0 and 127 set_instrument(instrument_id, channel=0) -> None  Select an instrument.
write() 
 writes a list of midi data to the Output write(data) -> None  Writes series of MIDI information in the form of a list.     
Parameters:

data (list) -- data to write, the expected format is [[[status, data1=0, data2=0, ...], timestamp], ...] with the data# fields being optional  
Raises:

IndexError -- if more than 1024 elements in the data list    Example: # Program change at time 20000 and 500ms later send note 65 with
# velocity 100.
write([[[0xc0, 0, 0], 20000], [[0x90, 60, 100], 20500]])  Note  Timestamps will be ignored if latency = 0 To get a note to play immediately, send MIDI info with timestamp read from function Time Optional data fields: write([[[0xc0, 0, 0], 20000]]) is equivalent to write([[[0xc0], 20000]])
write_short() 
 writes up to 3 bytes of midi data to the Output write_short(status) -> None write_short(status, data1=0, data2=0) -> None  Output MIDI information of 3 bytes or less. The data fields are optional and assumed to be 0 if omitted. Examples of status byte values: 0xc0  # program change
0x90  # note on
# etc. Example: # note 65 on with velocity 100
write_short(0x90, 65, 100)
write_sys_ex() 
 writes a timestamped system-exclusive midi message. write_sys_ex(when, msg) -> None  Writes a timestamped system-exclusive midi message.     
Parameters:

 
msg (list[int] or str) -- midi message 
when -- timestamp in milliseconds      Example: midi_output.write_sys_ex(0, '\xF0\x7D\x10\x11\x12\x13\xF7')

# is equivalent to

midi_output.write_sys_ex(pygame.midi.time(),
                         [0xF0, 0x7D, 0x10, 0x11, 0x12, 0x13, 0xF7])
pygame.midi.quit() 
 uninitialize the midi module quit() -> None  Uninitializes the pygame.midi module. If pygame.midi.init() was called to initialize the pygame.midi module, then this function will be called automatically when your program exits. It is safe to call this function more than once.
pygame.midi.time() 
 returns the current time in ms of the PortMidi timer time() -> time  The time is reset to 0 when the pygame.midi module is initialized.
fadeout() 
 stop playback after fading channel out fadeout(time) -> None  Stop playback of a channel after fading out the sound over the given time argument in milliseconds.
get_busy() 
 check if the channel is active get_busy() -> bool  Returns True if the channel is actively mixing sound. If the channel is idle this returns False.
get_endevent() 
 get the event a channel sends when playback stops get_endevent() -> type  Returns the event type to be sent every time the Channel finishes playback of a Sound. If there is no endevent the function returns pygame.NOEVENT.
get_queue() 
 return any Sound that is queued get_queue() -> Sound  If a Sound is already queued on this channel it will be returned. Once the queued sound begins playback it will no longer be on the queue.
get_sound() 
 get the currently playing Sound get_sound() -> Sound  Return the actual Sound object currently playing on this channel. If the channel is idle None is returned.
get_volume() 
 get the volume of the playing channel get_volume() -> value  Return the volume of the channel for the current playing sound. This does not take into account stereo separation used by Channel.set_volume(). The Sound object also has its own volume which is mixed with the channel.
pause() 
 temporarily stop playback of a channel pause() -> None  Temporarily stop the playback of sound on a channel. It can be resumed at a later time with Channel.unpause()
play() 
 play a Sound on a specific Channel play(Sound, loops=0, maxtime=0, fade_ms=0) -> None  This will begin playback of a Sound on a specific Channel. If the Channel is currently playing any other Sound it will be stopped. The loops argument has the same meaning as in Sound.play(): it is the number of times to repeat the sound after the first time. If it is 3, the sound will be played 4 times (the first time, then three more). If loops is -1 then the playback will repeat indefinitely. As in Sound.play(), the maxtime argument can be used to stop playback of the Sound after a given number of milliseconds. As in Sound.play(), the fade_ms argument can be used fade in the sound.
queue() 
 queue a Sound object to follow the current queue(Sound) -> None  When a Sound is queued on a Channel, it will begin playing immediately after the current Sound is finished. Each channel can only have a single Sound queued at a time. The queued Sound will only play if the current playback finished automatically. It is cleared on any other call to Channel.stop() or Channel.play(). If there is no sound actively playing on the Channel then the Sound will begin playing immediately.
set_endevent() 
 have the channel send an event when playback stops set_endevent() -> None set_endevent(type) -> None  When an endevent is set for a channel, it will send an event to the pygame queue every time a sound finishes playing on that channel (not just the first time). Use pygame.event.get() to retrieve the endevent once it's sent. Note that if you called Sound.play(n) or Channel.play(sound,n), the end event is sent only once: after the sound has been played "n+1" times (see the documentation of Sound.play). If Channel.stop() or Channel.play() is called while the sound was still playing, the event will be posted immediately. The type argument will be the event id sent to the queue. This can be any valid event type, but a good choice would be a value between pygame.locals.USEREVENT and pygame.locals.NUMEVENTS. If no type argument is given then the Channel will stop sending endevents.
set_volume() 
 set the volume of a playing channel set_volume(value) -> None set_volume(left, right) -> None  Set the volume (loudness) of a playing sound. When a channel starts to play its volume value is reset. This only affects the current sound. The value argument is between 0.0 and 1.0. If one argument is passed, it will be the volume of both speakers. If two arguments are passed and the mixer is in stereo mode, the first argument will be the volume of the left speaker and the second will be the volume of the right speaker. (If the second argument is None, the first argument will be the volume of both speakers.) If the channel is playing a Sound on which set_volume() has also been called, both calls are taken into account. For example: sound = pygame.mixer.Sound("s.wav")
channel = s.play()      # Sound plays at full volume by default
sound.set_volume(0.9)   # Now plays at 90% of full volume.
sound.set_volume(0.6)   # Now plays at 60% (previous value replaced).
channel.set_volume(0.5) # Now plays at 30% (0.6 * 0.5).
stop() 
 stop playback on a Channel stop() -> None  Stop sound playback on a channel. After playback is stopped the channel becomes available for new Sounds to play on it.
unpause() 
 resume pause playback of a channel unpause() -> None  Resume the playback on a paused channel.
pygame.mixer.fadeout() 
 fade out the volume on all sounds before stopping fadeout(time) -> None  This will fade out the volume on all active channels over the time argument in milliseconds. After the sound is muted the playback will stop.
pygame.mixer.find_channel() 
 find an unused channel find_channel(force=False) -> Channel  This will find and return an inactive Channel object. If there are no inactive Channels this function will return None. If there are no inactive channels and the force argument is True, this will find the Channel with the longest running Sound and return it. If the mixer has reserved channels from pygame.mixer.set_reserved() then those channels will not be returned here.
pygame.mixer.get_busy() 
 test if any sound is being mixed get_busy() -> bool  Returns True if the mixer is busy mixing any channels. If the mixer is idle then this return False.
pygame.mixer.get_init() 
 test if the mixer is initialized get_init() -> (frequency, format, channels)  If the mixer is initialized, this returns the playback arguments it is using. If the mixer has not been initialized this returns None.
pygame.mixer.get_num_channels() 
 get the total number of playback channels get_num_channels() -> count  Returns the number of currently active playback channels.
pygame.mixer.get_sdl_mixer_version() 
 get the mixer's SDL version get_sdl_mixer_version() -> (major, minor, patch) get_sdl_mixer_version(linked=True) -> (major, minor, patch)      
Parameters:

linked (bool) -- if True (default) the linked version number is returned, otherwise the compiled version number is returned  
Returns:
the mixer's SDL library version number (linked or compiled depending on the linked parameter) as a tuple of 3 integers (major, minor, patch)
  
Return type:
tuple     Note The linked and compile version numbers should be the same.   New in pygame 2.0.0.
pygame.mixer.init() 
 initialize the mixer module init(frequency=44100, size=-16, channels=2, buffer=512, devicename=None, allowedchanges=AUDIO_ALLOW_FREQUENCY_CHANGE | AUDIO_ALLOW_CHANNELS_CHANGE) -> None  Initialize the mixer module for Sound loading and playback. The default arguments can be overridden to provide specific audio mixing. Keyword arguments are accepted. For backward compatibility where an argument is set zero the default value is used (possible changed by a pre_init call). The size argument represents how many bits are used for each audio sample. If the value is negative then signed sample values will be used. Positive values mean unsigned audio samples will be used. An invalid value raises an exception. The channels argument is used to specify whether to use mono or stereo. 1 for mono and 2 for stereo. The buffer argument controls the number of internal samples used in the sound mixer. The default value should work for most cases. It can be lowered to reduce latency, but sound dropout may occur. It can be raised to larger values to ensure playback never skips, but it will impose latency on sound playback. The buffer size must be a power of two (if not it is rounded up to the next nearest power of 2). Some platforms require the pygame.mixer module to be initialized after the display modules have initialized. The top level pygame.init() takes care of this automatically, but cannot pass any arguments to the mixer init. To solve this, mixer has a function pygame.mixer.pre_init() to set the proper defaults before the toplevel init is used. When using allowedchanges=0 it will convert the samples at runtime to match what the hardware supports. For example a sound card may not support 16bit sound samples, so instead it will use 8bit samples internally. If AUDIO_ALLOW_FORMAT_CHANGE is supplied, then the requested format will change to the closest that SDL2 supports. Apart from 0, allowedchanged accepts the following constants ORed together:  
 AUDIO_ALLOW_FREQUENCY_CHANGE AUDIO_ALLOW_FORMAT_CHANGE AUDIO_ALLOW_CHANNELS_CHANGE AUDIO_ALLOW_ANY_CHANGE  
 It is safe to call this more than once, but after the mixer is initialized you cannot change the playback arguments without first calling pygame.mixer.quit().  Changed in pygame 1.8: The default buffersize was changed from 1024 to 3072.   Changed in pygame 1.9.1: The default buffersize was changed from 3072 to 4096.   Changed in pygame 2.0.0: The default buffersize was changed from 4096 to 512. The default frequency changed to 44100 from 22050.   Changed in pygame 2.0.0: size can be 32 (32bit floats).   Changed in pygame 2.0.0: channels can also be 4 or 6.   New in pygame 2.0.0: allowedchanges argument added
pygame.mixer.music.fadeout() 
 stop music playback after fading out fadeout(time) -> None  Fade out and stop the currently playing music. The time argument denotes the integer milliseconds for which the fading effect is generated. Note, that this function blocks until the music has faded out. Calls to fadeout() and set_volume() will have no effect during this time. If an event was set using set_endevent() it will be called after the music has faded.
pygame.mixer.music.get_busy() 
 check if the music stream is playing get_busy() -> bool  Returns True when the music stream is actively playing. When the music is idle this returns False. In pygame 2.0.1 and above this function returns False when the music is paused. In pygame 1 it returns True when the music is paused.  Changed in pygame 2.0.1: Returns False when music paused.
pygame.mixer.music.get_endevent() 
 get the event a channel sends when playback stops get_endevent() -> type  Returns the event type to be sent every time the music finishes playback. If there is no endevent the function returns pygame.NOEVENT.
pygame.mixer.music.get_pos() 
 get the music play time get_pos() -> time  This gets the number of milliseconds that the music has been playing for. The returned time only represents how long the music has been playing; it does not take into account any starting position offsets.
pygame.mixer.music.get_volume() 
 get the music volume get_volume() -> value  Returns the current volume for the mixer. The value will be between 0.0 and 1.0.
pygame.mixer.music.load() 
 Load a music file for playback load(filename) -> None load(object) -> None  This will load a music filename/file object and prepare it for playback. If a music stream is already playing it will be stopped. This does not start the music playing.
pygame.mixer.music.pause() 
 temporarily stop music playback pause() -> None  Temporarily stop playback of the music stream. It can be resumed with the pygame.mixer.music.unpause() function.
pygame.mixer.music.play() 
 Start the playback of the music stream play(loops=0, start=0.0, fade_ms = 0) -> None  This will play the loaded music stream. If the music is already playing it will be restarted. loops is an optional integer argument, which is 0 by default, it tells how many times to repeat the music. The music repeats indefinately if this argument is set to -1. start is an optional float argument, which is 0.0 by default, which denotes the position in time, the music starts playing from. The starting position depends on the format of the music played. MP3 and OGG use the position as time in seconds. For mp3s the start time position selected may not be accurate as things like variable bit rate encoding and ID3 tags can throw off the timing calculations. For MOD music it is the pattern order number. Passing a start position will raise a NotImplementedError if the start position cannot be set. fade_ms is an optional integer argument, which is 0 by default, makes the music start playing at 0 volume and fade up to full volume over the given time. The sample may end before the fade-in is complete.  Changed in pygame 2.0.0: Added optional fade_ms argument
pygame.mixer.music.queue() 
 queue a sound file to follow the current queue(filename) -> None  This will load a sound file and queue it. A queued sound file will begin as soon as the current sound naturally ends. Only one sound can be queued at a time. Queuing a new sound while another sound is queued will result in the new sound becoming the queued sound. Also, if the current sound is ever stopped or changed, the queued sound will be lost. The following example will play music by Bach six times, then play music by Mozart once: pygame.mixer.music.load('bach.ogg')
pygame.mixer.music.play(5)        # Plays six times, not five!
pygame.mixer.music.queue('mozart.ogg')
pygame.mixer.music.rewind() 
 restart music rewind() -> None  Resets playback of the current music to the beginning.
pygame.mixer.music.set_endevent() 
 have the music send an event when playback stops set_endevent() -> None set_endevent(type) -> None  This causes pygame to signal (by means of the event queue) when the music is done playing. The argument determines the type of event that will be queued. The event will be queued every time the music finishes, not just the first time. To stop the event from being queued, call this method with no argument.
pygame.mixer.music.set_pos() 
 set position to play from set_pos(pos) -> None  This sets the position in the music file where playback will start. The meaning of "pos", a float (or a number that can be converted to a float), depends on the music format. For MOD files, pos is the integer pattern number in the module. For OGG it is the absolute position, in seconds, from the beginning of the sound. For MP3 files, it is the relative position, in seconds, from the current position. For absolute positioning in an MP3 file, first call rewind(). Other file formats are unsupported. Newer versions of SDL_mixer have better positioning support than earlier ones. An SDLError is raised if a particular format does not support positioning. Function set_pos() calls underlining SDL_mixer function Mix_SetMusicPosition.  New in pygame 1.9.2.
pygame.mixer.music.set_volume() 
 set the music volume set_volume(volume) -> None  Set the volume of the music playback. The volume argument is a float between 0.0 and 1.0 that sets volume. When new music is loaded the volume is reset to full volume.
pygame.mixer.music.stop() 
 stop the music playback stop() -> None  Stops the music playback if it is currently playing. It Won't Unload the music.
pygame.mixer.music.unload() 
 Unload the currently loaded music to free up resources unload() -> None  This closes resources like files for any music that may be loaded.  New in pygame 2.0.0.
pygame.mixer.music.unpause() 
 resume paused music unpause() -> None  This will resume the playback of a music stream after it has been paused.
pygame.mixer.pause() 
 temporarily stop playback of all sound channels pause() -> None  This will temporarily stop all playback on the active mixer channels. The playback can later be resumed with pygame.mixer.unpause()
pygame.mixer.pre_init() 
 preset the mixer init arguments pre_init(frequency=44100, size=-16, channels=2, buffer=512, devicename=None) -> None  Call pre_init to change the defaults used when the real pygame.mixer.init() is called. Keyword arguments are accepted. The best way to set custom mixer playback values is to call pygame.mixer.pre_init() before calling the top level pygame.init(). For backward compatibility argument values of zero are replaced with the startup defaults.  Changed in pygame 1.8: The default buffersize was changed from 1024 to 3072.   Changed in pygame 1.9.1: The default buffersize was changed from 3072 to 4096.   Changed in pygame 2.0.0: The default buffersize was changed from 4096 to 512. The default frequency changed to 44100 from 22050.
pygame.mixer.quit() 
 uninitialize the mixer quit() -> None  This will uninitialize pygame.mixer. All playback will stop and any loaded Sound objects may not be compatible with the mixer if it is reinitialized later.
pygame.mixer.set_num_channels() 
 set the total number of playback channels set_num_channels(count) -> None  Sets the number of available channels for the mixer. The default value is 8. The value can be increased or decreased. If the value is decreased, sounds playing on the truncated channels are stopped.
pygame.mixer.set_reserved() 
 reserve channels from being automatically used set_reserved(count) -> None  The mixer can reserve any number of channels that will not be automatically selected for playback by Sounds. If sounds are currently playing on the reserved channels they will not be stopped. This allows the application to reserve a specific number of channels for important sounds that must not be dropped or have a guaranteed channel to play on.
fadeout() 
 stop sound playback after fading out fadeout(time) -> None  This will stop playback of the sound after fading it out over the time argument in milliseconds. The Sound will fade and stop on all actively playing channels.
get_length() 
 get the length of the Sound get_length() -> seconds  Return the length of this Sound in seconds.
get_num_channels() 
 count how many times this Sound is playing get_num_channels() -> count  Return the number of active channels this sound is playing on.
get_raw() 
 return a bytestring copy of the Sound samples. get_raw() -> bytes  Return a copy of the Sound object buffer as a bytes (for Python 3.x) or str (for Python 2.x) object.  New in pygame 1.9.2.
get_volume() 
 get the playback volume get_volume() -> value  Return a value from 0.0 to 1.0 representing the volume for this Sound.
play() 
 begin sound playback play(loops=0, maxtime=0, fade_ms=0) -> Channel  Begin playback of the Sound (i.e., on the computer's speakers) on an available Channel. This will forcibly select a Channel, so playback may cut off a currently playing sound if necessary. The loops argument controls how many times the sample will be repeated after being played the first time. A value of 5 means that the sound will be played once, then repeated five times, and so is played a total of six times. The default value (zero) means the Sound is not repeated, and so is only played once. If loops is set to -1 the Sound will loop indefinitely (though you can still call stop() to stop it). The maxtime argument can be used to stop playback after a given number of milliseconds. The fade_ms argument will make the sound start playing at 0 volume and fade up to full volume over the time given. The sample may end before the fade-in is complete. This returns the Channel object for the channel that was selected.
set_volume() 
 set the playback volume for this Sound set_volume(value) -> None  This will set the playback volume (loudness) for this Sound. This will immediately affect the Sound if it is playing. It will also affect any future playback of this Sound.     
Parameters:

value (float) -- volume in the range of 0.0 to 1.0 (inclusive)  If value < 0.0, the volume will not be changed If value > 1.0, the volume will be set to 1.0
stop() 
 stop sound playback stop() -> None  This will stop the playback of this Sound on any active Channels.
pygame.mixer.stop() 
 stop playback of all sound channels stop() -> None  This will stop all playback of all active mixer channels.
pygame.mixer.unpause() 
 resume paused playback of sound channels unpause() -> None  This will resume all active sound channels after they have been paused.