electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
Live streaming at radio.electro-music.com

  host / artist show at your time
  Twyndyllyngs Live in person Chez Mosc
Please visit the chat
 Forum index » DIY Hardware and Software » ChucK programming language
MIDI persistence
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [3 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
plutek



Joined: Oct 24, 2014
Posts: 3
Location: toronto

PostPosted: Fri Oct 24, 2014 5:31 am    Post subject: MIDI persistence
Subject description: having problems with maintaining persistent MIDI connections
Reply with quote  Mark this post and the followings unread

greetings! i've posted on the mailing list with no answer yet, so thought i'd try here... Smile ...this is all on my main system (crunchbang debian-SID (64-bit), jack2, RME multiface on ExpressCard), which is a tested production environment and is generally reliable at 44100/128/2 for live use. i've usually used puredata, but am testing ChucK 1.3.4.0....

starting with chuck --loop, if i then add this shred, everything works fine, and xruns are minimal (i see updated values for "beat", calculated from incoming MIDI, and then i see the "done" message after 30s:

Code:

// set up MIDI
MidiIn min;
MidiOut mout;
MidiMsg msgin;
MidiMsg msgout;

// connect to port 1 and print result
<<<"MIDI in: ",min.open(1)>>>;
<<<"MIDI out: ",mout.open(1)>>>;

dur beat;

now + 30::second => time later;
while( now <later> now;
       while( min.recv(msgin) ){
                    ( msgin.data3 + 10 ) * 50::ms => beat;
        <<<beat>>>;
         }
}
<<<"done">>>;


note, however, that when the shred exits the connection from MIDI-in to ChucK persists, while the one to MIDI-out disappears (observed in qjackctl).

then, if i add the same shred again, ChucK claims to have made both MIDI connections (i.e. i see "1" for both the min.open(1) and mout.open(1) debug prints), but the connections window in qjackctl remains unchanged, showing only a connection from MIDI-in to ChucK, and showing no MIDI-out port from ChucK at all. also, the shred gets stuck there -- i don't see any updated values of "beat" upon MIDI input, and the shred never reaches "done". the shred just persists forever, without doing anything.

if i use a version of the shred with no min.open or mout.open statements (hoping to re-use the MIDI-in connections which seems to persist), the same hung behaviour as above ensues...

so, it seems that when the first shred finishes, the MIDI port system is left in some kind of dysfunctional state! am i missing something about how to deal with MIDI connections around stopping and starting shreds? (i see there is no .close event for MidiIn or MidiOut, so we can't explicitly take down our connections on shred exit.)

...or is this some issue related to the ALSA/Jack subsystem or a hardware problem?

thanks again for any help anyone can offer... cheers!
.pltk.
Back to top
View user's profile Send private message
plutek



Joined: Oct 24, 2014
Posts: 3
Location: toronto

PostPosted: Fri Oct 24, 2014 12:43 pm    Post subject: Reply with quote  Mark this post and the followings unread

another strange thing (possibly related):

if i start up the engine with "chuck --loop", and then do a "chuck --probe", the MIDI output port list is incomplete (lists only the first MIDI out port). the MIDI input list is fine. however, that second instance of chuck segfaults after giving the incomplete list.

i guess it's a different situation, since i'm starting another engine rather than just another shred, but the symptom seems pretty similar, so i thought it might be useful information...

anyone else seeing these sorts of things?
is there another, better way to deal with MIDI for multiple shreds or engines?

cheers!
.pltk.
Back to top
View user's profile Send private message
Antimon



Joined: Jan 18, 2005
Posts: 4120
Location: Sweden
Audio files: 360
G2 patch files: 100

PostPosted: Tue Nov 04, 2014 12:02 am    Post subject: Reply with quote  Mark this post and the followings unread

Sorry for late reply, but I thought I'd mention that recently chuck --probe always crashes with a segmentation fault on my OSX computer. Annoying...
_________________
Antimon's Window
@soundcloud @Flattr home - you can't explain music
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [3 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » ChucK programming language
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use