def play_tone(self, pin, tone_command, frequency, duration):
<EOL>if tone_command == self.TONE_TONE:<EOL><INDENT>if duration:<EOL><INDENT>data = [tone_command, pin, frequency & <NUM_LIT>, (frequency >> <NUM_LIT:7>) & <NUM_LIT>, duration & <NUM_LIT>, (duration >> <NUM_LIT:7>) & <NUM_LIT>]<EOL><DEDENT>else:<EOL><INDENT>data = [tone_command, pin, frequency & <NUM_LIT>, (frequency >> <NUM_LIT:7>) & <NUM_LIT>, <NUM_LIT:0>, <NUM_LIT:0>]<EOL><DEDENT>self._command_handler.digital_response_table[pin][self._command_handler.RESPONSE_TABLE_MODE] =self.TONE<EOL><DEDENT>else:<EOL><INDENT>data = [tone_command, pin]<EOL><DEDENT>self._command_handler.send_sysex(self._command_handler.TONE_PLAY, data)<EOL>
This method will call the Tone library for the selected pin.
If the tone command is set to TONE_TONE, then the specified tone will be played.
Else, if the tone command is TONE_NO_TONE, then any currently playing tone will be disabled.
It is intended for a future release of Arduino Firmata

:param pin: Pin number

:param tone_command: Either TONE_TONE, or TONE_NO_TONE

:param frequency: Frequency of tone in hz

:param duration: Duration of tone in milliseconds

:return: No return value