Assembly: Bass.Net (in Bass.Net.dll) Version: 184.108.40.206
[DllImportAttribute("bassmidi")] public static int BASS_MIDI_StreamCreateEvents( BASS_MIDI_EVENT events, int ppqn, BASSFlag flags, int freq )
<DllImportAttribute("bassmidi">] Public Shared Function BASS_MIDI_StreamCreateEvents ( events As BASS_MIDI_EVENT(), ppqn As Integer, flags As BASSFlag, freq As Integer ) As Integer
- Type: Un4seen.Bass.AddOn.MidiBASS_MIDI_EVENT
The array of BASS_MIDI_EVENTs containing the event sequence to play (the array should be terminated with a MIDI_EVENT_END event).
- Type: SystemInt32
The number of pulses per quarter note (or ticks per beat) value of the MIDI stream to create.
- Type: Un4seen.BassBASSFlag
Any combination of these flags (see BASSFlag):
BASS_SAMPLE_8BITS Use 8-bit resolution. If neither this or the BASS_SAMPLE_FLOAT flags are specified, then the sample data will be 16-bit. BASS_SAMPLE_FLOAT Use 32-bit floating-point sample data. WDM drivers or the BASS_STREAM_DECODE flag are required to use this flag in Windows. See Floating-point channels for more info. BASS_SAMPLE_MONO Decode/play the stream (MP3/MP2/MP1 only) in mono, reducing the CPU usage (if it was originally stereo). This flag is automatically applied if BASS_DEVICE_MONO was specified when calling. BASS_SAMPLE_SOFTWARE Force the stream to not use hardware mixing. BASS_SAMPLE_3D Use 3D functionality. This is ignored if BASS_DEVICE_3D wasn't specified when calling. 3D streams must be mono. The SPEAKER flags can not be used together with this flag. BASS_SAMPLE_FX Requires DirectX 8 or above: Enable the old implementation of DirectX 8 effects. See the DX8 effect implementations section for details. Use BASS_ChannelSetFX(Int32, BASSFXType, Int32) to add effects to the stream. BASS_STREAM_AUTOFREE Automatically free the stream when it ends. This allows you to stream a file and forget about it, as BASS will automatically free the stream's resources when it has reached the end or when BASS_ChannelStop(Int32) (or BASS_Stop) is called. BASS_STREAM_DECODE Decode the sample data, without outputting it. Use BASS_ChannelGetData(Int32, IntPtr, Int32) to retrieve decoded sample data. The BASS_SAMPLE_SOFTWARE, BASS_SAMPLE_3D, BASS_SAMPLE_FX, BASS_STREAM_AUTOFREE and SPEAKER flags can not be used together with this flag. BASS_SPEAKER_xxx Speaker assignment flags. BASS_MIDI_NOFX Disable reverb and chorus processing, saving some CPU time. This flag can be toggled at any time using BASS_ChannelFlags(Int32, BASSFlag, BASSFlag). BASS_MIDI_NOSYSRESET Ignore system reset events (MIDI_EVENT_SYSTEM) when the system mode is unchanged. This flag can be toggled at any time using BASS_ChannelFlags(Int32, BASSFlag, BASSFlag). BASS_MIDI_NOTEOFF1 Only release the oldest instance upon a note off event (MIDI_EVENT_NOTE with velocity=0) when there are overlapping instances of the note. Otherwise all instances are released. This flag can be toggled at any time using BASS_ChannelFlags(Int32, BASSFlag, BASSFlag). BASS_MIDI_SINCINTER Use sinc interpolated sample mixing. This increases the sound quality, but also requires more CPU. Otherwise linear interpolation is used.
- Type: SystemInt32
Sample rate to render/play the MIDI at (0 = the rate specified in the call; 1 = the device's current output rate (or the BASS_Init rate if that is not available).
Return ValueType: Int32
If successful, the new stream's handle is returned, else 0 is returned. Use BASS_ErrorGetCode to get the error code.
This function creates a 16 channel MIDI stream to play a predefined sequence of MIDI events. Any of the standard MIDI events listed in the BASS_MIDI_StreamEvent(Int32, Int32, BASSMIDIEvent, Int32) section can be used, but the MIDI_EVENT_MIXLEVEL, MIDI_EVENT_TRANSPOSE, and MIDI_EVENT_SYSTEMEX events are not available and will be ignored. The sequence should end with a MIDI_EVENT_END event. Multiple tracks are possible via the MIDI_EVENT_END_TRACK event, which signals the end of a track; the next event will be in a new track. Any MIDI_EVENT_TEMPO events should be in the first track.
The event sequence is copied, so the events array does not need to persist beyond the function call.
Soundfonts provide the sounds that are used to render a MIDI stream. A default soundfont configuration is applied initially to the new MIDI stream, which can subsequently be overridden using BASS_MIDI_StreamSetFonts(Int32, BASS_MIDI_FONT, Int32).
Away from Windows, all mixing is done in software (by BASS), so the BASS_SAMPLE_SOFTWARE flag is unnecessary. The BASS_SAMPLE_FX flag is also ignored. On Android and iOS, sinc interpolation requires a NEON-supporting CPU; the BASS_MIDI_SINCINTER flag will otherwise be ignored. Sinc interpolation is not available on Windows CE.
|BASS_ERROR_INIT||has not been successfully called.|
|BASS_ERROR_NOTAVAIL||Only decoding channels (BASS_STREAM_DECODE) are allowed when using the "no sound" device. The BASS_STREAM_AUTOFREE flag is also unavailable to decoding channels.|
|BASS_ERROR_NONET||No internet connection could be opened. Can be caused by a bad proxy setting.|
|BASS_ERROR_ILLPARAM||events are not valid.|
|BASS_ERROR_TIMEOUT||The server did not respond to the request within the timeout period, as set with the BASS_CONFIG_NET_TIMEOUT config option.|
|BASS_ERROR_FILEOPEN||The file could not be opened.|
|BASS_ERROR_FILEFORM||The file's format is not recognised/supported.|
|BASS_ERROR_FORMAT||The sample format is not supported by the device/drivers. If the stream is more than stereo or the BASS_SAMPLE_FLOAT flag is used, it could be that they are not supported.|
|BASS_ERROR_SPEAKER||The specified SPEAKER flags are invalid. The device/drivers do not support them, they are attempting to assign a stereo stream to a mono speaker or 3D functionality is enabled.|
|BASS_ERROR_MEM||There is insufficient memory.|
|BASS_ERROR_NO3D||Could not initialize 3D support.|
|BASS_ERROR_UNKNOWN||Some other mystery problem!|