[PD] How to get a list of midi devices without GUI

Jonathan Wilkes jancsika at yahoo.com
Sun Feb 9 17:20:03 CET 2014


In Pd-l2ork you can also do this:
[print(
|
[pdinfo]

Which prints all the info for the running Pd instance to the console, including devices.  Or you can send it a message to get a specific attribute like
[audio-outdev, midi-outdevlist(
|
[pdinfo]

I tried it with [loadbang] and -nogui, and all the audio devices display properly.  I can't test midi because I don't have any midi devices.


-Jonathan




On Sunday, February 9, 2014 10:49 AM, Antoine Villeret <antoine.villeret at gmail.com> wrote:
 
hello again, 


I found the issue, 

with `-nogui`, the patch is loaded before midisettings are done (like audiosettings)
and `[mediasettings/midisettings]` updates it's own device list on startup or on `[device ...(` message.

So when the patch is loaded at startup without gui, `[mediasettings/midisettings(` records 0 mididevices.
I have to send a dummy `[device ...(` message 1sec after loadbang to update the list and then `[listdevices(` report the right number of devices.
Another solution could be to delay the patch loading.

Shouldn't `[mediasettings/midisettings]` update it's own device lists on `[listdevices(` message ?

+
A




--
do it yourself                       
http://antoine.villeret.free.fr



2014-02-09 16:17 GMT+01:00 Antoine Villeret <antoine.villeret at gmail.com>:

thanks, but no, 
>
>
>at least with Pd Vanilla 0.45-4, the right flag is *-listdev* to list all devices (both midi and alsa) in the PD's console.
>
>
>According to this 10-years old post [1], I can still make a redirection of stderr or read at it.
>
>
>Another solution, since my problem concern only Linux, is to read the output of `ls /dev/midi* | wc -l` to get a list of mididevices, but this doesn't tell if it's input or output.
>
>
>+
>a
>
>
>[1] : http://lists.puredata.info/pipermail/pd-list/2004-10/023368.html
>
>
>--
>do it yourself                       
>http://antoine.villeret.free.fr
>
>
>
>2014-02-09 16:08 GMT+01:00 Pagano, Patrick <pat at digitalworlds.ufl.edu>:
>
>
>I think it's just --listdevices on the command line
>>
>>Sent from my iPhone
>>
>>On Feb 9, 2014, at 10:03 AM, "Antoine Villeret" <antoine.villeret at gmail.com> wrote:
>>
>>
>>Hello,  
>>>
>>>
>>>I'm wondering how to get a list of midiout devices without GUI.
>>>This has to work without GUI.
>>>
>>>
>>>I tried [mediasettings/midisettings] but it always report 0 devices (both in and out) when there is no GUI.
>>>i also know the -listdev option to Pd, but this only list devices in console, and I need to proccess the number in the patch.
>>>
>>>
>>>I observe this on Linux (both Ubuntu 12.04 64bit and Raspbian (kernel 3.10.25+) with pd 0.45-4.
>>>But it seems to be OK on MacOS with pd 0.45-3.
>>>
>>>
>>>Thanks
>>>
>>>
>>>Antoine
>>>
>>>
>>>--
>>>do it yourself                       
>>>http://antoine.villeret.free.fr
>>>
>>_______________________________________________
>>>Pd-list at iem.at mailing list
>>>UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
>>>
>


_______________________________________________
Pd-list at iem.at mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20140209/d85874b0/attachment.htm>


More information about the Pd-list mailing list