klavier-jack

Crates.ioklavier-jack
lib.rsklavier-jack
version
sourcesrc
created_at2024-01-03 01:46:48.667254
updated_at2025-02-09 07:40:17.472492
descriptionJack library of klavier.
homepagehttps://github.com/ruimo/klavier-jack
repositoryhttps://github.com/ruimo/klavier-jack
max_upload_size
id1086923
Cargo.toml error:TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Shisei Hanai (ruimo)

documentation

https://github.com/ruimo/klavier-jack

README

Jack interface for klavier-core

Prepare

Linux(Debian)

You need to install jack.

$ sudo apt install qjackctl pulseaudio-module-jack libjack-jackd2-dev

Launch qjackctl.

$ qjackctl
  • Driver: alsa.
  • Interface: (default)
  • Sample Rate: 22kHz is sufficient for MIDI sequencer.
  • Frames/Period: 1024 or so.
  • Periods/Buffer: 5 (for example)
    If you specify smaller value, your application should run faster enough to send MIDI data. If you specify bigger value, some amount of time will be needed to start playing MIDI, i.e. the latency. (If you specify 5, 5 * 1024(=Frames/Period) / 22050(Sample Rate) = 0.23 secs would become the latency.)
  • MIDI Driver: seq.

Click Start on qjackctl before starting your application. Once your application started, clickg Graph on qjackctl. Your application will be shown with the name you specified in the first argument of jack::Client::new(). Your MIDI interface will be shown with the name 'system'. Connect your application's output to the system's MIDI interface.

Example

After the 'Prepare' described above, you can run sample.

$ cargo run --example sample01

Misc

Ticks per quarter(TPQ): 240 Tempo: The number of quarter notes per minute. Tick length (ms): 1000 * 60 / tempo / TPQ

Sampling Rate(SR): 22050 Cycle(ms): 1000 / SR

1 tick per cycle: SR * 60 / tempo / TPQ

1 cycle per tick: tempo * TPQ / SR / 60

Commit count: 60

cargo fmt