1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*!
# Rust fluidlite bindings
This project aims provide safe Rust bindings to [fluidlite](https://github.com/katyo/fluidlite) C library.
> FluidLite is a very light version of FluidSynth designed to be hardware,
> platform and external dependency independant. It only uses standard C libraries.
>
> It also adds support for SF3 files (SF2 files compressed with ogg vorbis)
> and an additional setting to remove the constraint of channel 9 (drums):
> fluid_settings_setstr(settings, "synth.drums-channel.active", "no");
> you can still select bank 128 on any channel to use drum kits.
>
> FluidLite keeps very minimal functionnalities (settings and synth),
> therefore MIDI file reading, realtime MIDI events and audio output
> must be implemented externally.
## Crates
* [__fluidlite__](https://crates.io/crates/fluidlite) Safe bindings
* [__fluidlite-sys__](https://crates.io/crates/fluidlite-sys) Unsafe bindings (generated using bindgen)
* [__fluidlite-lib__](https://crates.io/crates/fluidlite-lib) Bundled library
## Features
* __generate-bindings__ Force generate bindings on build instead of using pre-generated
## Example
```no_run
use std::{
fs::File,
io::Write,
};
use byte_slice_cast::AsByteSlice;
use fluidlite::{Settings, Synth};
let settings = Settings::new().unwrap();
let synth = Synth::new(settings).unwrap();
synth.sfload("soundfont.sf3", true).unwrap();
let mut buffer = [0i16; 44100 * 2];
let mut file = File::create("soundfont-sample.pcm").unwrap();
synth.note_on(0, 60, 127).unwrap();
synth.write(buffer.as_mut()).unwrap();
file.write(buffer.as_byte_slice()).unwrap();
synth.note_off(0, 60).unwrap();
synth.write(buffer.as_mut()).unwrap();
file.write(buffer.as_byte_slice()).unwrap();
```
*/
// Force linking with libfluidlite
use fluidlite_lib as _;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use fluidlite_sys as ffi;