Inferno #10
30 апреля 2007

Opportunities Spectrum - How to play multichannel music on beeper.

<b>Opportunities Spectrum</b> - How to play multichannel music on beeper.
                           On the beeper

Then I'll try to summarize a little what we know about
Spectrum as a sound processor. Perhaps here I am
What a miss (I almost do not know anything about consoles, aka 
Covox, GS etc.), but they are far from each user,

because of their lack of vision of this view is
appropriate. But who wants to, he adds.

"1." Digitization.
"2." Playing.

"H" - a return to the text.
"B" - the beginning of the text.
"E" - the end of the text.
"F" - Search.
"N" - look further.



  Despite its technical simplicity,
beeper can give very interesting and
variety of sounds.

   There are at least 5 essentially
different ways to play multi-channel
 music on the beeper:

  1. The addition of channels and output bits on to
 horn. Example - Robin of the Wood.

  2. The alternation of the channels within the period
rate (> 16 kHz). Used in
Specifically, in the Savage and the editor Wham! The
 Music Box.

  3. The generation of narrow pulses of overflow
pared counter-timers (each channel -
over the counter). Used in the players Fol
lin brothers (Agent X and other games), Special
FX (Midnight Resistance) and David'a Whitta
ker'a (game company Code Masters). Gives more
more pure sound than the previous
method, assuming the same number
kanalov.Obychno them here from 3 to 5.Impulsy
are fairly narrow, so that the generated
We fix the frequency is not floated, depending friend
from each other. Signal generated by such a play
rum, like the imposition of multiple periods
periodic signals with high porosity
(Duty ratio - the ratio of the repetition period
pulses to their duration). Pulses in
different channels rarely fall on each other
ha, and if the fall, in practice (because
method) in such cases, generates two
separate impulsa.Ponyatnee describe a method
quite difficult to look better code otla
 dchikom. The best example - Agent X 2.

  4. The addition of channels and output using
PWM. Allows you to use samples from the discharge
completely in a few bits (not 1). Do not use
 is.

  5. Arpeggio - Fast switching notes.
Used in very old games and
even in a frivolous old prog
Rummy (do not remember the name) and type
electronic musical instrument.

   For exotic timbres can preamplifier
motret and special synthesis, such as
Playing in tune application - two straight
coal-fired generator with similar periods
superimposed on XOR. I player in the game
Athena similar principle, although he did not ochevi
den.


                My Player

           (Play "Sewer")


   The advantage of method 2 to method 3 -
constant (more or less) during the passage
the main loop, which allows playback
Led digitized percussion instruments.
(Maybe then I'll try to implement them
and in the 3 rd method.)

   In the Wham! the authors limited the two Kan
Lamy, made it possible to keep time
run the main loop with a constant
chnostyu to measure. However, the large number
Unpack the kettle channels, and Fitch is a difficult and
can lead to a slowdown of the main cycles
la (if the period falls in the audible
region, will be whistling). So my player
has a main loop with floating dlitelnos
Tew and sounds a bit dirty.

   My collection of percussion instruments (8 pieces)
mostly converted to real
otsifrovok. Problems are caused by the barrel - one
had to generate a program, and another
cleaned from the noise vruchnuyu.Gromkost odnobit
GOVERNMENTAL otsifrovok regulated very ploho.Es
or simply to translate the upper half-cycles in
1, and the bottom is 0, the initial volume or
At that affects not budet.Ya used gene
radio pulses of "1" of different lengths - depending
depending on the area of ​​the upper half-cycle.
However, the coefficient of proportionality in
shlos for each sample set of
separately.

   Converter samples SUB16.H, generator
barrels GENBOCH.H, collector array samples
MERGSNAR.H and player BF8TIMEX.H (with track
out of the game) are in the appendix to the magazine.

   Music is written in the form of procedures, tools
elements and table-scores (patternovuyu system
I realize the topic did not, only separated
pouring channels). For each instrument requires
is a procedure that is called in early music, and
routine, called at a frequency of
order of 70 Hz for about noty.Pervaya
dure, for example, set the duration
"0" is equal to the duration of "1", while the second will
children gradually reduce the duration of one
at the expense of another. Duty cycle affects the thunder
bone channel, but also affects its
timbre.

   Connecting procedures and change other parameters
parameters of the player (eg, superposition method
nakotoryh pairs of channels - can usually
alternation can be AND / OR / XOR) occurs in
score, code type POKE addr, n (macro
pb) and type codes DPOKE addr, nn (macro
pw).

   The predictability of the sound received by
upon application of channels having equal or
multiple frequencies, should be managed in phases
generators.

   If you use too short ne
ods all player starts slow
lennee and can sing sharp - use them
as little as possible!


                   PWM


   GriV (sm.statyu annex) Offering
