Magazine Archive

Home -> Magazines -> Issues -> Articles in this issue -> View

Micro-Music

Music on the Screen

Article from Electronics & Music Maker, August 1981


A number of readers have written in asking for an example program to be published which would draw the music on the screen and play a tune. The program printed draws the stave and the notes of the beginning of the tune "Amazing Grace" and as the tune starts the appropriate notes light up as they play. The printout from the screen shown in Figure 1 illustrates the type of display you can expect to see on the Sharp MZ-80K microcomputer.

Figure 1. Screen display (using a printer in double size character mode to simulate results).


The MZ-80K screen display is made up of 25 lines of 40 characters thus giving a possible 1,000 characters on the screen. Each character is made up of an 8x8 dot matrix and, using the SET and RESET commands, it is possible to define to a quarter of a letter giving a resolution of 4,000 programmable points. The picture element positions on the screen are allocated as decimal addresses from 53248 and to light up the notes as they are played it is necessary to use POKE statements. Many users get confused using this special command on the MZ-80K, but it is easy if you type the following statement: POKE 53248 + X,Y; X corresponds to the location on the screen and will be a number between 0 for top left and 999 for bottom right. The value of Y will be between 0 and 255 and this number selects the character to appear on the screen and is detailed in the display code table in the MZ-80K manual.

The program given here starts by assigning X as 53248, allowing the user to simply say POKE X instead of having a much longer line each time saying POKE 53248. The tempo is also defined in the first line. Lines 15 to 25 display the first five bars with the appropriate notes of "Amazing Grace" on the screen. Line 26 shows the equivalent notes in Sharp Music notation. Line 28 has been included to display the chord sequence on the screen so that if you are feeling ambitious you can accompany your microcomputer with guitar, organ or piano. Lines 30 to 42 are the POKE commands to light up each note as it is played and then to return that note to normal before going on to light up and play the next.

You can hear one of our readers playing a guitar accompaniment to a tune composed by his MZ-80K on E&MM's Demo Cassette 3.

Programs of this type can be extended and whole tunes can be programmed to be played and displayed. Many schools are now using this method to assist in teaching music and modern 'video' age pupils seem to respond well to this new tuition method.

Previous issues of Electronics and Music Maker have detailed the special commands in the Sharp SP-5025 Basic which allows the programmer to select tempo, note and rest durations. A number of readers have written in with requests for certain tunes to be transcribed to a Sharp Basic program. A traditional tune like 'Greensleeves' is fairly simple especially as it has repeating sequences which can be assigned as a string. Three strings (G$, H$ and J$) are used in the 'Greensleeves' program thus enabling it to be written within 15 lines. Without the use of this technique writing music programs on the Sharp MZ-80K would be tedious and very repetitive.

The same string principle is applied in program 2, the 'Sailor's Hornpipe' - here all the music notes apart from those in lines 7 and 8 are in strings and assigned J1$, J2$, J3$, Ll$, L2$, L3$. Some readers have written in asking how the tempo can be changed without continually writing tempo statements. Readers who are experiencing this difficulty should study lines 5, 6 and 10 of the 'Sailor's Hornpipe' program as these lines contain the three changes of tempo required for this tune. The third program shown will play the 'Can Can' for you.

Careful study of these musical programs will soon allow readers to write far more complicated tunes as a Sharp Basic program.

Sample Music on the Screen program.
(Click image for higher resolution version)


Program 1. 'Greensleeves'.


Program 2. 'Sailor's Hornpipe'.


Program 3. 'Can Can'.


More with this topic


Browse by Topic:

Computing


Also featuring gear in this article



Previous Article in this issue

Project Wiring

Next article in this issue

Basically BASIC


Publisher: Electronics & Music Maker - Music Maker Publications (UK), Future Publishing.

The current copyright owner/s of this content may differ from the originally published copyright notice.
More details on copyright ownership...

 

Electronics & Music Maker - Aug 1981

Topic:

Computing


Gear in this article:

Computer > Sharp > MZ-80K

Feature by Graham Knight

Previous article in this issue:

> Project Wiring

Next article in this issue:

> Basically BASIC


Help Support The Things You Love

mu:zines is the result of thousands of hours of effort, and will require many thousands more going forward to reach our goals of getting all this content online.

If you value this resource, you can support this project - it really helps!

Donations for December 2024
Issues donated this month: 0

New issues that have been donated or scanned for us this month.

Funds donated this month: £0.00

All donations and support are gratefully appreciated - thank you.


Magazines Needed - Can You Help?

Do you have any of these magazine issues?

> See all issues we need

If so, and you can donate, lend or scan them to help complete our archive, please get in touch via the Contribute page - thanks!

If you're enjoying the site, please consider supporting me to help build this archive...

...with a one time Donation, or a recurring Donation of just £2 a month. It really helps - thank you!
muzines_logo_02

Small Print

Terms of usePrivacy