Enum ChannelAttribute
Channel attribute options used by ChannelSetAttribute(Int32, ChannelAttribute, Single) and ChannelGetAttribute(Int32, ChannelAttribute, out Single).
Namespace: System.Dynamic.ExpandoObject
Assembly: ManagedBass.dll
Syntax
public enum ChannelAttribute : int
Bitrate
The average bitrate of a file stream.
CPUUsage
The CPU usage of a channel. (in percentage).
This attribute gives the percentage of CPU that the channel is using, including the time taken by decoding and DSP processing, and any FX that are not using the "with FX flag" DX8 effect implementation. It does not include the time taken to add the channel's data to the final output mix during playback. The processing of some add-on stream formats may also not be entirely included, if they use additional decoding threads; see the add-on documentation for details.
Like CPUUsage, this function does not strictly tell the CPU usage, but rather how timely the processing is. For example, if it takes 10ms to generate 100ms of data, that would be 10%.
If the reported usage exceeds 100%, that means the channel's data is taking longer to generate than to play. The duration of the data is based on the channel's current sample rate (Frequency). A channel's CPU usage is updated whenever it generates data. That could be during a playback Buffer update cycle, or a Update(Int32) call, or a ChannelUpdate(Int32, Int32) call. For a decoding channel, it would be in a ChannelGetData(Int32, IntPtr, Int32) or ChannelGetLevel(Int32) call.
This attribute is read-only, so cannot be modified via ChannelSetAttribute(Int32, ChannelAttribute, Single).
DSDGain
BassDSD: The gain (in decibels) applied when converting to PCM.
DSDRate
BassDSD: The DSD sample rate.
EaxMix
The wet (reverb) / dry (no reverb) mix ratio... 0 (full dry) to 1 (full wet), -1 = automatically calculate the mix based on the distance (the default).
For a sample, stream, or MOD music channel with 3D functionality.
Obviously, EAX functions have no effect if the output device does not support EAX. GetInfo(out BassInfo) can be used to check that.
EAX only affects 3D channels, but EAX functions do not require Apply3D() to apply the changes. LastError.NoEAX: The channel does not have EAX support. EAX only applies to 3D channels that are mixed by the hardware/drivers. ChannelGetInfo(Int32, out ChannelInfo) can be used to check if a channel is being mixed by the hardware. EAX is only supported on Windows.
Frequency
The sample rate of a channel... 0 = original rate (when the channel was created).
This attribute applies to playback of the channel, and does not affect the channel's sample data, so has no real effect on decoding channels. It is still adjustable though, so that it can be used by the BassMix add-on, and anything else that wants to use it.
It is not possible to change the sample rate of a channel if the "with FX flag" DX8 effect implementation enabled on it, unless DirectX 9 or above is installed.
Increasing the sample rate of a stream or MOD music increases its CPU usage, and reduces the Length of its playback Buffer in terms of time. If you intend to raise the sample rate above the original rate, then you may also need to increase the Buffer Length via the PlaybackBufferLength config option to avoid break-ups in the sound.
Platform-specific
On Windows, the sample rate will get rounded down to a whole number during playback.
MidiChannels
BASSMIDI: The number of MIDI channels in a MIDI stream... 1 (min) - 128 (max).
For a MIDI file stream, the minimum is 16. New channels are melodic by default. Any notes playing on a removed channel are immediately stopped.
MidiCPU
BASSMIDI: The maximum percentage of CPU time that a MIDI stream can use... 0 to 100, 0 = unlimited.
It is not strictly the CPU usage that is measured, but rather how timely the stream is able to render data.
For example, a limit of 50% would mean that the rendering would need to be at least 2x real-time speed.
When the limit is exceeded,
MidiKill
MidiPPQN
BASSMIDI: Gets the Pulses Per Quarter Note (or ticks per beat) value of the MIDI file.
This attribute is the number of ticks per beat as defined by the MIDI file;
it will be 0 for MIDI streams created via
MidiSRC
BASSMIDI: The sample rate conversion quality of a MIDI stream's samples.
MidiState
BASSMIDI: The current state of a MIDI stream.
MidiTrackVolume
BASSMIDI: The volume level (0.0=silent, 1.0=normal/default) of a track in a MIDI file stream + track#.
track#: The track to set the volume of... 0 = first track.
The volume curve used by this attribute is always linear, eg. 0.5 = 50%.
The LogarithmicVolumeCurve config option setting has no effect on this.
During playback, the effect of changes to this attribute are not heard instantaneously, due to buffering.
To reduce the delay, use the PlaybackBufferLength config option to reduce the Buffer Length.
This attribute can also be used to count the number of tracks in a MIDI file stream.
MIDI streams created via
MidiVoices
BASSMIDI: The maximum number of samples to play at a time (polyphony) in a MIDI stream... 1 (min) - 1000 (max).
If there are currently more voices active than the new limit, then some voices will be killed to meet the limit. The number of voices currently active is available via the Voices attribute. A MIDI stream will initially have a default number of voices as determined by the Voices config option.
MidiVoicesActive
BASSMIDI: The number of samples (voices) currently playing in a MIDI stream.
This attribute is read-only, so cannot be modified via ChannelSetAttribute(Int32, ChannelAttribute, Single).
MixerLatency
BassMix: Custom output latency in seconds... default = 0 (no accounting for latency). Changes take immediate effect.
MusicActiveChannelCount
The number of active channels in a MOD music.
This attribute gives the number of channels (including virtual) that are currently active in the decoder, which may not match what is being heard during playback due to buffering. To reduce the time difference, use the PlaybackBufferLength config option to reduce the Buffer Length. This attribute is read-only, so cannot be modified via ChannelSetAttribute(Int32, ChannelAttribute, Single).
MusicAmplify
The amplification level of a MOD music... 0 (min) to 100 (max).
This will be rounded down to a whole number.
As the amplification level get's higher, the sample data's range increases, and therefore, the resolution increases. But if the level is set too high, then clipping can occur, which can result in distortion of the sound. You can check the current level of a MOD music at any time by ChannelGetLevel(Int32). By doing so, you can decide if a MOD music's amplification level needs adjusting. The default amplification level is 50.
During playback, the effect of changes to this attribute are not heard instantaneously, due to buffering. To reduce the delay, use the PlaybackBufferLength config option to reduce the Buffer Length.
MusicBPM
The BPM of a MOD music... 1 (min) to 255 (max).
This will be rounded down to a whole number. This attribute is a direct mapping of the MOD's BPM, so the value can be changed via effects in the MOD itself. Note that by changing this attribute, you are changing the playback Length. During playback, the effect of changes to this attribute are not heard instantaneously, due to buffering. To reduce the delay, use the PlaybackBufferLength config option to reduce the Buffer Length.
MusicPanSeparation
The pan separation level of a MOD music... 0 (min) to 100 (max), 50 = linear.
This will be rounded down to a whole number. By default BASS uses a linear panning "curve". If you want to use the panning of FT2, use a pan separation setting of around 35. To use the Amiga panning (ie. full left and right) set it to 100.
MusicPositionScaler
The position scaler of a MOD music... 1 (min) to 256 (max).
This will be rounded down to a whole number. When calling ChannelGetPosition(Int32, PositionFlags), the row (HIWORD) will be scaled by this value. By using a higher scaler, you can get a more precise position indication. The default scaler is 1.
MusicSpeed
The speed of a MOD music... 0 (min) to 255 (max).
This will be rounded down to a whole number. This attribute is a direct mapping of the MOD's speed, so the value can be changed via effects in the MOD itself. The "speed" is the number of ticks per row. Setting it to 0, stops and ends the music. Note that by changing this attribute, you are changing the playback Length. During playback, the effect of changes to this attribute are not heard instantaneously, due to buffering. To reduce the delay, use the PlaybackBufferLength config option to reduce the Buffer Length.
MusicVolumeChannel
The volume level... 0 (silent) to 1 (full) of a channel in a MOD music + channel#.
channel: The channel to set the volume of... 0 = 1st channel.
The volume curve used by this attribute is always linear, eg. 0.5 = 50%. The LogarithmicVolumeCurve config option setting has no effect on this. The volume level of all channels is initially 1 (full). This attribute can also be used to count the number of channels in a MOD Music. During playback, the effect of changes to this attribute are not heard instantaneously, due to buffering. To reduce the delay, use the PlaybackBufferLength config option to reduce the Buffer Length.
MusicVolumeGlobal
The global volume level of a MOD music... 0 (min) to 64 (max, 128 for IT format).
This will be rounded down to a whole number. This attribute is a direct mapping of the MOD's global volume, so the value can be changed via effects in the MOD itself. The "speed" is the number of ticks per row. Setting it to 0, stops and ends the music. Note that by changing this attribute, you are changing the playback Length. During playback, the effect of changes to this attribute are not heard instantaneously, due to buffering. To reduce the delay, use the PlaybackBufferLength config option to reduce the Buffer Length.
MusicVolumeInstrument
The volume level... 0 (silent) to 1 (full) of an instrument in a MOD music + inst#.
inst: The instrument to set the volume of... 0 = 1st instrument.
The volume curve used by this attribute is always linear, eg. 0.5 = 50%. The LogarithmicVolumeCurve config option setting has no effect on this. The volume level of all instruments is initially 1 (full). For MOD formats that do not use instruments, read "sample" for "instrument". This attribute can also be used to count the number of instruments in a MOD music. During playback, the effect of changes to this attribute are not heard instantaneously, due to buffering. To reduce the delay, use the PlaybackBufferLength config option to reduce the Buffer Length.
NetworkResumeBufferLevel
The download Buffer level required to resume stalled playback in percent... 0 - 100 (the default is 50%).
This attribute determines what percentage of the download Buffer (NetBufferLength) needs to be filled before playback of a stalled internet stream will resume. It also applies to 'buffered' User file streams created with CreateStream(StreamSystem, BassFlags, FileProcedures, IntPtr).
NoBuffer
Non-Windows: Disable playback buffering?... 0 = no, else yes..
A playing channel is normally asked to render data to its playback Buffer in advance, via automatic Buffer updates or the Update(Int32) and ChannelUpdate(Int32, Int32) functions, ready for mixing with other channels to produce the final mix that is given to the output device.
When this attribute is switched on (the default is off), that buffering is skipped and the channel will only be asked to produce data as it is needed during the generation of the final mix. This allows the lowest latency to be achieved, but also imposes tighter timing requirements on the channel to produce its data and apply any DSP/FX (and run mixtime syncs) that are set on it; if too long is taken, there will be a break in the output, affecting all channels that are playing on the same device.
The channel's data is still placed in its playback Buffer when this attribute is on, which allows ChannelGetData(Int32, IntPtr, Int32) and ChannelGetLevel(Int32) to be used, although there is likely to be less data available to them due to the Buffer being less full.
This attribute can be changed mid-playback.
If switched on, any already buffered data will still be played, so that there is no break in sound.
This attribute is not available on Windows, as BASS does not generate the final mix.
NoRamp
Disable playback ramping?
OpusOriginalFrequency
BassOpus: The sample rate of an Opus stream's source material.
Opus streams always have a sample rate of 48000 Hz, and an Opus encoder will resample the source material to that if necessary. This attribute presents the original sample rate, which may be stored in the Opus file header. This attribute is read-only, so cannot be modified via ChannelSetAttribute(Int32, ChannelAttribute, Single).
Pan
The panning/balance position of a channel... -1 (Full Left) to +1 (Full Right), 0 = Centre.
This attribute applies to playback of the channel, and does not affect the
channel's sample data, so has no real effect on decoding channels.
It is still adjustable though, so that it can be used by the
It is not possible to set the pan position of a 3D channel. It is also not possible to set the pan position when using speaker assignment, but if needed, it can be done via a DSPProcedure instead (not on mono channels).
Platform-specific
On Windows, this attribute has no effect when speaker assignment is used, except on Windows Vista and newer with the Bass.VistaSpeakerAssignment config option enabled. Balance control could be implemented via a DSPProcedure instead
Pitch
BassFx Tempo: The Pitch in semitones (-60..0..+60).
ReverseDirection
Playback direction (-1 = Reverse or 1 = Forward).
SampleRateConversion
The sample rate conversion quality of a channel
0 = linear interpolation, 1 = 8 point sinc interpolation, 2 = 16 point sinc interpolation, 3 = 32 point sinc interpolation. Other values are also accepted but will be interpreted as 0 or 3, depending on whether they are lower or higher.
When a channel has a different sample rate to what the output device is using, the channel's sample data will need to be converted to match the output device's rate during playback. This attribute determines how that is done. The linear interpolation option uses less CPU, but the sinc interpolation gives better sound quality (less aliasing), with the quality and CPU usage increasing with the number of points. A good compromise for lower spec systems could be to use sinc interpolation for music playback and linear interpolation for sound effects.
Whenever possible, a channel's sample rate should match the output device's rate to avoid the need for any sample rate conversion.
The device's sample rate could be used in CreateStream(Int32, Int32, BassFlags, StreamProcedure, IntPtr)
or MusicLoad(String, Int64, Int32, BassFlags, Int32) or
The sample rate conversion occurs (when required) during playback,
after the sample data has left the channel's playback Buffer, so it does not affect the data delivered by ChannelGetData(Int32, IntPtr, Int32).
Although this attribute has no direct effect on decoding channels,
it is still available so that it can be used by the
This attribute can be set at any time, and changes take immediate effect. A channel's initial setting is determined by the SRCQuality config option, or SampleSRCQuality in the case of a sample channel.
Platform-specific
On Windows, sample rate conversion is handled by Windows or the output device/driver rather than BASS, so this setting has no effect on playback there.
ScannedInfo
The scanned info of a channel.
Tempo
BassFx Tempo: The Tempo in percents (-95%..0..+5000%).
TempoAAFilterLength
BassFx Tempo Option: FIR low-pass (anti-alias) filter Length in taps (8 .. 128 taps, default = 32, should be %4).
See
TempoFrequency
BassFx Tempo: The Samplerate in Hz, but calculates by the same % as Tempo.
TempoOverlapMilliseconds
BassFx Tempo Option: Tempo Overlap in milliseconds (default = 12).
See
TempoPreventClick
BassFx Tempo Option: Prevents clicks with tempo changes (default = FALSE).
See
TempoSeekWindowMilliseconds
BassFx Tempo Option: SeekWindow in milliseconds (default = 14).
See
TempoSequenceMilliseconds
BassFx Tempo Option: Tempo Sequence in milliseconds (default = 82).
See
TempoUseAAFilter
BassFx Tempo Option: Use FIR low-pass (anti-alias) filter (gain speed, lose quality)? true=1 (default), false=0.
See
On iOS, Android, WinCE and Linux ARM platforms this is by default disabled for lower CPU usage.
TempoUseQuickAlgorithm
BassFx Tempo Option: Use quicker tempo change algorithm (gain speed, lose quality)? true=1, false=0 (default).
See
Volume
The volume level of a channel... 0 (silent) to 1 (full).
This can go above 1.0 on decoding channels.
This attribute applies to playback of the channel, and does not affect the channel's sample data, so has no real effect on decoding channels. It is still adjustable though, so that it can be used by the BassMix add-on, and anything else that wants to use it.
When using ChannelSlideAttribute(Int32, ChannelAttribute, Single, Int32) to slide this attribute, a negative volume value can be used to fade-out and then stop the channel.