em to play digital audio beeper, preliminary
Satisfactory counting sound on higher
kuyu sampling, controlling the level of
signal at the output sound system with the help of
schyu short pulses. At the same time preserving
are all the high frequencies, but sound
such a high sampling occupy
maet too much space and poorly packaged.

   More preferably, from my point
view, a way to output otsifrovok bipe
result is a pulse-width modulation
(PWM).

   An article about the PWM IG # 6 contains a number of 
inaccuracies  surface.


  0. Of course, the frequency of 22,100 Hz is not a
is standard. Standard number 11025 -
22050 - 44100 Hz. However, on hearing 22,100 Hz
 of 22050 Hz is not distinguished.

  1. As mentioned there is the third
method, "Untitled" unstable period
repetition results in noise
distortion around spektru.Eto replaced
see Note refers to a method GriV'a, especially
but when you consider that the repetition period of impu
lsov not bounded from above and can enter
 in the audible frequency.

  2. Phase change of the PWM pulses (when in
irreducible there player to Covox) - also outside the
certainly creates noise. Apparently, the beam
PWM PWM option would be the impetus Align
vanny in the period (such a regime is in some
toryh microcontrollers), but the program
me to implement Z80 is quite samples
lematichno (to keep the procedure for
each position and for each phase of the algorithm
rhythm extraction). Therefore, should stay
clamber on impulse which begins within
 period fixed.

  3. The output signal of the sound system
(It is usually filtered, often
RC-chain) after one period of the PWM is not
can get to the level corresponding
steady-state value for the wells
This particular signala.Pri our audio converter
can not predict the average level for
one period, because the characteristics
used filters can be very
different. Therefore desirable to use
the dynamic range of the beeper. Better
restrict the average - 30-70%.
Complete predictability is not possible,
but such a restriction on the signal at least
growth rate and the fall of the output voltage
tion will be more or less constant.


   Compression of 6-bit audio 4-bit deltakodom (increment 
limited -8 .. 7) is weakly distorts the sound and very 
applicable in practice tike.Szhatie on my 2-bit versions

of ADPCM (choice of the current increment of the Origin of
goes only from the 4 options, potential for
previous increment, the increment of the restriction
were obtained -7 .. 7) gives a lot of noise, but the sound of
takes 2 times less space than a 4-bit
 delta code. 2-bit ADPCM (here:

         http://wiki.multimedia.cx/

       index.php? title = Covox_ADPCM
described by the original method) is well suited
for speech coding. However, tables weigh
# 3c00 bytes - to 48k this is the nepriemlemo.V
blitz for each input byte, and each
On the previous increment given 4 new
increments. You can write a player with ADPCM
small table (4 increments depending on
depending on the previous one - it was for this small
Lyonka table generated large), with
lower frequency PWM!

   My examples PWM players lying on the
http://alonecoder.narod.ru/zx/, have ne
RIOD in 163 cycles, which gives 21,960 Hz foams
tagone with quartz 14,318 kHz. Closer to 22,050
Hz with a number of cycles is not kinder
tsya. To achieve a UnrealSpeccy boleemenee crisp PWM with a 
period of 163 tact, we must replace 71,680 cycles per frame

specify 71800. Then the low-frequency pair
zitny signal caused by quantization, will leave
to lower (less audible)
frequencies. Theoretically, 71,882 would have been better
but in practice this gives misunderstood
tny me crack. PWM period, nesootnosimye
with a frequency of 44100 Hz (in general, often
the one specified in the settings if it is sup
rzhivaetsya sound card), an emulator
sounds bad. But on a real machine is not
plays a role, as long as the frequency of the PWM was
above the threshold of audibility.

   Sources players and converters for 4bitnogo delta code and 
2-bit ADPCM le lie in the application.



           Editors by beeper


   Here is a list of editors under the beeper,
used by the Polish composer Mister
 Beep (http://mister_beep.republika.pl/).

  1. Music Maestro (C) 1988 - 3 channels, no
 shock.

  2. The Music Studio (C) 1989 - 2 channels
not the best drummer. Synthesis similar to the Music
 Box.

  3. Orfeus Music Assembler (C) 1990 - 3
channel with good udarnymi.Krome addition, there
envelopes (but not edit).
So far the best in the collection of Mr Beep'a. Synthesis
 type 3.

  4. The Music Box (BEEPER version) (C) 1985
- Two channel pitch (extreme right-angled
tone). There are percussion (you can edit
their envelopes), but while they are playing the tone
sound can not. Many of us started with
 The editor:)

  5. Synthesizer KX-5 (C) 1987 - Generator
samples (tone / noise). This utility does not have
sequencer, it is made simply for the generation
tion of interesting sounds. Remember me
las my old program Sample Mixer, and
I assembled a new version v2.0 (see Appendix
 lines).

  6. Sintetizador De Voz (C) 1985 - Synthesis
 speech at the beeper.

  7. Loop Synthesizer (C) 1987 - another
 generator samples.

  8. Sampler (C) 1987 - simple otsifrovschik
