BASIC8
Not enough ratings
Making Sound Effect
By Tony Wang
Difficulty: everyone
Category: audio, tool

The "Wave Maker" is a tool which makes waveform sound effect. It generates data to be played by the SFX function.
   
Award
Favorite
Favorited
Unfavorite
Getting the Wave Maker
The "Wave Maker" is implemented as a regular disk. Subscribe to the disk on Workshop, then it will be mounted in your BASIC8 environment.
Creating
You'll get the following interface after launching the maker:



Left click on grids in area (1) to choose waveform type of each effect node; it supports sine/square/triangle/sawtooth/noise waveforms. The playing direction of a sequence is from left to right on the horizontal axis. Left click on grids in area (2) to change interval of each node. An effect can contain up to 256 (0 to 255) nodes. Use left/right (arrow keys) or the buttons in area (3) to scroll horizontally.

Leave any interval of zero in area (2) for sequence endding.

Click the Frequence button or press the F key to switch to the note editing mode:



Left click on grids in area (4) to place notes. Left click on grids in area (5) to enable frequence interpolation between neighbour nodes, right click to disable it. There are three built-in octaves as candidate frequence section, use the up/down button in area (6) or press up/down (arrow keys) to scroll vertically.

Click the Volume button or press the V key to switch to the volume editing mode:



Left click on grids in area (7) to modify volume value of each node. Click the play button in area (8) or press the P key to toggle playing state.

Click the Basic button or press the B key to switch back to the basic editing mode.
Generating


Click the save icon in area (9) to generate result code of waveform sequence, then fill the clipboard with it. It looks like:

wav = wave() push(wav, 2, 261.63, 0.25, 1) push(wav, 2, 261.63, 0.25, 1) push(wav, 1, 329.63, 0.25, 1) push(wav, 1, 329.63, 0.25, 1) push(wav, 3, 293.67, 0.25, 1) push(wav, 3, 293.67, 0.25, 1) push(wav, 4, 261.63, 0.25, 1) push(wav, 4, 261.63, 0.25, 1) push(wav, 5, 329.63, 0.25, 1) push(wav, 5, 329.63, 0.25, 1)



Click the variable information button in area (10) to change the default variable name "wav", then fill in (11).
Playing
Paste generated sequence code at in the source code editor of a target project, then add the following code for example, to play it:

sfx wav
Customization
This tool offers common and simple effect editing. It would be a start point to make your own SFX tool. For example, modify the following lines to change the default frequence values and associated display:

FREQS = list ( 987.77, 880, 783.99, 698.46, 659.26, 587.33, 523.25, 493.88, 440, 392, 349.23, 329.63, 293.67, 261.63, 246.94, 220, 196, 174.61, 164.81, 146.83, 130.81 ) NOTES = list ( "B", "A", "G", "F", "E", "D", "C", "B", "A", "G", "F", "E", "D", "C", "B", "A", "G", "F", "E", "D", "C" )

Read the source code for more customizable details.