CRIWARE Unity Plugin Manual  Last Updated: 2024-07-12
Data: Pinball

Description of the sample

Overview

This is a sample project in CRI Atom Craft for a pinball game.

cri4u_samples_criatom_script_data_pinball_main.png

Data information


Middleware CRI ADX (CRI Atom)
Sample Sample data: Pinball
Location /CRIWARE/SDK/unity/samples/AtomCraftProject/AtomCraftWork_Pinball
Project file Pinball.atmcproj
Work unit WorkUnit_Pinball


Attention
The CueSheet of this sample project is managed in the "WorkUnit_Pinball" work unit.
To edit a Cue and preview it, right-click on "WorkUnit_Pinball" in the project tree and select "Edit work unit".
cri4u_samples_criatom_script_data_pinball_workunit.png

Description of the data

Sound data for a pinball game. ADX's various features are used to create a variety of sounds from a few sound materials.
The sound settings for each Cue are briefly described below.
Use them as a guide for creating sounds for your own projects.

General setting: DSP bus setting

A "Reverb" effect is set on DSP bus 1, and an "Echo" effect is set on DSP bus 2.
The send settings of each bus are set to DSP bus 0 (= final output). Note that no sound is heard unless DSP bus 0 is connected.
This sample data uses much reverb and echo on each Cue.
You can check how the reverb and echo effects are applied by selecting the tracks of each Cue, and looking at the bus send settings in the FX1 tab of the FX/AISAC pane.

cri4u_samples_criatom_script_data_pinball_dsp.png

cri4u_samples_criatom_script_data_pinball_bussend.png

Common: Limited number of sounds

In this project's data, "Cue limit" is configured to limit the number of simultaneous sounds that can play for each Cue.
For example, for the sound of the ball hitting the wall, the limit is set to 1 with a last-in, first-out priority, while for the sound of the ball hitting the target, a limit of 3 and a first-in, first-out priority are set.
This prevents many simultaneous sounds if many playback requests are received from the program in a short time. It also prevents a certain sound from using up the maximum number of sounds (= number of voice pools) in the program.

cri4u_samples_criatom_script_data_pinball_cuelimit.png

Sound of the ball hitting the wall

The sound of the ball hitting the wall is created by the Ball Cue.
This Cue receives the speed of the ball hitting the wall as a parameter from the game, which allows us to change its sound.

cri4u_samples_criatom_script_data_pinball_ball.png

The AISAC feature is used to change the sound.
The same input value (AISAC control 0:Any) is used to fine-tune three types of parameters.
They are the pitch (blue graph), the cutoff frequency of the biquad filter (red graph), and the Q value of the biquad filter (orange graph).
By using a stepwise graph, the pitch is adjusted to a round value.
To preview in the tool, you can use the cursor in the AISAC tab as a game input.
For the description of a game using AISAC, see the " Game: Pinball " script sample.
For more information about the AISAC feature, also see the " [CriAtom] AISAC " basic sample.

Sound of a lost ball

The sound of a lost ball is created in the BallLost Cue.
This Cue has three features:
  • Simultaneous playback of multiple tracks
  • Sound processing by track automation
  • Calling of another Cue (voice lines) using the Cue link feature

cri4u_samples_criatom_script_data_pinball_balllost.png

This Cue consists of three tracks, which are all played simultaneously.
To configure the playback of multiple tracks at the same time, set the "Type" of the Cue to "Polyphonic".
Other Cues (HitTarget and BGM) also play multiple tracks.
The first two tracks of this Cue use the track automation feature to change the pitch.
The blue graph on the waveform indicates the track automation setting.
It changes the original sound (glass.wav) completely.
It also applies a little reverb and echo to make the sound more compelling.
A similar sound processing using track automation is used in the Bumper Cue.
On the third track, another Cue "aaa", which was created for voice lines, is placed by using the "Cue link" feature.
Thus, any change in the settings of the "aaa" Cue will be reflected on BallLost Cue.
To create a Cue link, select a Cue in the tool, and drag and drop it on the track where you want to place it.

Voice line when the ball is lost

The voice line played when the ball is lost is created by the aaa Cue.
This Cue is called from the sound of a lost ball (BallLost) by a Cue link.
This Cue has two features:
  • Random playback of multiple tracks
  • Ducking of music and sound effects when a voice line is played

cri4u_samples_criatom_script_data_pinball_aaa.png

This Cue consists of four tracks, only one of which being randomly played.
To configure the playback, set the "Type" of the Cue to "Random & no repeat". This means that the tracks will be selected randomly, but it will never be the same twice in a row.
This adds variation to the voice line played when a ball is lost. A pronounced echo is also added to make the voice line sound more impressive.
Categories and the REACT feature are used as well to configure the ducking of the music and the sound effects when a voice line is played
In the general settings, three categories, "Other", "Voice", and "Music", were created.
The aaa Cue is assigned to the "Voice" category. Other Cues are assigned to the "Music" and "Other" categories.
REACT is configured so that the volume of the Music category is automatically turned down while a Cue from the Voice category is being played.

