sound_specification - ryzom/ryzomcore GitHub Wiki


title: NeL Sound Specification (2001) description: Original specification for the NeL sound library — driver architecture, high-level API, environment sounds, effects, and parameter reference published: true date: 2026-03-15T00:00:00.000Z tags: editor: markdown dateCreated: 2026-03-15T00:00:00.000Z

Translated from "fr 2001 sound sound_specification" — the original specification for the NeL sound library, written by Vianney Lecroart and Olivier Cado at Nevrax. Last updated 23 July 2001. {.is-info}

Sound Driver Library (10 days)

R&D

Investigate how OpenAL and DirectSound3D work in order to find a common architecture. The DirectSound interface distinguishes between 2D (stereo) and 3D buffers. The OpenAL interface does not make a special case for stereo (2D) sound, but when a buffer contains stereo data, it is played in stereo without positioning (furthermore, OpenAL is implemented using DirectSound under Windows, at least in the Loki implementation, cf. UpdateSource() in Alc/alc.c).

Architecture

Design the classes and interfaces for the dynamic and static library. The interface and architecture should resemble the 3D library as closely as possible.

IListener, IBuffer, ISource, ISoundDriver (+ ILoader for loading and streaming, but this class will not necessarily be implemented in the driver but rather in the high-level library).

IListener and ISource also allow adding EAX environmental effects.

Game developers will not have direct access to these classes — they will use the high-level library instead.

Sound Driver Implementation (10 days)

Implement a dynamic library for OpenAL (or DirectSound, to be determined):

CListenerAL (singleton), CBufferAL, CSourceAL, CSoundDriverAL

The C* classes inherit from the I* interfaces.

High-Level Sound Library (20 days)

A NeL sound file contains the name of the sound data file (.wav, .mp3, etc.) as well as its static parameters (Inner/Outer Volume and Cone, Min/Max Distance, etc.).

Progress: Stereo sounds: no panning; 3D sounds: OK; EnvSounds: OK; EnvEffects: OK with simple zones (rectangular parallelepipeds)

Stereo Sound

Creation of a 2D sound, retrieval of a sound, dynamic modification of PAN, VOLUME, PLAY, STOP.

3D Sound

Creation of a 3D sound, retrieval of a sound, dynamic modification of position, velocity, PLAY, STOP.

Environment Sound (ambient sounds)

There are sounds that are both 2D and 3D: when the Listener is outside (Ext) a large circle (cylinder), they hear the sound as a 3D sound (mixed with any ambient sound present where they are). When they are located in a zone between this large circle and a small circle (Mid), this 3D sound is progressively decreased and replaced by a 2D sound. Inside the small circle (Int), they hear only the 2D sound (top-down view below).

Environment sound zone diagram showing three concentric zones: Ext (exterior, 3D sound), Mid (transition zone, crossfade between 3D and 2D), and Int (interior, 2D sound only), with the Listener positioned in different zones

This 2D sound is actually made up of 2 stereo channels mixed together, allowing a loop of several different sounds to be played. Transitions between 2 sounds are performed using crossfade mixing of the two. On top of this, punctual sounds can be added (see figure below).

Crossfade diagram showing two stereo channels with overlapping volume envelopes: as channel A fades out, channel B fades in, creating a smooth transition between ambient sounds over time

Loading a scene. The only interaction with the user is updating the Listener's position.

Locating the player (listener):

The AudioMixer knows the geography of the zone and automatically chooses the effects and environment sounds.

Hierarchy of envsounds:

Tree of zones from the most encompassing to the smallest. Progressive transition from one to another.

Configuration:

By character strings.

Selection of effects concerning sources (occlusion, etc. [5]):

(Not in the demo.)

Environmental Effect

Based on position in space, an environmental effect is automatically selected.

Editor

An editor will be created, probably integrated into 3ds Max, which will be used to build the zones indicating environment parameters (e.g. reverberations of a room) and the zones described in the Environment Sound section.

Editor for source parameters (nel/tools/sound/source_sounds_builder).

Other tools will also be needed to try and test sound environments.

Technical Details

Numbers in square brackets refer to the appendix.

Data Files

(NeL Sound, Sound designer, Level design)

Progress: (a) (b) (c); (d) only with cubes

Organization of sound files on disk

