1WildMidi_InitVIO(3) WildMidi Programmer's Manual WildMidi_InitVIO(3)
2
3
4
6 WildMidi_InitVIO - Initialize the library with file I/O callbacks
7
9 libWildMidi
10
12 #include <wildmidi_lib.h>
13
14 WildMidi_InitVIO (struct _WM_VIO *callbacks, const char *config_file,
15 uint16_t rate, uint16_t options)
16
18 Initializes libWildMidi in preparation for playback, and sets the func‐
19 tion pointers for file I/O as provided by the caller. This function
20 only needs to be called once by the program using libWildMidi.
21
22 callbacks
23 Pointer to a file IO callbacks structure. The _WM_VIO structure
24 is like the following:
25 struct _WM_VIO {
26 /* This function should allocate a buffer which has the size
27 * of the requested file plus one (size+1), fill the buffer
28 * with the file content, and the second parameter with the
29 * size of the file. */
30 void * (* allocate_file)(const char *, uint32_t *);
31
32 /* This function should free the memory of the given buffer */
33 void (* free_file) (void *);
34 };
35
36 config-file
37 The file that contains the instrument configuration for the
38 library.
39
40 rate The sound rate you want the the audio data output at. Rates
41 accepted by libWildMidi are 11025 - 65000.
42
43 options
44 The initial options to set for the library. see below.
45
46 WM_MO_LOG_VOLUME
47 By default the library uses linear volume levels typi‐
48 cally used in computer MIDI players. These can differ
49 somewhat to volume levels found on some midi hardware
50 which may use a volume curve based on decibels. This
51 option sets the volume levels to what you'd expect on
52 such devices.
53
54 WM_MO_ENHANCED_RESAMPLING
55 By default libWildMidi uses linear interpolation for the
56 resampling of the sound samples. Setting this option
57 enables the library to use a resampling method that
58 attempts to fill in the gaps giving richer sound.
59
60 WM_MO_REVERB
61 libWildMidi has an 8 reflection reverb engine. Use this
62 option to give more depth to the output.
63
64 WM_MO_WHOLETEMPO
65 Ignores the fractional or decimal part of a tempo set‐
66 ting. If you are having timing issues try
67 WM_MO_ROUNDTEMPO before trying this option. This option
68 added due to some software not supporting fractional tem‐
69 pos allowable in the MIDI specification.
70
71 WM_MO_ROUNDTEMPO
72 Rounds the fractional or decimal part of a tempo setting.
73 Try this option is you are having timing issues, if this
74 fails then try WM_MO_WHOLETEMPO. This option added due to
75 some software not supporting fractional tempos allowable
76 in the MIDI specification.
77
79 WildMidi_GetVersion(3), WildMidi_MasterVolume(3), WildMidi_Open(3),
80 WildMidi_OpenBuffer(3), WildMidi_SetOption(3), WildMidi_GetOutput(3),
81 WildMidi_GetMidiOutput(3), WildMidi_GetInfo(3), WildMidi_FastSeek(3),
82 WildMidi_Close(3), WildMidi_Shutdown(3), wildmidi.cfg(5)
83
85 Chris Ison <chrisisonwildcode@gmail.com> Bret Curtis <psi29a@gmail.com>
86
88 Copyright (C) WildMidi Developers 2001-2016
89
90 This file is part of WildMIDI.
91
92 WildMIDI is free software: you can redistribute and/or modify the
93 player under the terms of the GNU General Public License and you can
94 redistribute and/or modify the library under the terms of the GNU
95 Lesser General Public License as published by the Free Software Founda‐
96 tion, either version 3 of the licenses, or(at your option) any later
97 version.
98
99 WildMIDI is distributed in the hope that it will be useful, but WITHOUT
100 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
101 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
102 and the GNU Lesser General Public License for more details.
103
104 You should have received a copy of the GNU General Public License and
105 the GNU Lesser General Public License along with WildMIDI. If not, see
106 <http://www.gnu.org/licenses/>.
107
108 This manpage is licensed under the Creative Commons Attribution-Share
109 Alike 3.0 Unported License. To view a copy of this license, visit
110 http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Cre‐
111 ative Commons, 171 Second Street, Suite 300, San Francisco, California,
112 94105, USA.
113
114 18 May 2018 WildMidi_InitVIO(3)