cri4u_samples_criatom_script_data_pinball_react.png

The REACT "Music_Voice" is configured so that the volume of the Music category is lowered to 0.20 while the Voice category is being played.
At the bottom of the REACT settings screen, the Cues of the various categories are shown. You can check how REACT influences a Cue by selecting and playing it here.
In this sample, the REACT "Other_Voice" is configured in the same way. The volume of the sound effects is turned down when a voice line is being played.
The ducking is also applied to the sound effects that are started while a voice line is being played.
REACT makes it possible to configure automatic ducking entirely within the tool, i.e. without requiring any involvement from a programmer.
For more information about categories and the REACT feature, also see the " [CriAtom] Category " basic sample.

Sound of the ball hitting the target

The sound of the ball hitting the target is created by the HitTarget Cue.
It looks like a simple Cue where the same sounds are played at slightly different timings, but its sound is changed.
This Cue uses AISAC in a slightly unusual way to change the sound.
  • It changes the pitch by a random AISAC control value
  • It also changes the pitch during playback by AISAC auto-modulation
Both of the AISACs used in this Cue are actually not taking input from the program.
The change in pitch by AISAC (AISAC control 0:Any) is set for the entire Cue.

cri4u_samples_criatom_script_data_pinball_hittarget_random.png

AISAC is not required for randomization of pitch. For example, you can set it easily by dragging the pitch slider up or down in the FX1 tab of the FX/AISAC pane. However, this method may select any value within the randomization range of the pitch.
For a sound such as hajiku.wav used in this Cue, a small change in pitch may sound a bit weird. To avoid that, we use a step graph only allowing certain values for the pitch, and we randomize the input values of the AISAC.
After creating the AISAC graph (like for the sound of the ball hitting the wall), the control type is set to "Random" and the random width to 2.00.
The random range is shown as a green belt in the slider area at the top of the AISAC graph.
(The AISAC control values are randomly selected from the random range based on the center of the value specified by the program. By setting the random width to 2.00, all the values will fit between 0.0 and 1.0, whatever number is specified for the AISAC control value by the program.)
The change in pitch using AISAC (AISAC control 1:Distance) is set on the first track.

cri4u_samples_criatom_script_data_pinball_hittarget_auto.png

Note that the control type of the AISAC is "Auto-modulation".
The type of the auto-modulation is set to "Loop" and the time to 2000 ms.
The graph of pitch change looks like a mountain with its top at 0.5 on the horizontal axis.
The AISAC's auto-modulation automatically changes the AISAC control value with time. The parameters specified by the program are therefore ignored.
This Cue is configured so that the AISAC control value is changed from 0.0 to 1.0 over two seconds, and the change is repeated.
Thus, a sound like "pyoon!" is created.
The AISAC's auto-modulation can be used to make cyclic changes over time (two-second loop here).
Track automation is in some way similar but it is more suitable for a sound change that is not cyclic.

Sound of a paddle

The sound of a paddle is created by the Paddle Cue.
Randomization of the parameters and reverb/echo are again used to create variations of the sound while still keeping the implementation simple on the program side.

cri4u_samples_criatom_script_data_pinball_paddle.png

The volume and pitch of the Cue are randomized to change the sound slightly.
The green areas on both sides of the sliders show the randomization range.
You can drag the slider up or down to change this range.

Music

Music is created by the BGM Cue.
BGM in this project is not a long waveform. On the contrary, many shorter waveforms are used to compose music as a whole.
The ADX's block playback function is used to change the music based on the number of lost balls.
The following section shows an overview of the system.

cri4u_samples_criatom_script_data_pinball_bgm.png

In this Cue, seven tracks are divided into four blocks.
The program increases the index (0, 1, 2, ... from the left) of the block to play based on the number of lost balls.
(For the details about the program, see the " Game: Pinball " sample.
For each block, the "Number of block loops" is set to -1 (infinite loop), the "Number of divided blocks" to 2, and the "Block transition type" to "Specified division".
The blocks are divided to increase the number of transition points, so that block change requests from the program are handled quickly.
Tracks 5 to 7 are used to create sound at block transitions.
Tracks 5 and 6 are played only when the next playback event switches blocks.
If the "Block transition play type" is set to "Play at transition", the background of the track is changed to diagonal stripes going up.
Track 7 is played only once when the block is reached.
If the "Block transition play type" is set to "Play at the first transition", the background of the track is changed to diagonal stripes going down.
To change the type of block transition, select a track and right-click it.

cri4u_samples_criatom_script_data_pinball_blocktype.png

Tracks 5 to 7 are colored in light green and vermilion so that they are easy to see. Even when the block transition play type is changed, the color is not changed automatically.