File types:

  • (a) Source sounds (mono + static source parameters [1]). Example: rabbit nibbling
  • (b) General sounds (stereo). Example: click, ambient music if any.
  • (c) Environment sounds (stereo + placement + mono + static source parameters). Example: bar heard from outside, thunderstorm
  • (d) Environmental reverb effects (effect parameters [4] + placement). Example: padded room, hall, forest

File formats:

  • (a) (b) (c) Text file (e.g. .nss and .nes for "NeL Source Sound" / Environment) containing the sound description: sound filename (mp3) + static parameters (cone, etc. [1])
  • Sound file (typically: .mp3)
  • (d) Environmental effects: text file .ned (for "NeL Effect/Environment Description") for parameters [4]

How these files are created

3ds Max plugin to link placements to the landscape / to building meshes.

Choosing Which Sounds to Play

(NeL Sound + Gamedev-Client)

Progress: Balancing (N sources -> T tracks; N unlimited, T=32) OK, sound identification by ID, environment configuration by character strings (finite number of cases)

Source priorities chosen by the gamedev

    1. Must play. Example: ?
    1. Play if possible. Example: ?
    1. Not a problem if not played. Example: rabbit nibbling

Priorities managed by distance from the player

Automatic calculation.

Sound identification by gamedevs (client)

  • How do we associate sounds rabbit_nibbling.nsd, rabbit_running.nsd to a rabbit object (agent?). TSoundId
  • How are sounds triggered? Example: when the rabbit starts running, the rabbit source (possibly already registered with the AudioMixer) must be associated with the buffer corresponding to the running sound. setSound(TSoundId)
  • Triggering of random sounds (birdsong...): in EnvSounds

Configuration

  • Examples: time of day (different environment sound during day and night); the number of people in a bar can influence its environment sound; rain adds a rain sound and changes the environmental effect at that location, etc.

Maximum number?

In principle, all objects known to the client that can emit sounds are registered as sources with the AudioMixer.

Can new sounds be downloaded?

(Probably not, in any case not in the demo.)

Buffer Loading Policy

Progress: static loading at init, unloading at exit

  • Static (in the demo; streaming: later)
  • When? Unloading?

What Remains to Be Done

For the demo

  • 3ds Max plugin for environments (sounds + effects)

After the demo

  • Dynamic buffer loading (after the demo) (e.g. streaming (possible in the ISource implementation which will use ILoader))
  • Occlusion (using EAX)
  • More environmental effect parameters?

Other Areas of Reflection

  • For EnvSounds, stereo sounds do not rotate. If they were AC3 5.1 sounds, could they rotate (in the opposite direction to the listener)?
  • Panning of stereo sounds does not seem to be implemented by OpenAL.

APPENDIX: Parameter List

Progress: Implemented: [1] [2] [3] all; [4] major EAX parameters and non-EAX parameters; [5] none

[1] Static Source Parameters

  • Gain (raw volume)
  • Min & Max Distances
  • Cone Inner & Outer Angles, Outer Gain (volume attenuation)

[2] Dynamic Source Parameters

  • Position
  • Velocity
  • Direction
  • Gain (volume)
  • SourceRelativeMode (specifies the coordinate frame for positions, global or relative to listener) (dynamic or static?)

[3] Dynamic Listener Parameters

  • Position
  • Velocity
  • Orientation
  • Gain (main volume)

[4] Environmental Effect Parameters (EAX) (cf. EAX20ext.pdf)

Major:

  • Environment (e.g. padded room, hall, forest)
  • Env Size

Minor (modified by an environment change):

  • Env Diffusion
  • Room & Room HF (volume of reflected sounds (at 2 levels) & for high frequencies)
  • Decay Time & Decay HF Ratio
  • Reflections & Reflections Delay (primary reflections)
  • Reverb & Reverb Delay (secondary reflections)
  • Room rolloff factor
  • Air absorption HF (reflects the atmosphere of the location)
  • Flags

Other global parameters (non-EAX):

  • Doppler factor (to exaggerate the Doppler effect)
  • Rolloff factor (attenuation as a function of distance)

[5] Per-Source Effect Parameters (EAX) (cf. EAX20ext.pdf)

  • Direct & Direct HF
  • Room & Room HF
  • Obstruction & Obstruction LF Ratio (obstacles)
  • Occlusion & Occlusion LF Ratio & Occlusion Room Ratio (walls) and material choice
  • Room rolloff factor
  • Air absorption factor
  • Outside volume HF
  • Flags

Credits

Authors

  • Vianney Lecroart
  • Olivier Cado
⚠️ **GitHub.com Fallback** ⚠️