User:RhoSigma/Test: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
No edit summary
Tag: Reverted
(Replaced content with "== ATTENTION == '''Keep Out''' - This is my all things MediaWiki '''Nuke Test Site''' ...")
Tags: Replaced Manual revert
 
Line 1: Line 1:
== ATTENTION ==
== ATTENTION ==
'''Keep Out''' - This is my all things MediaWiki '''Nuke Test Site''' ...
'''Keep Out''' - This is my all things MediaWiki '''Nuke Test Site''' ...
{{DISPLAYTITLE: _WAVE}}
'''_WAVE''' defines the waveform shape for a specified audio channel when used with [[SOUND]] or [[PLAY]].
{{PageSyntax}}
: [[_WAVE]] {{Parameter|voice&}}, {{Parameter|waveDefinition%%([index&])}}[, {{Parameter|frameCount&}}]
{{PageParameters}}
* {{Parameter|voice&}} specifies for which of the four audio channels the sound waveform shall be set.
* {{Parameter|waveDefinition%%([index&])}} defines the shape of the sound wave for the specified voice. This parameter must be the name of an array of [[_BYTE]]s with at least 2 elements. Each element (sample frame) in the array must have a value in the range of -128 to 127. An optional index can be used to specify the starting point in the array.
* {{Parameter|frameCount&}} specifies the number of elements (sample frames) used to define the shape of the sound.
{{PageDescription}}
* The '''_WAVE''' statement enhances the versatility of the [[SOUND]] or [[PLAY]] commands.
* By using a numeric array to define the shape of a sound wave, you can produce more specific and unique types of sounds.
* Each element of the array specifies a amplitude value. When combined, these values form a curve that represents the shape of the waveform.
* Audio channels can be panned to the left, right, or center using [[SOUND]] or [[PLAY]].
* Waveforms specified with '''_WAVE''' have a waveform ID of '''10'''. See [[SOUND]] and [[PLAY]] for more details regarding waveforms.
* By default, custom waveforms are initialized as a sine wave with '''256''' sample frames.
* The '''_WAVE''' command was designed to resemble the '''WAVE''' command found in '''AmigaBasic'''.
{{PageAvailability}}
<!-- QB64 = a version or none, QBPE = a version or all, Platforms = yes or no -->
<gallery widths="48px" heights="48px" mode="nolines">
File:Qb64.png|'''none'''
File:Qbpe.png|'''v4.0.0'''
File:Apix.png
File:Win.png|'''yes'''
File:Lnx.png|'''yes'''
File:Osx.png|'''yes'''
</gallery>
<!-- additional availability notes go below here -->
{{PageExamples}}
; Example 1: A QB64-PE port of the AmigaBasic Music/Graphic demo.
{{CodeStart}}
{{Text|<nowiki>' Music - AmigaBasic Music/Graphic-Demo --- 20. July 1985</nowiki>|#919191}}
{{Cl|DEFLNG}} A-Z
{{Cl|CONST}} VOLUME! = {{Text|0.25!|#F580B1}}
{{Cl|DIM}} F#({{Text|88|#F580B1}}), CF({{Text|19|#F580B1}}), CT#({{Text|19|#F580B1}})
{{Cl|GOSUB}} InitSound
{{Cl|GOSUB}} InitGraphics
{{Cl|DO}}
    {{Cl|SOUND|SOUND RESUME}}
    {{Cl|RESTORE}} Song
    {{Cl|GOSUB}} PlaySong
    {{Text|<nowiki>' This ensures all voices have played completely before playing the song again</nowiki>|#919191}}
    {{Cl|WHILE}} {{Cl|PLAY (function)|PLAY}}({{Text|0|#F580B1}}) &gt; {{Text|0|#F580B1}} {{Cl|_ORELSE}} {{Cl|PLAY (function)|PLAY}}({{Text|1|#F580B1}}) &gt; {{Text|0|#F580B1}} {{Cl|_ORELSE}} {{Cl|PLAY (function)|PLAY}}({{Text|2|#F580B1}}) &gt; {{Text|0|#F580B1}} {{Cl|_ORELSE}} {{Cl|PLAY (function)|PLAY}}({{Text|3|#F580B1}}) &gt; {{Text|0|#F580B1}}
        {{Cl|IF}} {{Cl|_KEYHIT}} = {{Text|27|#F580B1}} {{Cl|THEN}} {{Cl|END}}
        {{Cl|_LIMIT}} {{Text|60|#F580B1}}
    {{Cl|WEND}}
{{Cl|LOOP}}
InitGraphics:
{{Cl|SCREEN}} {{Text|12|#F580B1}}
{{Cl|_TITLE}} {{Text|<nowiki>"AmigaBasic Music/Graphic Demo (QB64-PE port by a740g)"</nowiki>|#FFB100}}
iDraw = {{Text|30|#F580B1}}
iErase = {{Text|0|#F580B1}}
{{Cl|ON TIMER(n)|ON TIMER}}({{Text|1|#F580B1}}) {{Cl|GOSUB}} TimeSlice
{{Cl|TIMER}} {{Cl|ON}}
{{Cl|RETURN}}
TimeSlice:
{{Cl|FOR}} linestep = {{Text|1|#F580B1}} {{Cl|TO}} {{Text|15|#F580B1}}
    {{Text|DrawLine|#55FF55}} iDraw, {{Text|1|#F580B1}}
    {{Text|DrawLine|#55FF55}} iErase, {{Text|0|#F580B1}}
    {{Cl|_LIMIT}} {{Text|60|#F580B1}}
{{Cl|NEXT}} linestep
{{Cl|RETURN}}
PlaySong:
{{Text|<nowiki>' Array VO contains the base octave for a voice.</nowiki>|#919191}}
{{Cl|FOR}} v = {{Text|0|#F580B1}} {{Cl|TO}} {{Text|3|#F580B1}}
    {{Cl|READ}} VO(v)
    VO(v) = {{Text|12|#F580B1}} * VO(v) + {{Text|3|#F580B1}}
{{Cl|NEXT}} v
{{Cl|DO}}
    {{Cl|SOUND|SOUND WAIT}}
    {{Cl|FOR}} v = {{Text|0|#F580B1}} {{Cl|TO}} {{Text|3|#F580B1}}
        t# = VT#(v)
        Fi = {{Text|-1|#F580B1}}
        {{Cl|READ}} p$
        {{Cl|IF}} p$ = {{Text|<nowiki>"x"</nowiki>|#FFB100}} {{Cl|THEN}} {{Cl|RETURN}}
        {{Cl|FOR}} I = {{Text|1|#F580B1}} {{Cl|TO}} {{Cl|LEN}}(p$)
            Ci = {{Cl|INSTR}}(C$, {{Cl|MID$ (function)|MID$}}(p$, I, {{Text|1|#F580B1}}))
            {{Cl|IF}} Ci &lt;= {{Text|8|#F580B1}} {{Cl|THEN}}
                {{Cl|IF}} Fi &gt;= {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|SOUND}} F#(Fi), t#, VOLUME, , , , v: t# = VT#(v)
                {{Cl|IF}} Ci = {{Text|8|#F580B1}} {{Cl|THEN}} Fi = {{Text|0|#F580B1}} {{Cl|ELSE}} Fi = CF(Ci) + VO(v)
            {{Cl|ELSEIF}} Ci &lt; {{Text|11|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'# or -</nowiki>|#919191}}
                Fi = Fi + CF(Ci)
            {{Cl|ELSEIF}} Ci &lt; {{Text|17|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'1 through 8</nowiki>|#919191}}
                t# = CT#(Ci)
            {{Cl|ELSEIF}} Ci &lt; {{Text|19|#F580B1}} {{Cl|THEN}} {{Text|<nowiki>'&lt; or &gt;</nowiki>|#919191}}
                VO(v) = VO(v) + CF(Ci)
            {{Cl|ELSE}} {{Text|<nowiki>'ln</nowiki>|#919191}}
                I = I + {{Text|1|#F580B1}}
                Ci = {{Cl|INSTR}}(C$, {{Cl|MID$ (function)|MID$}}(p$, I, {{Text|1|#F580B1}}))
                VT#(v) = CT#(Ci)
                {{Cl|IF}} Fi &lt; {{Text|0|#F580B1}} {{Cl|THEN}} t# = VT#(v)
            {{Cl|END IF}}
        {{Cl|NEXT}} I
        {{Cl|IF}} Fi &gt;= {{Text|0|#F580B1}} {{Cl|THEN}} {{Cl|SOUND}} F#(Fi), t#, VOLUME, , , , v
    {{Cl|NEXT}} v
    {{Cl|SOUND|SOUND RESUME}}
    {{Cl|IF}} {{Cl|_KEYHIT}} = {{Text|27|#F580B1}} {{Cl|THEN}} {{Cl|END}}
    {{Cl|_LIMIT}} {{Text|60|#F580B1}}
{{Cl|LOOP}}
InitSound:
{{Text|<nowiki>' F#() contains frequencies of the chromatic scale.</nowiki>|#919191}}
{{Text|<nowiki>' Note A in octave 0 = F#(12) = 55 Hz.</nowiki>|#919191}}
Log2of27.5# = {{Cl|LOG}}({{Text|27.5#|#F580B1}}) / {{Cl|LOG}}({{Text|2#|#F580B1}})
{{Cl|FOR}} x = {{Text|1|#F580B1}} {{Cl|TO}} {{Text|88|#F580B1}}
    F#(x) = {{Text|2|#F580B1}} ^ (Log2of27.5# + x / {{Text|12#|#F580B1}})
{{Cl|NEXT}} x
{{Text|<nowiki>' Create the waveform of tones,</nowiki>|#919191}}
{{Text|<nowiki>' determines timbre.</nowiki>|#919191}}
{{Cl|DIM}} Timbre({{Text|255|#F580B1}}) {{Cl|AS}} {{Cl|_BYTE}}
{{Cl|FOR}} I = {{Text|0|#F580B1}} {{Cl|TO}} {{Text|255|#F580B1}}
    {{Cl|READ}} Timbre(I)
{{Cl|NEXT}} I
{{Text|<nowiki>' The following DATA rows were created using the following formula.</nowiki>|#919191}}
{{Text|<nowiki>' Reading from these DATAs is faster than calculating the sine 1024 times.</nowiki>|#919191}}
{{Text|<nowiki>'  K# = 2 * 3.14159265/256</nowiki>|#919191}}
{{Text|<nowiki>'  FOR I = 0 TO 255</nowiki>|#919191}}
{{Text|<nowiki>'    Timbre(I) = 31 * (SIN(I * K#) + SIN(2 * I * K#) + SIN(3 * I * K#) + SIN( 4 * I * K#))</nowiki>|#919191}}
{{Text|<nowiki>'  NEXT I</nowiki>|#919191}}
{{Cl|DATA}} {{Text|0|#F580B1}},{{Text|8|#F580B1}},{{Text|15|#F580B1}},{{Text|23|#F580B1}},{{Text|30|#F580B1}},{{Text|37|#F580B1}},{{Text|44|#F580B1}},{{Text|51|#F580B1}},{{Text|57|#F580B1}},{{Text|63|#F580B1}},{{Text|69|#F580B1}},{{Text|74|#F580B1}},{{Text|79|#F580B1}},{{Text|83|#F580B1}},{{Text|87|#F580B1}},{{Text|91|#F580B1}}
{{Cl|DATA}} {{Text|93|#F580B1}},{{Text|96|#F580B1}},{{Text|98|#F580B1}},{{Text|99|#F580B1}},{{Text|100|#F580B1}},{{Text|100|#F580B1}},{{Text|100|#F580B1}},{{Text|99|#F580B1}},{{Text|98|#F580B1}},{{Text|97|#F580B1}},{{Text|95|#F580B1}},{{Text|92|#F580B1}},{{Text|89|#F580B1}},{{Text|86|#F580B1}},{{Text|83|#F580B1}},{{Text|79|#F580B1}}
{{Cl|DATA}} {{Text|75|#F580B1}},{{Text|71|#F580B1}},{{Text|66|#F580B1}},{{Text|62|#F580B1}},{{Text|57|#F580B1}},{{Text|52|#F580B1}},{{Text|48|#F580B1}},{{Text|43|#F580B1}},{{Text|39|#F580B1}},{{Text|34|#F580B1}},{{Text|30|#F580B1}},{{Text|25|#F580B1}},{{Text|21|#F580B1}},{{Text|18|#F580B1}},{{Text|14|#F580B1}},{{Text|11|#F580B1}}
{{Cl|DATA}} {{Text|8|#F580B1}},{{Text|5|#F580B1}},{{Text|3|#F580B1}},{{Text|0|#F580B1}},{{Text|-1|#F580B1}},{{Text|-3|#F580B1}},{{Text|-4|#F580B1}},{{Text|-5|#F580B1}},{{Text|-5|#F580B1}},{{Text|-6|#F580B1}},{{Text|-6|#F580B1}},{{Text|-5|#F580B1}},{{Text|-5|#F580B1}},{{Text|-4|#F580B1}},{{Text|-3|#F580B1}},{{Text|-1|#F580B1}}
{{Cl|DATA}} {{Text|0|#F580B1}},{{Text|2|#F580B1}},{{Text|3|#F580B1}},{{Text|5|#F580B1}},{{Text|7|#F580B1}},{{Text|9|#F580B1}},{{Text|11|#F580B1}},{{Text|13|#F580B1}},{{Text|15|#F580B1}},{{Text|17|#F580B1}},{{Text|18|#F580B1}},{{Text|20|#F580B1}},{{Text|21|#F580B1}},{{Text|23|#F580B1}},{{Text|24|#F580B1}},{{Text|25|#F580B1}}
{{Cl|DATA}} {{Text|26|#F580B1}},{{Text|26|#F580B1}},{{Text|27|#F580B1}},{{Text|27|#F580B1}},{{Text|27|#F580B1}},{{Text|27|#F580B1}},{{Text|27|#F580B1}},{{Text|26|#F580B1}},{{Text|25|#F580B1}},{{Text|24|#F580B1}},{{Text|23|#F580B1}},{{Text|22|#F580B1}},{{Text|20|#F580B1}},{{Text|18|#F580B1}},{{Text|17|#F580B1}},{{Text|15|#F580B1}}
{{Cl|DATA}} {{Text|13|#F580B1}},{{Text|11|#F580B1}},{{Text|9|#F580B1}},{{Text|7|#F580B1}},{{Text|5|#F580B1}},{{Text|3|#F580B1}},{{Text|1|#F580B1}},{{Text|-1|#F580B1}},{{Text|-3|#F580B1}},{{Text|-5|#F580B1}},{{Text|-6|#F580B1}},{{Text|-8|#F580B1}},{{Text|-9|#F580B1}},{{Text|-10|#F580B1}},{{Text|-11|#F580B1}},{{Text|-12|#F580B1}}
{{Cl|DATA}} {{Text|-12|#F580B1}},{{Text|-13|#F580B1}},{{Text|-13|#F580B1}},{{Text|-13|#F580B1}},{{Text|-13|#F580B1}},{{Text|-13|#F580B1}},{{Text|-12|#F580B1}},{{Text|-11|#F580B1}},{{Text|-11|#F580B1}},{{Text|-10|#F580B1}},{{Text|-8|#F580B1}},{{Text|-7|#F580B1}},{{Text|-6|#F580B1}},{{Text|-4|#F580B1}},{{Text|-3|#F580B1}},{{Text|-2|#F580B1}}
{{Cl|DATA}} {{Text|0|#F580B1}},{{Text|2|#F580B1}},{{Text|3|#F580B1}},{{Text|4|#F580B1}},{{Text|6|#F580B1}},{{Text|7|#F580B1}},{{Text|8|#F580B1}},{{Text|10|#F580B1}},{{Text|11|#F580B1}},{{Text|11|#F580B1}},{{Text|12|#F580B1}},{{Text|13|#F580B1}},{{Text|13|#F580B1}},{{Text|13|#F580B1}},{{Text|13|#F580B1}},{{Text|13|#F580B1}}
{{Cl|DATA}} {{Text|12|#F580B1}},{{Text|12|#F580B1}},{{Text|11|#F580B1}},{{Text|10|#F580B1}},{{Text|9|#F580B1}},{{Text|8|#F580B1}},{{Text|6|#F580B1}},{{Text|5|#F580B1}},{{Text|3|#F580B1}},{{Text|1|#F580B1}},{{Text|-1|#F580B1}},{{Text|-3|#F580B1}},{{Text|-5|#F580B1}},{{Text|-7|#F580B1}},{{Text|-9|#F580B1}},{{Text|-11|#F580B1}}
{{Cl|DATA}} {{Text|-13|#F580B1}},{{Text|-15|#F580B1}},{{Text|-17|#F580B1}},{{Text|-18|#F580B1}},{{Text|-20|#F580B1}},{{Text|-22|#F580B1}},{{Text|-23|#F580B1}},{{Text|-24|#F580B1}},{{Text|-25|#F580B1}},{{Text|-26|#F580B1}},{{Text|-27|#F580B1}},{{Text|-27|#F580B1}},{{Text|-27|#F580B1}},{{Text|-27|#F580B1}},{{Text|-27|#F580B1}},{{Text|-26|#F580B1}}
{{Cl|DATA}} {{Text|-26|#F580B1}},{{Text|-25|#F580B1}},{{Text|-24|#F580B1}},{{Text|-23|#F580B1}},{{Text|-21|#F580B1}},{{Text|-20|#F580B1}},{{Text|-18|#F580B1}},{{Text|-17|#F580B1}},{{Text|-15|#F580B1}},{{Text|-13|#F580B1}},{{Text|-11|#F580B1}},{{Text|-9|#F580B1}},{{Text|-7|#F580B1}},{{Text|-5|#F580B1}},{{Text|-3|#F580B1}},{{Text|-2|#F580B1}}
{{Cl|DATA}} {{Text|0|#F580B1}},{{Text|1|#F580B1}},{{Text|3|#F580B1}},{{Text|4|#F580B1}},{{Text|5|#F580B1}},{{Text|5|#F580B1}},{{Text|6|#F580B1}},{{Text|6|#F580B1}},{{Text|5|#F580B1}},{{Text|5|#F580B1}},{{Text|4|#F580B1}},{{Text|3|#F580B1}},{{Text|1|#F580B1}},{{Text|0|#F580B1}},{{Text|-3|#F580B1}},{{Text|-5|#F580B1}}
{{Cl|DATA}} {{Text|-8|#F580B1}},{{Text|-11|#F580B1}},{{Text|-14|#F580B1}},{{Text|-18|#F580B1}},{{Text|-21|#F580B1}},{{Text|-25|#F580B1}},{{Text|-30|#F580B1}},{{Text|-34|#F580B1}},{{Text|-39|#F580B1}},{{Text|-43|#F580B1}},{{Text|-48|#F580B1}},{{Text|-52|#F580B1}},{{Text|-57|#F580B1}},{{Text|-62|#F580B1}},{{Text|-66|#F580B1}},{{Text|-71|#F580B1}}
{{Cl|DATA}} {{Text|-75|#F580B1}},{{Text|-79|#F580B1}},{{Text|-83|#F580B1}},{{Text|-86|#F580B1}},{{Text|-89|#F580B1}},{{Text|-92|#F580B1}},{{Text|-95|#F580B1}},{{Text|-97|#F580B1}},{{Text|-98|#F580B1}},{{Text|-99|#F580B1}},{{Text|-100|#F580B1}},{{Text|-100|#F580B1}},{{Text|-100|#F580B1}},{{Text|-99|#F580B1}},{{Text|-98|#F580B1}},{{Text|-96|#F580B1}}
{{Cl|DATA}} {{Text|-93|#F580B1}},{{Text|-91|#F580B1}},{{Text|-87|#F580B1}},{{Text|-83|#F580B1}},{{Text|-79|#F580B1}},{{Text|-74|#F580B1}},{{Text|-69|#F580B1}},{{Text|-63|#F580B1}},{{Text|-57|#F580B1}},{{Text|-51|#F580B1}},{{Text|-44|#F580B1}},{{Text|-37|#F580B1}},{{Text|-30|#F580B1}},{{Text|-23|#F580B1}},{{Text|-15|#F580B1}},{{Text|-8|#F580B1}}
{{Text|<nowiki>' Set AMIGA PAULA like panning (well mostly)</nowiki>|#919191}}
{{Cl|SOUND}} {{Text|0|#F580B1}}, {{Text|0|#F580B1}}, , {{Text|-0.75!|#F580B1}}, {{Text|10|#F580B1}}, , {{Text|0|#F580B1}} {{Text|<nowiki>' pan left</nowiki>|#919191}}
{{Cl|SOUND}} {{Text|0|#F580B1}}, {{Text|0|#F580B1}}, , {{Text|0.75!|#F580B1}}, {{Text|10|#F580B1}}, , {{Text|1|#F580B1}} {{Text|<nowiki>' pan right</nowiki>|#919191}}
{{Cl|SOUND}} {{Text|0|#F580B1}}, {{Text|0|#F580B1}}, , {{Text|0.75!|#F580B1}}, {{Text|10|#F580B1}}, , {{Text|2|#F580B1}} {{Text|<nowiki>' pan right</nowiki>|#919191}}
{{Cl|SOUND}} {{Text|0|#F580B1}}, {{Text|0|#F580B1}}, , {{Text|-0.75!|#F580B1}}, {{Text|10|#F580B1}}, , {{Text|3|#F580B1}} {{Text|<nowiki>' pan left</nowiki>|#919191}}
{{Cl|_WAVE}} {{Text|0|#F580B1}}, Timbre()
{{Cl|_WAVE}} {{Text|1|#F580B1}}, Timbre()
{{Cl|_WAVE}} {{Text|2|#F580B1}}, Timbre()
{{Cl|_WAVE}} {{Text|3|#F580B1}}, Timbre()
{{Text|<nowiki>' Array CF maps MML commands to frequency indices.</nowiki>|#919191}}
C$ = {{Text|<nowiki>"cdefgabp#-123468&lt;&gt;l"</nowiki>|#FFB100}}
{{Cl|FOR}} I = {{Text|1|#F580B1}} {{Cl|TO}} {{Text|19|#F580B1}}
    {{Cl|READ}} CF(I)
{{Cl|NEXT}} I
{{Cl|DATA}} {{Text|0|#F580B1}},{{Text|2|#F580B1}},{{Text|4|#F580B1}},{{Text|5|#F580B1}},{{Text|7|#F580B1}},{{Text|9|#F580B1}},{{Text|11|#F580B1}},{{Text|0|#F580B1}},{{Text|1|#F580B1}},{{Text|-1|#F580B1}},{{Text|0|#F580B1}},{{Text|0|#F580B1}},{{Text|0|#F580B1}},{{Text|0|#F580B1}},{{Text|0|#F580B1}},{{Text|0|#F580B1}},{{Text|-12|#F580B1}},{{Text|12|#F580B1}},{{Text|0|#F580B1}}
{{Text|<nowiki>' Array CT# assigns note lengths to MML commands.</nowiki>|#919191}}
{{Cl|FOR}} I = {{Text|1|#F580B1}} {{Cl|TO}} {{Text|18|#F580B1}}
    {{Cl|READ}} CT#(I)
{{Cl|NEXT}} I
{{Text|<nowiki>' MML commands p1,p2,p3,p4,p6,p8 correspond to pause times 36.4 ... 4.55 units</nowiki>|#919191}}
{{Cl|DATA}} {{Text|0|#F580B1}},{{Text|0|#F580B1}},{{Text|0|#F580B1}},{{Text|0|#F580B1}},{{Text|0|#F580B1}},{{Text|0|#F580B1}},{{Text|0|#F580B1}},{{Text|0|#F580B1}},{{Text|0|#F580B1}},{{Text|0|#F580B1}},{{Text|36.4|#F580B1}},{{Text|18.2|#F580B1}},{{Text|12.133333|#F580B1}},{{Text|9.1|#F580B1}},{{Text|6.0666667|#F580B1}},{{Text|4.55|#F580B1}},{{Text|0|#F580B1}},{{Text|0|#F580B1}},{{Text|0|#F580B1}}
{{Cl|RETURN}}
{{Text|<nowiki>' The music is written in special commands (MML), but as per the Wiki page</nowiki>|#919191}}
{{Text|<nowiki>' below MML not fully implemented here, missing o, v and t commands:</nowiki>|#919191}}
{{Text|<nowiki>' https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML</nowiki>|#919191}}
{{Text|<nowiki>' The first 4 numbers are the base octaves (0-7) for each voice.</nowiki>|#919191}}
{{Text|<nowiki>' ln    - sets note length for the following notes of this voice:</nowiki>|#919191}}
{{Text|<nowiki>'          l1 = whole note, l2 = half note, l4 = quarter note, etc.</nowiki>|#919191}}
{{Text|<nowiki>' &gt;      - selects the next higher octave for this voice.</nowiki>|#919191}}
{{Text|<nowiki>' &lt;      - selects the next lower octave for this voice.</nowiki>|#919191}}
{{Text|<nowiki>' a to g - play the respective note,</nowiki>|#919191}}
{{Text|<nowiki>'          # (sharp) or - (flat) may follow directly.</nowiki>|#919191}}
{{Text|<nowiki>'          It may also follow a number to determine the duration of this note.</nowiki>|#919191}}
{{Text|<nowiki>' pn    - make a rest/pause length as for note length (ln) above.</nowiki>|#919191}}
Song:
{{Cl|DATA}} {{Text|1|#F580B1}},{{Text|3|#F580B1}},{{Text|3|#F580B1}},{{Text|3|#F580B1}}
{{Cl|DATA}} l2g&gt;ge,l2p2de,l2p2l6g3f#g3a,l6p6gab&gt;dcced
{{Cl|DATA}} &lt;b&gt;e&lt;e,ge&lt;b,b3ab3ge3d,dgf#gd&lt;bgab
{{Cl|DATA}} ab&gt;c,a&gt;dc,e3f#g3de3&lt;b,&gt;cdedc&lt;babg
{{Cl|DATA}} df#d,c&lt;a&gt;f#,a3&gt;da3ga3f#,f#gadf#a&gt;c&lt;ba
{{Cl|DATA}} gec,g&lt;g&gt;e,d3f#g3f#g3a,bgab&gt;dcced
{{Cl|DATA}} &lt;b&gt;ed,ge&lt;b,b3ab3ge3g,dgf#gd&lt;bgab
{{Cl|DATA}} cc#d,&gt;ced,a3f#g3e&lt;a3&gt;c,e&gt;dc&lt;bagdgf#
{{Cl|DATA}} &lt;gp3&gt;g6d3&lt;b6,dp2b3g6,&lt;b3&gt;gb3&gt;dg3d,gb&gt;dgd&lt;bgb&gt;d
{{Cl|DATA}} g&gt;f#e,d&lt;gg,l2&lt;g1g,l2&lt;b1&gt;c
{{Cl|DATA}} f#ed,agf#,a1b,d1d
{{Cl|DATA}} ef#g,gag,bag,c1&lt;b
{{Cl|DATA}} dp3d6d3d6,f#a3a6&gt;d3d6,al6d3ef#3g,l6adef#aga&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t;c&lt;af#df#a&gt;c&lt;ba
{{Cl|DATA}} g&gt;ge,dde,g3dg3f#g3a,bgab&gt;dcced
{{Cl|DATA}} &lt;b&gt;e&lt;e,ge&lt;b,b3ab3ge3d,dgf#gd&lt;bgab
{{Cl|DATA}} ab&gt;c,a&gt;d&lt;c,e3f#g3de3&lt;b,&gt;cdedc&lt;babg
{{Cl|DATA}} df#d,c&lt;a&gt;f#,a3&gt;da3ga3f#,f#gadf#a&gt;c&lt;ba
{{Cl|DATA}} gec,g&lt;g&gt;e,d3f#g3f#g3a,bgab&gt;dcced
{{Cl|DATA}} &lt;b&gt;ed,ge&lt;d,b3ab3ge3g,dgf#gd&lt;bgab
{{Cl|DATA}} cc#d,d1d2,a3f#g3e&lt;a3&gt;c,e&gt;dc&lt;bagdgf#
{{Cl|DATA}} &lt;g1g2,p2,&lt;b1b2,g1g2
{{Cl|DATA}} p1,p1,p1,p1
{{Cl|DATA}} x
{{Cl|SUB}} {{Text|DrawLine|#55FF55}} (iStep, hue) {{Cl|STATIC}}
    winWidth = {{Cl|_WIDTH (function)|_WIDTH}}
    winHeight = {{Cl|_HEIGHT}}
    iStep = (iStep + {{Text|1|#F580B1}}) {{Cl|MOD}} {{Text|60|#F580B1}}
    side = iStep \ {{Text|15|#F580B1}}
    I! = (iStep {{Cl|MOD}} {{Text|15|#F580B1}}) / {{Text|15!|#F580B1}}
    i1! = {{Text|1!|#F580B1}} - I!
    {{Cl|ON}} side + {{Text|1|#F580B1}} {{Cl|GOSUB}} dl_top, dl_left, dl_bottom, dl_right
    {{Cl|EXIT SUB}}
    dl_top:
    {{Cl|LINE}} (winWidth * I!, {{Text|0|#F580B1}})-(winWidth, winHeight * I!), hue
    {{Cl|RETURN}}
    dl_left:
    {{Cl|LINE}} (winWidth, winHeight * I!)-(winWidth * i1!, winHeight), hue
    {{Cl|RETURN}}
    dl_bottom:
    {{Cl|LINE}} (winWidth * i1!, winHeight)-({{Text|0|#F580B1}}, winHeight * i1!), hue
    {{Cl|RETURN}}
    dl_right:
    {{Cl|LINE}} ({{Text|0|#F580B1}}, winHeight * i1!)-(winWidth * I!, {{Text|0|#F580B1}}), hue
    {{Cl|RETURN}}
{{Cl|END SUB}}
{{CodeEnd}}
{{Small|QB64-PE port of an AmigaBasic example by a740g. German comments translated by RhoSigma.}}
{{PageSeeAlso}}
* [[PLAY (function)]]
* [[PLAY]], [[SOUND]], [[BEEP]]
* [[_SNDOPEN]], [[_SNDRAW]]
{{PageNavigation}}

Latest revision as of 18:09, 23 November 2024

ATTENTION

Keep Out - This is my all things MediaWiki Nuke Test Site ...