====== PLAY ====== /* Remove the comments after creating content for each section.*/ Plays a tune described by a MIDI-ish "musical macro language", a string of octaves, notes, volumes, etc. Alternatively, controls event triggering from this musical score. Can also be used as a function, but return type and values are implementation-dependent. /* For the lines below, just create links, separated by commas, to other pages of the BASICs section, like [[:basics:basicTagName]]. "Implemented by" should mention BASICs which implement the keyword like described, in a more usual and standard way. "With variations" should point to BASICs where this keyword is used a bit differently. "Also written as" should list alternative spellings and abbreviations this keyword has. No need to refer to a BASIC, there is a section for that later. */ **Implemented by:** [[:basics:CBM:cbmv7]], [[:basics:trscolor:colorext]], [[:basics:GWBASIC:]], [[:basics:VBDOS:]] **With variations:** [[:basics:CBM:Simons1]], [[:basics:MSX:]] (uses macro language), [[:basics:msqb:QBasic]] (with ON/OFF/STOP and macro language; also as function and as [[ON]] PLAY [[GOSUB]]), [[:basics:ugBASIC:]] (note, duration, channels; also with OFF) **Also written as: ** ===== Usage ===== /* For inline examples of syntax, write the keyword between '' and '' (two single quotes) */ Used as a function in [[:basics:msqb|MS QuickBasic/QBasic]], PLAY returns the number of notes still to be played in its musical commands string. The given numerical argument for such usage is simply ignored. ==== Variations ==== In [[:basics:msx|MSX BASIC]], PLAY can be used as a function to query the free (0) or busy (-1) status of one or all of the machine's three sound channels, according to its lone argument: * 0: all channels * 1: channel A * 2: channel B * 3: channel C In [[:basics:msqb|MS-QB]], the arguments ON, OFF or STOP can be used not for the music itself as it might seem, but for the event triggering caused by this countdown, which can be captured by [[ON_PLAY|ON PLAY...GOSUB]] from 32 to 1 note(s) remaining. ===== Examples ===== /* Below is an example of a code block, using GeSHi syntax highlighting for //gwbasic//. Other styles of interest might be //basic4gl//, //blitzbasic//, //freebasic//, //gambas//, //locobasic//, //purebasic//, //qbasic//, //sdlbasic//, //thinbasic//, //vb//, //vbnet//, //xbasic// or //zxbasic//. 10 PRINT "HELLO" */ ===== Comments ===== /* Origin of the keyword, opinions, history... */ ===== Related keywords ===== /* Keywords that are often or always used along this one */ * [[ON_PLAY|ON PLAY]] ===== Similar keywords ===== /* Keywords with the same or similar functionality found in other versions of BASIC */ ===== In other languages... ===== /* For parallels and comparisons with other modern-day languages */ ===== References ===== /* If you used the ((citation)) syntax elsewhere in the text, they will appear under this section. But you can write some recommendations of books, magazines, etc */ /* ===== TAGS ===== Please use the syntax below for adding tags to this page, separated by spaces (use quotes for tags with spaces). The most important tags to be used are, separated by groups: - Statements | Commands | SpecialVariables | Operators {{tag>tagName}} */ {{tag>Statements Functions Sound Events}}