Vexatos 9 Posted May 3, 2014 Share Posted May 3, 2014 Basically, this API provides a single function: song.play(notes: table or string,shortest: number) Input being either a table or a string. Using a table, each note-duration combination is a string in a table value. The function will iterate through every entry of the table and play all the notes with their specified duration. Using a string, every note-duration combination is seperated by a free space " ". Regarding the special syntax used, this is copied from the header of the song API: Examples: "E5": Plays the note "E5" for the duration specified in the second parameter (default 0.125, equaling 120 bpm) "-E5": Plays the note "E5" with double the specified duration "E5_4": Plays the note "E5" with 4 times the specified duration, change "4" to any number x to play the note x times the duration specified "P_4": Plays a pause with 4 times the specified duration, change "4" to any number x to play the note x times the duration specified For note names, use the syntax of the strings of the Note API If you haven't already guessed, you require the note API for this to work, just run "pastebin get XwLD0xa8 note" inside the folder you are going to have the song API in. This method utilizes the Note API which is now natively included in OpenComputers. To get the song API, install it via OPPM using "oppm install song" or run "pastebin get R88y1eD2 song". Find the song API on OpenPrograms, at https://github.com/OpenPrograms/Vexatos-Programs/tree/master/song. For an example song, check out the github folder linked, or, alternatively, run "pastebin get i1YC56vJ example" in your computer console and run "example" then. I hope you have fun with the API. Feel free to post any songs you make in the section below! Sincerely, Vexatos Quote Link to post Share on other sites
Cat 3 Posted November 13, 2014 Share Posted November 13, 2014 Nice work. Using computer.beep might be sloppy sound wise but hey, it's a bit creative to use what you have to make things fun. Quote Link to post Share on other sites