From d52d56df0da239497c0c0fbf44bb0c1ad5c90bb9 Mon Sep 17 00:00:00 2001 From: Vexatos Date: Wed, 30 Apr 2014 09:31:06 -0700 Subject: [PATCH] Updated API Note (markdown) --- API-Note.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/API-Note.md b/API-Note.md index 4732c15..874ca5e 100644 --- a/API-Note.md +++ b/API-Note.md @@ -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). -- `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.freq(n: number or string)`: Converts a note in string form (e.g. A#4) or a given MIDI code into the respective frequency -- `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.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 -- `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.midi(n: number or string): number` +Converts a note in string form (e.g. A#4 or Gb3, see below) or a given frequency into the respective MIDI code +- `note.freq(n: number or string): number` +Converts a note in string form (e.g. A#4) or a given MIDI code into the respective frequency +- `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 The available string names, their respective MIDI code and their frequency are shown here: