lhl2617 / VSLilyPond

VSCode Extension for LilyPond
https://marketplace.visualstudio.com/items?itemName=lhl2617.vslilypond
96 stars 7 forks source link

Documentation for MIDI setup? #371

Closed rljes closed 2 months ago

rljes commented 1 year ago

I'm on Ubuntu.

I found https://hymnsinger.com/vscode, which links to https://hymnsinger.com/contributing#audio-playback, which links to https://github.com/frescobaldi/frescobaldi/wiki/MIDI-playback-on-Linux and https://github.com/frescobaldi/frescobaldi/wiki/MIDI-playback-on-Mac-OS-X.

Following those instructions, I managed to get fluidsynth up and running (it can play a MIDI file generated by saving a .ly in VSLilyPond), but VSCode still says Error: No output MIDI devices are found., and no devices appear in the list for input or output.

This request is in 2 parts:

  1. In the documentation, it might be useful to at least point at those frescobaldi resources for getting MIDI set up on linux and OSX, or even better add a walkthrough for different OSes.
  2. Do you have any advice for how to get my instance working?

Thanks for this excellent extension!

rljes commented 5 months ago

I installed node, npm, and jzz on my machine so that I could check output devices manually.

Paraphrasing the ts from github

let JZZ = require('jzz')
(async () => { const outputs = JZZ().info().outputs.map(x => x.name); return outputs})()

or copying the js from the installed extension

const JZZ = require("jzz");
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
const getOutputMIDIDevices = () => __awaiter(this, void 0, void 0, function* () {
        const outputs = JZZ()
            .info()
            // eslint-disable-next-line @typescript-eslint/no-explicit-any
            .outputs.map((x) => x.name);
        return outputs;
    });
getOutputMIDIDevices()

both return

Promise { [ 'Midi Through Port-0', 'FluidSynth' ] }

Yet, the extension does not detect any devices.

rljes commented 2 months ago

With an upgrade to Ubuntu 24 this is fixed.