<p dir="ltr">Hi Perry,</p>
<p dir="ltr">Thanks for the suggestion, I'll try that out.<br>
In fact I realized that unfortunately killing the shred, or terminating the program is not enough to close the ports. You need to terminate ChucK.<br>
An alternative could be that of using Std.system("chuck midi_<a href="http://config.ck">config.ck</a>"). At this point I could simply print the port names on the terminal.</p>
<p dir="ltr">Anyway, I'll try both and see.</p>
<p dir="ltr">Cheers,<br>
Mario</p>
<p dir="ltr">-- <br>
electronic musician, sound artist, creative coder, QA engineer<br>
<a href="https://vimeo.com/creativecodingsalerno">https://vimeo.com/creativecodingsalerno</a> <a href="http://mbuoninfante.tumblr.com">http://mbuoninfante.tumblr.com</a> <a href="https://github.com/mariobuoninfante">https://github.com/mariobuoninfante</a> <a href="https://bitbucket.org/mariobuoninfante">https://bitbucket.org/mariobuoninfante</a></p>
<div class="quote">On 27 Mar 2020 16:09, &quot;Perry R. Cook&quot; &lt;prc@cs.princeton.edu&gt; wrote:<br type='attribution'><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>I’m not sure if they can be closed, but as long as you don’t chuck them to now, the extra ones really shouldn’t take up (much) computational resources.  <div><br /></div><div>One option would be to first run a <a href="http://MIDIConfig.ck">MIDIConfig.ck</a> file that opens them all and writes all the names and numbers into a MIDICONFIG.txt file.  Then when you run your main file, it reads that and only opens the one(s) you need.  Or your first <span style="color:rgb( 0 , 0 , 0 )"><a href="http://MIDIConfig.ck">MIDIConfig.ck</a> file could pick the one(s) you need and write only them into the temp file.</span></div><div><span style="color:rgb( 0 , 0 , 0 )"><br /></span></div><div><span style="color:rgb( 0 , 0 , 0 )">I’ve done this for PLOrk pieces, to figure out if laptops have accelerometers, and what orientation those are.</span></div><div><font color="#000000"><br /></font></div><div><font color="#000000">prc<br /></font><br /><div dir="ltr">from MyiPhone</div><div dir="ltr"><br /><blockquote>On Mar 27, 2020, at 9:00 AM, chuck-users-request&#64;lists.cs.princeton.edu wrote:<br /><br /></blockquote></div><blockquote><div dir="ltr">Send chuck-users mailing list submissions to<br />    chuck-users&#64;lists.cs.princeton.edu<br /><br />To subscribe or unsubscribe via the World Wide Web, visit<br />    <a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br />or, via email, send a message with subject or body &#39;help&#39; to<br />    chuck-users-request&#64;lists.cs.princeton.edu<br /><br />You can reach the person managing the list at<br />    chuck-users-owner&#64;lists.cs.princeton.edu<br /><br />When replying, please edit your Subject line so it is more specific<br />than &#34;Re: Contents of chuck-users digest...&#34;<br /><br /><br />Today&#39;s Topics:<br /><br />   1. Closing MIDI ports (mario buoninfante)<br /><br /><br />----------------------------------------------------------------------<br /><br />Message: 1<br />Date: Thu, 26 Mar 2020 19:51:41 &#43;0000<br />From: mario buoninfante &lt;mario.buoninfante&#64;gmail.com&gt;<br />To: ChucK Users Mailing List &lt;chuck-users&#64;lists.cs.princeton.edu&gt;<br />Subject: [chuck-users] Closing MIDI ports<br />Message-ID: &lt;dc574e2e-9f93-cb07-c743-38f88fa575e9&#64;gmail.com&gt;<br />Content-Type: text/plain; charset&#61;&#34;utf-8&#34;; Format&#61;&#34;flowed&#34;<br /><br />Hi,<br /><br /><br />Is it possible to close a MIDI port?<br /><br />I&#39;m working on a MIDI class, and to print all the available ports, I <br />open them one at the time and get the name. Then I end up with tons of <br />open MIDI ports I&#39;m not actually using.<br /><br />Apart from this, another user case could be a live set where different <br />scripts are launched and each of them wants to talk to a specific MIDI <br />port. Doing so one ends up with a lot of /leftovers/.<br /><br /><br />Cheers,<br /><br />Mario<br /><br />-- <br />electronic musician, sound artist, creative coder, QA engineer<br /><a href="https://vimeo.com/creativecodingsalerno">https://vimeo.com/creativecodingsalerno</a><br /><a href="http://mbuoninfante.tumblr.com">http://mbuoninfante.tumblr.com</a>/<br /><a href="https://github.com/mariobuoninfante">https://github.com/mariobuoninfante</a><br /><a href="https://bitbucket.org/mariobuoninfante">https://bitbucket.org/mariobuoninfante</a>/<br /><br />-------------- next part --------------<br />An HTML attachment was scrubbed...<br />URL: &lt;<a href="http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20200326/75ed2599/attachment-0001.html&gt;">http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20200326/75ed2599/attachment-0001.html&gt;</a>;<br /><br />------------------------------<br /><br />_______________________________________________<br />chuck-users mailing list<br />chuck-users&#64;lists.cs.princeton.edu<br /><a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br /><br /><br />End of chuck-users Digest, Vol 175, Issue 15<br />********************************************<br /></div></blockquote></div></div></blockquote></div>