You are here

program change error?

Hi - first off, thanks so much for this awesome piece of software!

I ran into this problem regarding program changes in MIDI output imported from a file on version 0.8.3.17git.336c35. If I play the attached file (I added a _.txt extension since .mid isn't allowed?), aseqdump gives the following output:

Source  Event                  Ch  Data
  0:1   Port subscribed            128:0 -> 134:0
 14:0   Program change          0, program 4
 14:0   Note on                 0, note 70, velocity 104
 14:0   Note off                0, note 70
 14:0   Program change          0, program 15
 14:0   Note on                 0, note 72, velocity 104
 14:0   Note off                0, note 72

However, if I initialize a qtractor project, and import the .mid to the beginning of the project, I get the following dump from qtractor:

Source  Event                  Ch  Data
  0:1   Port subscribed            128:0 -> 133:0
128:0   System exclusive           F0 7F 7F 06 02 F7
128:0   Start
128:0   Program change          0, program 4
128:0   Note on                 0, note 70, velocity 104
128:0   Note off                0, note 70, velocity 0
128:0   Program change          0, program 4
128:0   Note on                 0, note 72, velocity 104
128:0   Note off                0, note 72, velocity 0
128:0   Control change          0, controller 120, value 0
128:0   Control change          0, controller 123, value 0
128:0   System exclusive           F0 7F 7F 06 01 F7
128:0   Stop
128:0   System exclusive           F0 7F 7F 06 44 06 01 00 00 02 18 00 F7
128:0   Song position pointer      value 33

The event list shows the correct program changes, but it looks like qtractor sends the wrong message. Is this a problem with qtractor, or is the file malformed? Thanks again.

(As a side note, is there an easy way to try to contribute to this project? I'd be maybe interested in the MIDI piano roll interface)

AttachmentSize
Plain text icon rename to program-change.mid85 bytes
Image icon event.png18.47 KB
Forums: 

Oh, I think I see now - I didn't realize that a qtractor MIDI track had a prog associated with it that overrides program change messages, and that that prog was the first PGM change in the track in the file.

The code (or the HACK comment at least) seems to suggest this is intentional, if only temporarily - could you point me to why there's this override? Thanks.

rncbc's picture

yes, this is not an error, all is intentional and working as design.

MIDI tracks, in qtractor model convention, are mapped (1:1) to one and single MIDI channel which in turn maps (also in 1:1 fashion) to one and only possible MIDI instrument selection (ie. MIDI bank_select + program_change number) as a property for the MIDI track/channel conveyor so to speak.

That said, when importing a MIDI file that has a sequence of more than one (bank_select+) program_change interleaved over the very same MIDI channel, only the first occurrence takes precedence and thus assigned to the newer MIDI track. All subsequent events will be skipped or simply ignored by the import operation. This is so to obey to the above conventional model: one track, one channel, one instrument patch (bank+program).

note that when exporting to a MIDI file, the same rule always applies, notably that bank_select + program_change events will appear always at the absolute beginning of the exported sequence and nowhere else, just for MIDI instrument setup purposes (a MIDI convention of yore GM/GS/XG standards and best practices).

hth.
cheers

rncbc's picture

it depends with what you mean with "easy way" :)
if you mean like talking or discussion then this forum is the place; if meaning documentation that consider contributing to user manual & how-to's wiki; if you're more into contributing to code then I guess using github platform is an option.
byee

Add new comment