ZX Forum #04
19 ноября 1997

world of sound Spectrum - chapter 4.3: Sound Effects - Management timbre.

<b>world of sound Spectrum</b> - chapter 4.3: Sound Effects - Management timbre.
         4.3. Timbre control


   To control the timbre of ZX-Spectrum since
did not fit as well as for management
volume. But, as the volume, it can be controlled within a small 
range. 

   As you already know, the tone depends on the
form of sound waves. As adapted for sound shaping subroutine
Volume control is not so easy
Made of different waveforms will have to do only two levels of 
volume. This can be done, for example, by using a subroutine: 
1415.  10 DI; ban interrupt

 20 LOOP1 LD B, 8; B = rate
 30 LOOP2 XOR A; A = border color (0)
 40 RLC E; scroll through the tone flag

                                    CY
1415. 50 JR NC, NOSIGN; if the flag CY = 0, then go

                                    on NOSIGN
 60 OR 16; setting bit D4 register A
 70 NOSIGN OUT (254), A; output to port A 254
 80 LD D, H; D = delay
 90 PAUSE DEC D; D = D-1
100 JR NZ, PAUSE; if D <> 0 then loop
110 DJNZ LOOP2; cycle rate
120 LD A, H; A = H
130 ADD A, L; add L to the A
140 LD H, A; H = A
150 DEC C; C = C-1
160 JR NZ, LOOP1; if C <> 0 then loop
170 EI; permission to interrupt
180 RET; Returns
2

   Before calling this subroutine to the register C Record 
length of notes in the register H - frequency, the register L - 
frequency offset (subject to negative value and nil), and in 
the case E - timbre. Please note that not all register values 
​​E have meaning. Thus, at a value equal to E

255 or 0 You do not hear anything, and
Tone 1 and 128 will sound absolutely
equally, etc.

   In essence, it makes sense to use
Only the following 19 tones: 1,3,5,7,9,11,
13,15,17,19,21,23,25,27,37,43,45,51 and 85.
All other values ​​are treated similarly to hearing it.

   The above program is only
example. You may well write their own,
reproducing sound with a 16-bit tone, or timbre, previously 
recorded in memory to a tape inputs (see Chapter

4.6).






Other articles:

Help - Description of the shell of an electronic book "ZX-FORUM 4.

Secrets of Successful Design - Head for the book "Design your Programs

screen effects - Running a string of R-Type.

screen effects - clearing the screen of Zynaps.

screen effects - "minimize" the screen from Comando Tracer.

screen effects - smooth "decay" of the screen Sommando Tracer.

screen effects - changed the character set for the original stylized font from the game Rockstar.

screen effects - "running out the string" out of the game Rockstar.

screen effects - "pouring" the screen of the game Rockstar.

screen effects - a complex multi-effects from the game Bubbler.

New top 40 procedures - scrolling display, a fusion of two images, inverting screen, rotate characters, replacement of attributes, fill a closed loop, the calculation of addresses in the screen, copy of the screen, etc.

Technology sprites - Part 1: Introduction.

Technology sprites - Part 2: The hunt for sprites (search and pulling).

Technology sprites - Part 3: Format of sprites.

Technology sprites - Part 4: Format of sprites with a mask.

Technology sprites - Part 5: Structure sprite blocks (both co-exist in memory sprite and mask, what data to help us quickly find the address of the sprite in memory, and much more.)

Technology sprites - Part 6: preparation of data for publication.

Technology sprites - Part 8: Printing sprites (coordinates are given in familiarity).

Technology sprites - Part 9: Printing sprites (coordinates given in pixels).

Technology sprites - Part 10: a review of programs to work with sprites and graphics.

world of sound Spectrum - Chapter 1: The Physics of Sound.

world of sound Spectrum - Chapter 2: Operator BEEP, Creating effects on BEEPe, Making Music on BEEPe.

world of sound Spectrum - Chapter 3: How is the sound device (BEEP'ra and methods of sound production).

world of sound Spectrum - Chapter 4: Programming sound in assembler.

world of sound Spectrum - Chapter 4.1: Programming sound effects - Tone, Noise, Complexes effects.

world of sound Spectrum - Chapter 4.2: Programming Sound Effects - Volume Control.

world of sound Spectrum - chapter 4.3: Sound Effects - Management timbre.

world of sound Spectrum - Chapter 4.4: Programming sound effects - music programming.

world of sound Spectrum - Chapter 4.5: Programming sound effects - Polyphonic ringtones (polyphonic).

world of sound Spectrum - chapter 4.6: Treatment of external signals - digitization.

world of sound Spectrum - Chapter 4.7: Handling of external signals - Reverberation.

world of sound Spectrum - chapter 4.8: Synthesis of speech.

world of sound Spectrum - Chapter 4.9: audio playback interrupt.

world of sound Spectrum - Chapter 5: The operator PLAY for music coprocessor AY- 3-8910 (AY-3-8912).

world of sound Spectrum - Chapter 5.1: Creating effects operator PLAY.

world of sound Spectrum - Chapter 5.2: Making Music on PLAYe.

world of sound Spectrum - Chapter 6.1: Description of the coprocessor registers of the musical AY- 3-8910 (AY-3-8912).

world of sound Spectrum - Chapter 6.2: Programming effects and music under the musical coprocessor AY- 3-8910 (AY-3-8912).

world of sound Spectrum - Chapter 7: Software Review ZX-Spectrum to create sounds and music.

world of sound Spectrum - chapter 7.1: Editor, Sound Effects SUPER SOUND.

world of sound Spectrum - Chapter 7.2: Music Editor Wham the Music Box.

world of sound Spectrum - Annex 1, 2: Listings sound effects SUPER SOUND'a, tips assembler.


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

Similar articles:
Scene - shit on da scene: "lately scene abundance of a bunch of stench, frank bezdarschiny and bad taste."
Letter - Letter from Maxim Golikov (DarkMax).
From the Editor - The delay in the release rates of the newspaper.

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