Thursday, July 11, 2019

Creating music on ZX Spectrum 48K with the randomize command


It can sound great, like the little R2-D2 robot on Star Wars film.


The randomize command creates a number from 0 to 1 if memory is correct.


Then the number is multiplied and used as argument to create sound using the BEEP command. A short duration is used on the BEEP command.


Using GOTO to the begining line of program command crates endless different quick notes.


If memory is correct the INT (intenger command) is used to quantize the pitch to the usual notes. But then the number is multiplied by a very small number so that pitch sounds correct to the human brain for high notes etc. see previous posts. Some kind of arrangement is made that the higher the nite the more it is multiplied by this number. The correct value of this number is found by experiment and listening to BEEP at a larger duration.


The little piezoelectric speaker inside the ZX spectrum sounds amazing for such including high frequency content applications.






No comments:

Post a Comment