Projekt Project Hardware Hardware Bedienung Operation BASIC (1) BASIC (1) BASIC (2) BASIC (2) BASIC (3) BASIC (3) Interna Internals Beispiele Examples Erweiterungen Extensions Bibliotheken Libraries Treiber Driver Programme Programs Bezugsquellen: Where to buy: Bausatz Kit Leerplatine Empty board | AVR-ChipBasic2: BASIC-Referenz (2) AVR ChipBasic2: BASIC Reference (2) Grafik und Sound Graphics and Sound V1.45 (c) 2006-2012 Jörg Wolfram V1.45 (c) 2006-2012 Jörg Wolfram 1 Grafik 1 Graphics1.1 Pseudografik im Textmodus 1.1 Pseudo graphics in text modeFür die Pseudografik wird jedes Zeichen in 4 "Pixel" aufgeteilt. For the pseudo-graphic, each character is divided into 4 "pixels". Bei 23 Zeilen a 30 Zeichen ergibt sich so eine Arbeitsfläche von 60x46 Punkten. At 23 lines each of 30 characters results in a working area of 60x46 points. Die 4 Pixel eines Zeichens haben immer die gleiche Hinter- und Vordergrundfarbe. The 4 pixels of a character always have the same background and foreground color.Ist die Zeichenfarbe gleich der Hintergrundfarbe des zu ändernden Zeichens, so werden die Pixel nur gelöscht, Farbinformationen werden nicht verändert. Is the drawing color equal to the background color of the character to be changed, so the pixels are deleted only color information is not modified. Ist die Zeichenfarbe gleich der Vordergrundfarbe, werden nur Pixel gesetzt, Farbinformationen werden auch hier nicht verändert. Is the drawing color equal to the foreground color, only pixels are set, color information can not be changed here. Gibt es keine Übereinstimmung zwischen der Zeichenfarbe und der Vorder- und Hintergrundfarbe des betreffenden Zeichens, wird die Vordergrundfarbe neu gesetzt wobei bereits gesetzte Pixel zwangsläufig mit umgefärbt werden. There is no match between the character and color of the foreground and background color of the sign, the foreground color is set with new pixels are already set recolored necessarily. Zusätzlich zur Pseudografik im Textmodus gibt es noch 4 Grafikmodi, die sich in Auflösung und Anzahl der darstellbaren Farben unterscheiden. In addition to the pseudo-graphic text mode, there are four video modes, which differ in resolution and number of displayable colors. Allerdings lässt der verfügbare Speicher des Controllers keine sehr hohen Auflösungen zu. However, it can be the available memory of the controller not very high resolutions. Ebenfalls aus Speicherplatzgründen ist es nicht möglich, den Monitor in den Grafikmodi aufzurufen. Also for space reasons it is not possible to call the monitor in the Display Modes. Werden in den Modi 2,3 und 5 Vorder- und Hintergrundfarbe gesetzt, zeigen diese auf den Palettenindex und geben nicht die Farbe direkt an. In modes 2,3 and 5 are front and background color set to point to the palette index and does not reflect the color directly. 1.2 Videomode 1 1.2 Video Mode 1Die Pixelauflösung beträgt 168x116 Pixel, wobei für jeweils 8x8 (am unteren Rand nur 4x8) Pixel Vorder- und Hintergrundfarbe eingestellt werden können. The pixel resolution is 168x116 pixels, for each 8x8 (4x8 only at the bottom) pixels foreground and background color can be set. Ist die Zeichenfarbe gleich der Hintergrundfarbe an der zeichenposition, so werden die Pixel nur gelöscht, Farbinformationen werden nicht verändert. Is the drawing color equal to the background color of the sign position, the pixels are deleted only color information is not modified. Ist die Zeichenfarbe gleich der Vordergrundfarbe, werden nur Pixel gesetzt, Farbinformationen werden auch hier nicht verändert. Is the drawing color equal to the foreground color, only pixels are set, color information can not be changed here. Gibt es keine Übereinstimmung zwischen der Zeichenfarbe und der Vorder- und Hintergrundfarbe des entsprechenden Bereiches, wird die Vordergrundfarbe neu gesetzt wobei bereits gesetzte Pixel zwangsläufig mit umgefärbt werden. There is no match between the character and color of the foreground and background color of the corresponding region, the foreground color is set with new pixels are already set recolored necessarily.1.3 Videomode 2 1.3 Video Mode 2Die Pixelauflösung beträgt 120x76 Pixel, jedes Pixel kann eine aus 4 über die Palette einstellbaren Farben annehmen. The pixel resolution is 120x76 pixels, each pixel can be adjusted over the range of 4 colors.1.4 Videomode 3 1.4 Video Mode 3Die Pixelauflösung beträgt 84x58 Pixel, jedes Pixel kann eine aus 16 über die Palette einstellbaren Farben annehmen. The pixel resolution is 84x58 pixels, each pixel can be adjusted over the range of 16 colors.1.5 Videomode 5 1.5 Video Mode 5Die Pixelauflösung beträgt 128x64 Pixel, jedes Pixel kann eine aus 2 über die Palette einstellbaren Farben annehmen. The pixel resolution is 128x64 pixels, each pixel can be adjusted over the range of 2 colors. Dieser Modus dient hauptsächlich zur Emulation von Grafik-LCD mit der entsprechenden Auflösung. This mode is primarily used to emulate graphic LCD with the corresponding resolution.1.6 VMODE n [VM] 1.6 VMODE n [VM]Schaltet den Videomodus um. Switches the video mode. Dabei werden der Bildschirm gelöscht und die Textkoordinaten auf die linke obere Ecke gesetzt. Here to clear the screen and the text coordinates set to the upper left corner.
Zusätzlich werden die im jeweiligen Modus genutzten Paletteneinträge vorbelegt. In addition to the current mode used palette entries are initialized. 1.7 PALETTE start,c1(,c2,c3,c4,c5,c6) [PAL] 1.7 RANGE start, (c1, c2, c3, c4, c5, c6) [PAL]Mit diesem Befehl wird die Farbpalette für die Videomodi 2 bis 3 und 5 eingestellt. This command sets the color palette for the video modes 2 to 3 and 5 is set. Für den Modus 5 werden nur die Einträge 0 und 1 verwendet, für Modus 2 die Einträge 0 bis 3. Of the mode 5, only the entries 0 and 1 are used for mode 2, the entries 0 to 3 Die Anzahl der zu setzenden Paletteneinträge ist auf 6 begrenzt, anderenfalls kommt es zu einer Fehlermeldung. The number of palette entries to be set is limited to 6, otherwise there is an error message. Als Farbwerte müssen im Bereich (0...15) angegeben werden. As color values must be specified in the range (0 .. 15). Nach dem Umschalten des Videomodus sind die Paletteneinträge wie folgt vorbelegt: After switching the video mode, the palette entries initialized as follows:
1.8 PLOT Y,X(,C) [PL] 1.8 PLOT Y, X (, C) [PL]Mit dem PLOT-Befehl wir ein Punkt an der Stelle Y,X gesetzt. With the PLOT command, we set a point at the Y, X. Bei Bedarf kann zusätzlich die Zeichenfarbe mit angegeben werden. If required, also can be specified with the character color.
1.9 DRAWTO Y2,X2(,C) [DTO] 9.1 DRAWTO Y2, X2 (, C) [DTO]Zeichnet eine Linie vom zuletzt gezeichneten Pixel nach Y2,X2 in der aktuellen Vordergrundfarbe. Draw a line from the last drawn pixel by Y2, X2 in the current foreground color. Bei Bedarf kann zusätzlich die Zeichenfarbe mit angegeben werden. If required, also can be specified with the character color. Beim Programmstart ist das zuletzt gezeichnete Pixel als Y=0,X=0 definiert. When the program starts, the last drawn pixels as Y = 0, X = 0 defined.
1.10 DRAW Y1,X1,Y2,X2(,C) [DR] 1:10 DRAW Y1, X1, Y2, X2 (, C) [DR]Zeichnet eine Linie vo Y1,X1 nach Y2,X2 in der aktuellen Vordergrundfarbe. Draw a line vo Y1, X1 to Y2, X2 in the current foreground color. Bei Bedarf kann zusätzlich die Zeichenfarbe mit angegeben werden. If required, also can be specified with the character color.
1.11 BOX Y1,X1,Y2,X2(,C) 1:11 BOX Y1, X1, Y2, X2 (, C)Mit dem BOX-Befehl wird ein Rechteck in der aktuellen Vordergrundfarbe gezeichnet. With the BOX command draws a rectangle in the current foreground color. Bei Bedarf kann zusätzlich die Zeichenfarbe mit angegeben werden. If required, also can be specified with the character color.
1.12 FBOX Y1,X1,Y2,X2(,C) 1:12 FBOX Y1, X1, Y2, X2 (, C)Mit dem FBOX-Befehl wird ein gefülltes Rechteck gezeichnet. By FBOX command a filled rectangle is drawn. Ist Y1=Y2 oder X1=X2 werden horizontale oder vertikale Linien gezeichnet. If Y1 = Y2 or X1 = X2 are horizontal or vertical lines drawn. Bei Bedarf kann zusätzlich die Zeichenfarbe mit angegeben werden. If required, also can be specified with the character color.
1.13 CIRCLE Y,X,RY,RX(,C) [CI] 1:13 CIRCLE Y, X, RY, RX (, C) [CI]Zeichnet einen Kreis (eine Ellipse) mit dem Mittelpunkt Y,X und den Radien RY und RX in der aktuellen Vordergrundfarbe. Draw a circle (ellipse) with center Y, X, and the radii of RY and RX in the current foreground color. Für Kreise muss RX=RY sein. Circles must be for RX = RY. Bei Bedarf kann zusätzlich die Zeichenfarbe mit angegeben werden. If required, also can be specified with the character color.
1.14 FCIRCLE Y,X,RY,RX(,C) [FCI] 1:14 FCIRCLE Y, X, RY, RX (, C) [FCI]Zeichnet einen gefüllten Kreis (eine gefüllte Ellipse) mit dem Mittelpunkt Y,X und den Radien RY und RX in der aktuellen Vordergrundfarbe. Draws a filled circle (a filled ellipse) with center Y, X, and the radii of RY and RX in the current foreground color. Für Kreise muss RX=RY sein. Circles must be for RX = RY. Bei Bedarf kann zusätzlich die Zeichenfarbe mit angegeben werden. If required, also can be specified with the character color.
1.15 ARC Y,X,RY,RX,W1,W2(,C) 1:15 ARC Y, X, RY, RX, W1, W2 (, C)Zeichnet einen Kreis- oder Ellipsenausschnitt mit dem Mittelpunkt Y,X und den Radien RY und RX in der aktuellen Vordergrundfarbe. Draws a circular or elliptical area with the center Y, X, and the radii of RY and RX in the current foreground color. beginnend beim Winkel W1 bis zum Winkel W2. starting with the angle to angle W1 W2. Die beiden Winkel werden in Grad angegeben, dabei sollte der Anfangswinkel kleiner als der Endwinkel sein, ansonsten braucht die Funktion recht lange. The two angles are specified in degrees, while the initial angle should be less than the end angle, otherwise the function takes a long time. Für Kreisauschnitte muss RX=RY sein, bei Bedarf kann zusätzlich die Zeichenfarbe mit angegeben werden. For Kreisauschnitte RX = RY must be, if necessary, can also be specified with the character color.
1.16 PIE Y,X,RY,RX,W1,W2(,C) 1:16 PIE Y, X, RY, RX, W1, W2 (, C)Zeichnet einen abgeschlossenen Kreis- oder Ellipsenausschnitt (ein "Tortenstück")mit dem Mittelpunkt Y,X und den Radien RY und RX in der aktuellen Vordergrundfarbe. Draws a closed circular or elliptical section (a "piece of cake") with center Y, X, and the radii of RY and RX in the current foreground color. beginnend beim Winkel W1 bis zum Winkel W2. starting with the angle to angle W1 W2. Die beiden Winkel werden in Grad angegeben, dabei sollte der Anfangswinkel kleiner als der Endwinkel sein, ansonsten braucht die Funktion recht lange. The two angles are specified in degrees, while the initial angle should be less than the end angle, otherwise the function takes a long time. Im Gegensatz zu ARC werdennoch zusätzlich Linien von den beiden Endpunkten zum Mittelpunkt gezogen. Unlike ARC additional lines are still drawn from the two ends to the center. Für Kreisauschnitte muss RX=RY sein, bei Bedarf kann zusätzlich die Zeichenfarbe mit angegeben werden. For Kreisauschnitte RX = RY must be, if necessary, can also be specified with the character color.
1.17 GETPIX variable,Y,X [GPX] 1:17 GETPIX variable, Y, X [GPX]Ermittelt die Farbe des Pixels an der Stelle Y,X und speichert den Palettenindex (nicht die Farbe!) in der angegebenen Variablen. Determines the color of the pixel at the Y, X and stores the palette index (not the color!) In the specified variable.
1.18 BCOPY [BC] 1:18 bcopy [BC]Der BCOPY Befehl ermöglicht es, rechteckige Blöcke oder Speicherbereiche innerhalb des Bildschirms oder ins/vom Array zu kopieren. The bcopy command allows to copy rectangular blocks or storage areas within the screen or to / from the array. Damit lassen sich zB Sprites im Grafikmodus oder Scrolling realisieren. Can thus be realized as sprites in graphics mode or scrolling. Blöcke können in den Modi 1...3 von und an (fast) beliebigen Koordinaten kopiert werden, lediglich die Größe ist Beschränkungen unterworfen. Blocks can be in Modes 1 and 3 of .. copied to (almost) any coordinate, only the size is subject to limitations. Es können nur ganze Teilblöcke kopiert werden. Only a whole sub-blocks are copied.
Im Videomodus 1 ist ein Teilblock 8x8 Pixel groß, um einen 16(V)x24(H) Pixel großen Block zu kopieren, müssen DX=2 und DY=3 sein, im Videomodus 2 DX=4 und DY=6 und im Videomodus 3 DX=8 und DY=12. In video mode, 1 is a partial block of 8x8 pixels, to copy a 16 (V) x24 (H) pixel block, must DX be 2 and DY = 3, in video mode 2 DX = 4 and DY = 6 and in video mode 3 DX and DY = 8 12th Der erste Wert gibt den Kopiermodus an, von diesem ist auch die Anzahl der restlichen Parameter abhängig. The first value is the copy mode, this is also the number of the remaining dependent parameters.
Im Modus 2 wird geprüft, ob die Grenzen des Arrays überschritten werden, in diesem Fall wird dann sofort abgebrochen. In mode 2, it is checked whether the boundaries of the array are exceeded, in this case be aborted immediately. Mit den folgenden Formeln lässt sich der erforderliche Speicherbedarf berechnen: The following formulas can calculate the required storage requirements:
DX und DY ist hierbei die Anzahl der Teilblöcke. DX and DY is here the number of sub-blocks. Kopiermodus 3 sollte nur auf Arraypositionen angewendet werden, die auch sinnvolle Informationen enthalten. Copy Mode 3 should be applied only to array positions that also contain useful information. Diese können entweder durch Kopieren im Modus 2 oder auch durch "DATA" entstanden sein. These can either copying in mode 2 or even by "DATA" have arisen. Die Pixelinformationen sind derart organisiert, dass in einem Byte je nach Videomode 8, 4 oder 2 Pixel codiert sind. The pixel information is organized such that, in a byte according to the video mode 8, 4 or 2 pixels are encoded. dabei ist das niederwertigste Bit ganz links. while the least significant bit is the leftmost.
Zusätzlich gibt es noch die Modi 4-6, die auf die Orgaisation des Bildspeichers keine Rücksicht nehmen und zum schnellen Umkopieren gedacht sind. In addition there are the modes 4-6, the image memory of the Orgaisation no consideration and are intended for quick copying.
Diese 3 Modi sind insbesondere in den Videomodi 4 und 6 mit den Benutzerdefinierten Zeichen interessant. These 3 modes are of particular interest in the video modes 4 and 6 with the custom characters. Die Organisation des Bildspeichers in den verschiedenen Videomodi wird im Abschnitt Der Bildspeicher genauer beschrieben. The organization of the image memory in the different video modes is described in the section, the image memory in more detail. 1.19 PRINT [?] PRINT 1.19 [?]Der PRINT Befehl entspricht weitestgehend seinem Pendant im Textmodus. The PRINT command corresponds largely to its counterpart in text mode. Unterschiedlich sind die Koordinatenangaben die hier anstelle von Zeichen in Pixeln angegeben werden. The different coordinates are given here instead of characters in pixels. Und das Format-Attribut "Grossschrift" entspricht doppelter Zeichenhöhe und -breite. And the format attribute "Large font" dou character height and width. Ausserdem funktioniert der Zeilenumbruch nicht wie man es erwartet, es wird lediglich an den Anfang der nächsten Pixelzeile gesprungen. In addition, word-wrap is not as you would expect, it is bound only to the beginning of the next line of pixels.1.20 FONT n 1.20 FONT nIn den Grafikmodi 1...3 und 5 ist zusätzlich zum Standard-Font mit 6x10 Pixeln ein kleinerer Font mit 4x6 Pixeln verfügbar. In Modes 1 .. 3 and 5 in addition to the standard font with a smaller font 6x10 pixels with 4x6 pixels is available. Umgeschaltet wird mit FONT 0 für den Standard Font und FONT 1 für den Mini-Font. Switched with FONT 0. For the default font and font 1 for the mini-font2 Sprites 2 spritesSprites sind einzelne Zeichen oder einfache Zeichengruppen, die sich einfach an beliebiger Stelle auf dem Bildschirm anzeigen lassen. Sprites are single characters or simple groups of characters that can be easily show anywhere on the screen. Dabei wird der ursprüngliche Bildschirminhalt an dieser Stelle "gemerkt" und beim Verschieben oder Löschen des Sprites wieder restauriert. Here, the original screen contents at this point "noted" and when you move or delete the sprite restored. In der aktuellen Version können (theoretisch) bis zu 85 Sprites definiert werden, die tatsächliche Anzahl hängt von der Größe und dem verfügbaren Platz im Array ab. In the current version can (theoretically) up to 85 sprites can be defined, the actual number depends on the size and the available space in the array. Sprites funktionieren nur im Textmodus und nicht in den Grafikmodi. Sprites work only in text mode and not in the Display Modes.2.1 Sprite definieren 2.1 Sprite defineDafür gibt es keinen eigenständigen Befehl (mehr), da die Daten einfach im Array liegen (Byte-Bereich). There are no independent command (more) because the data in the array are simple (byte range). Jedes Sprite besteht aus einem Header von 5 Bytes, den eigentlichen Daten und dem Backup-Bereich. Each sprite comprises a header of 5 bytes, the actual data, and the backup area. Die Belegung der Bytes ist wie folgt: The assignment of bytes is as follows:
Ist das Kollisionsflag mit 0 vorbelegt, wird das Sprite bei einer Kollision nicht gezeichnet. Is Kollisionsflag default 0, the sprite is not drawn in a collision. Ist es mit 2 vorbelegt, wird das Sprite bei einer Kollision gezeichnet. It is preset to 2, the sprite is drawn in a collision. Danach folgen dx*dy Bytes für die darzustellenden Zeichen, gefolgt von dx*dy Bytes für die Attribute. Then follow dx * dy bytes for the characters to be displayed, followed by dx * dy bytes for the attributes. Die Attribut-Bytes sind Vordergrundfarbe + 16 * Hintergrundfarbe, bei Addition von 128 bleibt beim Zeichnen die ursprüngliche Hintergrundfarbe erhalten. The attribute bytes are foreground color + 16 * background color, in addition of 128 while drawing retained the original background color. Danach folgen noch 2*dx*dy Bytes in denen der ursprüngliche Bildschirminhalt beim Zeichnen automatisch gespeichert wird. This is followed by a further 2 * dx * dy bytes in which the original screen content while drawing is saved automatically. Ein minimales Sprite (1 Zeichen) braucht also 5+4=9 Bytes, eins mit 2x2 Zeichen schon 5+16=21 Bytes. A minimal sprite (1 mark) therefore needs 5 +4 = 9 bytes, one with 2x2 sign to 5 +16 = 21 bytes. Die Werte für die X und Y Koordinaten sollten ausserhalb des Bildschirmbereiches liegen, da ansonsten beim erstmaligen Aufrufen des Sprites der Backup-Bereich des Sprites dorthin kopiert wird. The values for the X and Y coordinates should be outside the area of the screen, otherwise the first time you access the sprites of the backup area of the sprite is copied there. 2.2 SPRITE n,y,x [SPR] 02.02 SPRITE n, y, x [SPR]Zeichnet das Sprite von Array-Adresse n an die Position Y,X. Draws the sprite array of address n to the position Y, X. War es bereits an einer anderen Stelle gezeichnet, wird es vorher gelöscht. Was already drawn to a different location, it is deleted before. Befindet sich an der Stelle wohin das Sprite gezeichnet wird bereits ein anderes Zeichen, dessen Position in der Zeichentabelle nicht ein Vielfaches von 16 ist, wird das Kollisionsflag gesetzt. Located at the point where the sprite is drawn already another character whose position in the character table is not a multiple of 16, which is set Kollisionsflag. Ist Bit 1 des Kollisionsflags nicht gesetzt, wird das Sprite nicht gezeichnet. If bit 1 of the collision flags are not set, the sprite is not drawn. Das Kollisionsflag wird nicht automatisch zurückgesetzt. The Kollisionsflag is not reset automatically. Sprites dürfen nicht über den Bildschirmrand hinaus gezeichnet werden, sonst wird mit einer Fehlermeldung abgebrochen. Sprites may not be drawn on the side of the screen, or is aborted with an error message. Werden für X und oder Y Koordinaten ausserhalb des Bildschirms (X>29, Y>22) angegeben, wird das Sprite vom Bildschirm verschwinden. For X and Y, or are outside the screen coordinates (X> 29, Y> 22) specify the sprite disappear.
Im Anschluß hüpft das Sternchen hin und her, bis es auf das Hindernis trifft. Following the star hops back and forth until it encounters an obstacle. Dieses bleibt stehen, das Sternchen ist "weg". This stops the asterisk is "gone". Wird die erste Zeile abgeändert in: The first line is changed to:
3 Audio 3 Audio3.1 NOTE n [NO] 3.1 NOTE n [NO]Ein Ton mit der Tonhöhe n (Halbtonschritte ab 220 Hz aufwärts) wird ausgegeben. A tone at the pitch n (semitones from 220 Hz upwards) is issued. Bei n=0 bis 62 werden Noten in einer "dunklen" Klangfarbe ausgegeben, bei n=64 bis 126 Noten mit einer "hellen" Klangfarbe. For n = 0 to 62 notes in a "dark" tone will be issued, at n = 64 to 126 notes with a "bright" sound. Bei n=63 und n=127 wird keine Note sondern Rauschen ausgegeben. At n = 63 and n = 127 no note but noise is emitted. Wird 128 zum Notenwert addiert, wird der Ton mit einer langsameren Hüllkurve ausgegeben. 128 is added to the note value, the sound is output at a slower envelope.
3.2 NOTE n,v [NO] 3.2 NOTE n, v [NO]Beim NOTE Befehl kann als zweiter Parameter die Lautstärke im Bereich von 0...15 angegeben werden. When CONT command as the second parameter, the volume in the range of 0 .. 15 are specified. Der angegebene Lautstärkewert gilt dann nur für diese eine Note. The specified volume level then only applies to this one note.3.3 VOL n 3.3 VOL nDieser Befehl dient zum steuern der Lautstärke, möglich sind Werte zwischen 0 und 15. This command is used to control the volume, possible values are between 0 and 15 Bei einem Wert von 0 wird die Tonausgabe nicht vollständig abgeschaltet, sollte aber kaum hörbar sein. A value of 0, the sound is not completely off, but it should be barely audible. Bei einem Wert von 15 wird die maximale Lautstärke erreicht. With a value of 15, the maximum volume is reached. Der eingestellte Lautstärkewert gilt für Noten und für den Sequenzer, solange dort die Lautstärke nicht für die einzelnen Noten explizit vorgegeben wird. The set volume value applies to notes and for the sequencer, while the volume there is not explicitly specified for each note.3.4 PLAY start,stop,speed,loops 3.4 PLAY start, stop, speed, loopsAVR-Chipbasic2 hat einen einfachen Sequenzer eingebaut. AVR Chipbasic2 has built a simple sequencer. Dieser benutzt das Array als Notenspeicher und läuft im Hintergrund. This note uses the array as memory and runs in the background. Als Parameter werden die Nummer der Arrayzelle (Byte-bereich) mit der ersten zu spielenden Note, die Anzahl der zu spielenden Noten sowie die die Anzahl der Halbbilder (1/50s bei PAL, 1/60s bei NTSC) für einen "Tick" Die Noten zwischen Start- und End Array-Zelle werden zyklisch abgespielt, die Anzahl der Zyklen wird mit dem Wert von loops (Byte-Variable) bestimmt. The parameters are the number of the cell array (byte-range) with the first note to be played, the number of notes to be played and the number of fields (for PAL 1/50s, 1/60s at NTSC) for a "tick" sheet between the start and end cell array are played cyclically, the number of cycles is determined by the value of loops (byte variable). Wenn dieser Wert größer als 127 ist wird der Zyklenzähler nicht nach jedem Durchlauf um 1 verringert, damit werden die Noten in einer Endlosschleife abgespielt. If this value is greater than 127, the cycle counter is not decreased by one after each pass, so that the notes are played in a loop. Jede Note besteht aus 2 Bytes im Array, im ersten Byte steht der Notenwert entsprechend dem NOTE -Befehl, im zweiten Byte die Anzahl der Ticks bis zur nächsten Note im unteren Nibble und die Lautstärke im oberen Nibble. Each note consists of 2 bytes in the array, the first byte of the note value is according to the CONT command in the second byte. The number of ticks until the next note in the lower nibble and the volume in the upper nibble Ist das obere Nibble 0, wird die aktuelle Lautstärke beibehalten. Is the upper nibble 0, the current volume is maintained.Das folgende Beispiel spielt fortlaufend 3 Töne auf und ab... The following example plays continuously 3 tones up and down ...
3.5 PSTAT(mode) 3.5 PSTAT (mode)Diese Funktion liefert Aufschluss darüber, was der Sequenzer gerade "macht". This function provides information about what the sequencer just "does". Ist der Byte-Parameter mode<255, dann wird der Zyklenzähler auf den Wert von mode gesetzt, mode=255 liefert nur den aktuellen Zyklenzähler zurück. If the byte-mode parameter <255, then the cycle counter is set to the value of mode, mode = 255 returns only the current cycle counter.
created with latex2web.pl v0.62 © 2006-2011 Joerg Wolfram Created with latex2web.pl v0.62 © 2006-2011 Joerg tungsten |