Updated API Note (markdown)

Vexatos 2014-04-30 09:31:06 -07:00
parent 9c1101c35e
commit d52d56df0d

@ -1,10 +1,15 @@
This API provides functionality to convert music notes into their respective MIDI code and/or their frequency in Hertz, among other things. It it used in combination with computer.beep and note blocks (using OpenComponents). This API provides functionality to convert music notes into their respective MIDI code and/or their frequency in Hertz, among other things. It it used in combination with computer.beep and note blocks (using OpenComponents).
- `note.midi(n: number or string)`: Converts a note in string form (e.g. A#4 or Gb3, see below) or a given frequency into the respective MIDI code - `note.midi(n: number or string): number`
- `note.freq(n: number or string)`: Converts a note in string form (e.g. A#4) or a given MIDI code into the respective frequency Converts a note in string form (e.g. A#4 or Gb3, see below) or a given frequency into the respective MIDI code
- `note.name(n: number)`: Converts a MIDI value back into a string; if you have a frequency to convert, just use `note.get(note.midi(frequency))` - `note.freq(n: number or string): number`
- `note.ticks(n: number)`: Converts note block ticks (0-24) into MIDI code (34-58, respectively) and vice-versa. Useful for use with note blocks and OpenComponents Converts a note in string form (e.g. A#4) or a given MIDI code into the respective frequency
- `note.play(tone: string or number,duration: number)`: Plays a note from a string or MIDI code via computer.beep with the specified duration - `note.name(n: number): string`
Converts a MIDI value back into a string; if you have a frequency to convert, just use `note.get(note.midi(frequency))`
- `note.ticks(n: number): number`
Converts note block ticks (0-24) into MIDI code (34-58, respectively) and vice-versa. Useful for use with Note Blocks and OpenComponents
- `note.play(tone: string or number,duration: number)`
Plays a note from a string or MIDI code via computer.beep with the specified duration
###Available notes ###Available notes
The available string names, their respective MIDI code and their frequency are shown here: The available string names, their respective MIDI code and their frequency are shown here: