mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-12 16:57:32 -04:00
Updated API Note (markdown)
parent
9c1101c35e
commit
d52d56df0d
15
API-Note.md
15
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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user