octave-patch-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-patch-tracker] [patch #9868] midi functions


From: Lars Kindermann
Subject: [Octave-patch-tracker] [patch #9868] midi functions
Date: Mon, 25 Nov 2019 23:52:26 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0

Follow-up Comment #8, patch #9868 (project octave):

Under ALSA on Linux the names of devices tend to change after restarting
programs because the "name" is a concatenation of the immutable device name
and an assigned alsa id:


>> mididevinfo
MIDI devices available
ID Direction Interface  Name
0       output       Alsa Midi Through 14:0
1       output       Alsa VMPK Input 129:0
2       output       Alsa FLUID Synth (10094) 130:0
3       output       Alsa RtMidi Input Client 132:0
4        input       Alsa Midi Through 14:0
5        input       Alsa VMPK Output 128:0


after closing and restarting vmpk and qsynth changes to


>> mididevinfo
MIDI devices available
ID Direction Interface  Name
 0       output       Alsa Midi Through 14:0
 1       output       Alsa VMPK Input 136:0
 2       output       Alsa FLUID Synth (10866) 130:0
 3       output       Alsa RtMidi Input Client 132:0
 4        input       Alsa Midi Through 14:0
 5        input       Alsa VMPK Output 135:0


This makes it difficult to address devices in an octave script permanently
without the need to check for the current ID every time.

I suggest to change 


function t = match_name_and_type(x, name, type)
  t = (strcmpi(x.Name, name) && strcmpi(x.Direction,type));
endfunction


to


function t = match_name_and_type(x, name, type)
  t = (strncmpi(x.Name, name, length(name)) && strcmpi(x.Direction,type));
endfunction


so this will work


>> devin  = mididevice ('input' ,'VMPK Output')
devin =

  mididevice connected to
    input: 'VMPK Output 128:0' (6)


>> devout = mididevice ('output','FLUID Synth')
devout =

  mididevice connected to
    output: 'FLUID Synth (10866) 130:0' (2)




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/patch/?9868>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]