single-bit zvuka.Tsifruet with tape
 entrance.

  9. ZX-7 Polyphonic Musical Instrument
(C) 1988 - although this program does not blow
GOVERNMENTAL, but there are 8 (!) channels with a very clean
sound. Sequencer, according to Mr Beep'a,
recalls Roland TB-303. The entire program
manages five knopkami.Sintez made
very interesting: with each new note in
Memory # c000 .. # ffff generated digitization
ka, which will be played. Generate
is it fast (but noticeable pause)
because it consists only of zeros and 1-bye
tnyh impulsov.Kazhdy channel is filled by
 the principle of LD (HL), C: ADD HL, DE.

  10. Virtual Synthesiser (C) 1985 - else
a sound generator. Can be a real
 time to change and play these sounds.

  11. 3 Channel Synthesiser, he is Music
Synth (C) 1989 - a very decent editor
with two channels of tone (with envelopes) and ka
nalom shock. Also the synthesis of type 3. False
can be avoided if you do not use high
 Kie notes. Would find the description ...

  12. Sample Tracker v2.0 (C) 1993 - 3-ka
birational digital editor for AY / Covox /
Beeper.Mozhno download and use of
arbitrary semply.Eta program have a wide
 to know for spectrophone # 19.

  13. Drum Machine (C) 1984 - odnokanal
Naya drum track played mashina.Poka
shock, you can edit it. Almost
neyuzabelno - different zvuchki have different
 duration.

  14. Albert Einstein (A.E.) Drums (C) 1985
- One single-channel drum machine, too
with synthesized ringtones. Much better
the previous one.


   Tim Follin, most likely did not have a
special editor, and music was gaining
directly under the codes specifically for
provinces, players. Anyway, I for
game "Sewerage," it was easier to recruit th
zyku code than to write the editor.


                  *



   When programming a beeper should
given that the target audience enjoys
mostly foreign cars image
sample. Therefore, the program, and preferably given
nye, must lie in the fast memory (# 8000 and # bfff pg0).

   Interrupts must be kept off,
as small delay in a random place
player can be heard in the form of mud. Because of the 
interrupter vany player in Savage does not sound so pure,

as a player in the Wham! The Music Box.

Alone Coder




Other articles:

Likbez - Batteries. Practices.

Likbez - Batteries. Results of experiments with different batteries.

Opportunities Spectrum - The format ani-files on the ZX.

Inferno - The authors of the magazine.

Opportunities Spectrum - How to play multichannel music on beeper.

Opportunities Spectrum - Support for the DVD format on ZX.

Gameland - On the competition absurd (or clumsy) games for the ZX Spectrum - Crap Games Competition.

Graphics - How to quickly draw colorful pictures.

Inferno - Entered from the editor.

Inferno - Errors in the previous numbers.

For Coderz - Gray code and optimization programs.

For Coderz - Building a graphical user interface.

Formats - details on the decoder jpeg.

Iron - Description of Products K561PU4.

Inferno - Letters to the Editor.

Formats - The format of a packed file MegaLZ.

Scorpion ZS - The structure of the markup on a computer hard drive Scorpion.

ZX Clones - multiplatform on the ZX Spectrum. Computers SAM Coupe and MSX.

Advertising - Advertising NedoPC.

Inferno - On the shell.

Activities - The "Spectrum" at the competition on the night orienteering Okinchitsa 2004.

Softinka - Comparative table of the results of packing code files with various packers.

Advertising - Advertising King of Evil.

Softinka - Software for printing in the annex to the magazine.

Softinka - Music Editor Pro Tracker v3.71. Revision history.

Advertising - Ads by V. Bogdanovich.

Iron - Some RND-generators.

Opportunities Spectrum - A hardware scrolling on ZX Spectrum.

Pentagon - Sinhroselektor video at Pentagon. Problems and the scheme.

DIY - Universal TAPE interface. Scheme of loading and recording tapes.

Sound - Features audio device TurboSound FM.

DIY - The scheme of the analyzer state TTL output.

Future Spectrum - Video Display V9990. Enhanced graphics capabilities ZX Spectrum.

Softinka - Updates to the image viewer: ANSI viewer, MCX viewer.

Interview - An interview with musician X-Raizor of Omega Hackers Group.


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:
As all this was - Coy any intra-city showdown. In Once again, "Eternity Industry" doused in mud tabloid "ZX-pILOT".
Overview - Overview of new products: UFOs - 2: The Devils are deep, patrol time. Top Ten games of the month.
St.Petersburg ZX Net - "Spectrum ZX - Honor and conscience of our epoch" (petseshnika admiration of the progress on the Spectrum).
People's Voice - I want poblagodopit people on eccentricity depzhitsya and necessarily will depzhatsya network.

В этот день...   21 November