Ted and all:

Good news! 

The problem where Rosegarden hangs at the end of recording the demo-piece from my MIDI device under development appears to be caused by something I was doing wrong in sending on the MIDI channel. 

In the Java Sound (MIDI) documentation, in doing a "send" on the MIDI receiver device, a time-stamp is specified.  I was just getting the system time in milliseconds for this time-stamp, but according to the details of the specification, it should be in microseconds, and not only that, it also needs to be relative to when the MIDI device was opened. 

The specification also states that if you don't use timestamps, to specify a -1L (which is what I ultimately changed the code to do). 

It turned out that my incorrect use of timestamps was preventing my device from working with the Java-Sound synthesizer.  When I finally realized this was the cause, and fixed it, I decided to try recording on two tracks in Rosegarden again, since this could affect it. 

When I tried it (three times), it succeeded all 3 times (it didn't hang when I stopped recording). 

There is still the problem of the wrong instruments sounding during the recording, and on one of the recordings it missed at least one note-off event on the chords track. 

I can work-around the problem of the wrong instruments sounding during the recording by turning off MIDI-thru routing in Rosegarden, and routing the MIDI signals from my device (using qjackctl) also to qsynth.  That way, I can hear what I'm playing (with the right instruments). 

I noticed an additional piece of information regarding the wrong instruments sounding during the recording. 

The first track (for the melody) was correctly using the oboe sound I had specified for it. 

The 2nd track (for recording the chords MIDI channel) was set to "String Ensemble 1", but the instrument that was sounding for that track was a piano (and neither of the tracks I used were set to any sort of piano sound). 

But I am convinced the change on my side has fixed the hang at the end of recording on two tracks simultaneously. 

I am sorry that my mistake has caused you to spend time looking at this, but it did expose other problems that still can cause difficulties for people using multiple (or split) keyboards. 

- Aere


On Wed, 2012-06-13 at 17:43 -0400, Ted Felix wrote:
On 6/13/2012 1:27 PM, Aere Greenway wrote:
I have come up with a way for you to reproduce the problem on your
system.  

  Wow.  Thanks for all this.  I'll see if I can squeeze some time in on this soon.  That repeating error message was related to the quantizer getting confused with notes of certain durations.  (At least the last time I worked on it, this is what the issue was.)  So I think the quantizer is a bit fragile and may be the culprit here.

  Here's my email that I drafted a while ago detailing the tests that I performed.  No crash, but I did verify the problem with recording multiple channels and hearing the wrong instruments:

================
While testing with two keyboards on different channels, I was able to verify one of Aere's observations.  In rg 11.11.42, if you have two keyboards, each set to a different channel, and recording on different tracks.  And if you have a different instrument on each track (e.g. piano and organ), you will hear a different instrument from each keyboard *while recording*.  While in "stop" mode, you will hear the instrument of the currently selected track for both keyboards.

Fast-forward to the latest svn, and the behavior is different while recording.  Instead of each keyboard playing its track's instrument, they both play the currently selected instrument (like when stopped).

Here are the steps to reproduce for those with only a single hardware MIDI keyboard:

1. Launch jack and fluidsynth.  (I use a script that I wrote for this.
   See "My Audio Script" at http://tedfelix.com/linux/linux-midi.html)
2. Connect hardware MIDI keyboard as usual.  Set it for MIDI channel 1.
3. Launch vmpk (the software MIDI keyboard) and set to channel 2.
4. Launch rg.
5. Make sure both MIDI keyboards are in Studio > Manage MIDI Devices.
6. In the "Recording Filters" in the Track Parameters box, set track 1
   to record from channel 1 and track 2 from channel 2.
7. Set instrument 2 to an organ to make it obviously different from
   the piano in track 1.
8. Arm tracks 1 and 2.
9. Press record.
10. Play on both keyboards.

With 11.11.42, the hardware keyboard on channel 1 will make piano sounds.  The software keyboard on channel 2 will make organ sounds. With the latest svn, both keyboards sound like either piano or organ depending on which track is currently selected.

Seems to me that the old behavior is more useful and we should try and get it back.
================

  Additionally, when recording to two channels, notes were dropped on channel 2.  This sounds similar to what you were describing.

  I think we've got three or four rather serious bugs to track down.  I'll move these to the top of my list for when I have some time.  We should probably open some bug reports to track these.  Feel free to do that if you want.

  If Tom has some time, he should be able to fix the problem with multiple channels all making the same sound when recording.  Although it might be a bit tricky.

Ted.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________ Rosegarden-devel mailing list Rosegarden-devel@lists.sourceforge.net - use the link below to unsubscribe https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

-- 

Sincerely,
Aere