Re: [Rosegarden-user] Weird MIDI bug

2023-09-24 Thread Will Godfrey
On Sat, 23 Sep 2023 10:13:14 +0200
Lorenzo Sutton  wrote:

>On 23/09/2023 10:06, Will Godfrey wrote:
>> On Sat, 23 Sep 2023 09:40:39 +0200
>> Lorenzo Sutton  wrote:
>>   
>>> Sorry for the x-posting to rosegarden-devel
>>>
>>> On 23/09/2023 09:08, Lorenzo Sutton wrote:  
 On 23/09/2023 08:50, Lorenzo Sutton wrote:  
> I Will,
>
> On 22/09/2023 21:35, Will Godfrey wrote:  
>> First off I don't know if this is down to Rosegarden or aplaymidi
>>
>> If I set program change to patch number 122 in a Rosegarden track
>> Yoshimi responds to by loading the appropriate patch.
>> If I then export that track as a MIDI file and run that via aplaymidi
>> connected
>> to Yoshimi, it's ignored. Any other patch value works correctly.  
>>>
>>> ...
>>>  
 Now if a 122 (121 counting from 0) program change is present rosegarden
 outputs:

 [MidiFile] writeTrack(): Found controller 121.  Skipping.  This is a
 HACK to address BUG #1404.

 This doesn't happen with other program changes... So, this is definitely
 a bug of rosegarden confusing a 121 program change for a controller
 change. I'm not sure if someone familiar with this code can look into 
 this.  
>>>
>>> I think I found the issue. In the file:
>>>
>>> ./src/sound/MidiFile.cpp
>>>
>>> around line 1458 essentially the check is only on the MIDI data
>>> 'catching' anything with a data1 value of 121.
>>>
>>> Changing the condition to this where there is a check that the type of
>>> event is actually a MIDI control change seems to solve the issue:
>>>
>>> if (
>>> midiEvent.getEventCode() == MIDI_CTRL_CHANGE &&
>>> midiEvent.getData1() == MIDI_CONTROLLER_RESET
>>> ) ...
>>>
>>> At the moment I don't have time to open a bug report and submit the
>>> change in a fork (this is really painful with sourceforge)... I can do
>>> it in the next days.
>>>
>>> Hope this helps.
>>> Lorenzo  
>> 
>> Good sleuthing!
>> 
>> I haven't got time to do anything to help myself. I'm trying to get Yoshimi
>> V2.3.1 out before Sonoj, and it's being 'difficult' - especially the
>> documentation :(
>>   
>
>OK I think it's fixed with the merge request linked here:
>
>https://sourceforge.net/p/rosegarden/bugs/1663/

Tested and works fine here. Thanks for such a quick response :)

-- 
Will J Godfrey {apparently now an 'elderly'}
https://willgodfrey.bandcamp.com/
http://yoshimi.github.io
Say you have a poem and I have a tune.
Exchange them and we can both have a poem, a tune, and a song.


___
Rosegarden-user mailing list
Rosegarden-user@lists.sourceforge.net - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user


Re: [Rosegarden-user] Weird MIDI bug

2023-09-23 Thread ram
You guys are amazing!  Thanks!


> On 23/09/2023 10:06, Will Godfrey wrote:
>> On Sat, 23 Sep 2023 09:40:39 +0200
>> Lorenzo Sutton  wrote:
>>
>>> Sorry for the x-posting to rosegarden-devel
>>>
>>> On 23/09/2023 09:08, Lorenzo Sutton wrote:
 On 23/09/2023 08:50, Lorenzo Sutton wrote:
> I Will,
>
> On 22/09/2023 21:35, Will Godfrey wrote:
>> First off I don't know if this is down to Rosegarden or aplaymidi
>>
>> If I set program change to patch number 122 in a Rosegarden track
>> Yoshimi responds to by loading the appropriate patch.
>> If I then export that track as a MIDI file and run that via
>> aplaymidi
>> connected
>> to Yoshimi, it's ignored. Any other patch value works correctly.
>>>
>>> ...
>>>
 Now if a 122 (121 counting from 0) program change is present
 rosegarden
 outputs:

 [MidiFile] writeTrack(): Found controller 121.  Skipping.  This is a
 HACK to address BUG #1404.

 This doesn't happen with other program changes... So, this is
 definitely
 a bug of rosegarden confusing a 121 program change for a controller
 change. I'm not sure if someone familiar with this code can look into
 this.
>>>
>>> I think I found the issue. In the file:
>>>
>>> ./src/sound/MidiFile.cpp
>>>
>>> around line 1458 essentially the check is only on the MIDI data
>>> 'catching' anything with a data1 value of 121.
>>>
>>> Changing the condition to this where there is a check that the type of
>>> event is actually a MIDI control change seems to solve the issue:
>>>
>>> if (
>>> midiEvent.getEventCode() == MIDI_CTRL_CHANGE &&
>>> midiEvent.getData1() == MIDI_CONTROLLER_RESET
>>> ) ...
>>>
>>> At the moment I don't have time to open a bug report and submit the
>>> change in a fork (this is really painful with sourceforge)... I can do
>>> it in the next days.
>>>
>>> Hope this helps.
>>> Lorenzo
>>
>> Good sleuthing!
>>
>> I haven't got time to do anything to help myself. I'm trying to get
>> Yoshimi
>> V2.3.1 out before Sonoj, and it's being 'difficult' - especially the
>> documentation :(
>>
>
> OK I think it's fixed with the merge request linked here:
>
> https://sourceforge.net/p/rosegarden/bugs/1663/
>
>
>
> ___
> Rosegarden-user mailing list
> Rosegarden-user@lists.sourceforge.net - use the link below to unsubscribe
> https://lists.sourceforge.net/lists/listinfo/rosegarden-user
>




___
Rosegarden-user mailing list
Rosegarden-user@lists.sourceforge.net - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user


Re: [Rosegarden-user] Weird MIDI bug

2023-09-23 Thread Lorenzo Sutton

On 23/09/2023 10:06, Will Godfrey wrote:

On Sat, 23 Sep 2023 09:40:39 +0200
Lorenzo Sutton  wrote:


Sorry for the x-posting to rosegarden-devel

On 23/09/2023 09:08, Lorenzo Sutton wrote:

On 23/09/2023 08:50, Lorenzo Sutton wrote:

I Will,

On 22/09/2023 21:35, Will Godfrey wrote:

First off I don't know if this is down to Rosegarden or aplaymidi

If I set program change to patch number 122 in a Rosegarden track
Yoshimi responds to by loading the appropriate patch.
If I then export that track as a MIDI file and run that via aplaymidi
connected
to Yoshimi, it's ignored. Any other patch value works correctly.


...


Now if a 122 (121 counting from 0) program change is present rosegarden
outputs:

[MidiFile] writeTrack(): Found controller 121.  Skipping.  This is a
HACK to address BUG #1404.

This doesn't happen with other program changes... So, this is definitely
a bug of rosegarden confusing a 121 program change for a controller
change. I'm not sure if someone familiar with this code can look into this.


I think I found the issue. In the file:

./src/sound/MidiFile.cpp

around line 1458 essentially the check is only on the MIDI data
'catching' anything with a data1 value of 121.

Changing the condition to this where there is a check that the type of
event is actually a MIDI control change seems to solve the issue:

if (
midiEvent.getEventCode() == MIDI_CTRL_CHANGE &&
midiEvent.getData1() == MIDI_CONTROLLER_RESET
) ...

At the moment I don't have time to open a bug report and submit the
change in a fork (this is really painful with sourceforge)... I can do
it in the next days.

Hope this helps.
Lorenzo


Good sleuthing!

I haven't got time to do anything to help myself. I'm trying to get Yoshimi
V2.3.1 out before Sonoj, and it's being 'difficult' - especially the
documentation :(



OK I think it's fixed with the merge request linked here:

https://sourceforge.net/p/rosegarden/bugs/1663/



___
Rosegarden-user mailing list
Rosegarden-user@lists.sourceforge.net - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user


Re: [Rosegarden-user] Weird MIDI bug

2023-09-23 Thread Will Godfrey
On Sat, 23 Sep 2023 09:40:39 +0200
Lorenzo Sutton  wrote:

>Sorry for the x-posting to rosegarden-devel
>
>On 23/09/2023 09:08, Lorenzo Sutton wrote:
>> On 23/09/2023 08:50, Lorenzo Sutton wrote:  
>>> I Will,
>>>
>>> On 22/09/2023 21:35, Will Godfrey wrote:  
 First off I don't know if this is down to Rosegarden or aplaymidi

 If I set program change to patch number 122 in a Rosegarden track
 Yoshimi responds to by loading the appropriate patch.
 If I then export that track as a MIDI file and run that via aplaymidi 
 connected
 to Yoshimi, it's ignored. Any other patch value works correctly.  
>
>...
>
>> Now if a 122 (121 counting from 0) program change is present rosegarden 
>> outputs:
>> 
>> [MidiFile] writeTrack(): Found controller 121.  Skipping.  This is a 
>> HACK to address BUG #1404.
>> 
>> This doesn't happen with other program changes... So, this is definitely 
>> a bug of rosegarden confusing a 121 program change for a controller 
>> change. I'm not sure if someone familiar with this code can look into this.  
>
>I think I found the issue. In the file:
>
>./src/sound/MidiFile.cpp
>
>around line 1458 essentially the check is only on the MIDI data 
>'catching' anything with a data1 value of 121.
>
>Changing the condition to this where there is a check that the type of 
>event is actually a MIDI control change seems to solve the issue:
>
>if (
>   midiEvent.getEventCode() == MIDI_CTRL_CHANGE &&
>   midiEvent.getData1() == MIDI_CONTROLLER_RESET
>) ...
>
>At the moment I don't have time to open a bug report and submit the 
>change in a fork (this is really painful with sourceforge)... I can do 
>it in the next days.
>
>Hope this helps.
>Lorenzo

Good sleuthing!

I haven't got time to do anything to help myself. I'm trying to get Yoshimi
V2.3.1 out before Sonoj, and it's being 'difficult' - especially the
documentation :(

-- 
Will J Godfrey {apparently now an 'elderly'}


___
Rosegarden-user mailing list
Rosegarden-user@lists.sourceforge.net - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user


Re: [Rosegarden-user] Weird MIDI bug

2023-09-23 Thread Lorenzo Sutton

Sorry for the x-posting to rosegarden-devel

On 23/09/2023 09:08, Lorenzo Sutton wrote:

On 23/09/2023 08:50, Lorenzo Sutton wrote:

I Will,

On 22/09/2023 21:35, Will Godfrey wrote:

First off I don't know if this is down to Rosegarden or aplaymidi

If I set program change to patch number 122 in a Rosegarden track
Yoshimi responds to by loading the appropriate patch.
If I then export that track as a MIDI file and run that via aplaymidi 
connected

to Yoshimi, it's ignored. Any other patch value works correctly.


...

Now if a 122 (121 counting from 0) program change is present rosegarden 
outputs:


[MidiFile] writeTrack(): Found controller 121.  Skipping.  This is a 
HACK to address BUG #1404.


This doesn't happen with other program changes... So, this is definitely 
a bug of rosegarden confusing a 121 program change for a controller 
change. I'm not sure if someone familiar with this code can look into this.


I think I found the issue. In the file:

./src/sound/MidiFile.cpp

around line 1458 essentially the check is only on the MIDI data 
'catching' anything with a data1 value of 121.


Changing the condition to this where there is a check that the type of 
event is actually a MIDI control change seems to solve the issue:


if (
midiEvent.getEventCode() == MIDI_CTRL_CHANGE &&
midiEvent.getData1() == MIDI_CONTROLLER_RESET
) ...

At the moment I don't have time to open a bug report and submit the 
change in a fork (this is really painful with sourceforge)... I can do 
it in the next days.


Hope this helps.
Lorenzo


___
Rosegarden-user mailing list
Rosegarden-user@lists.sourceforge.net - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user


Re: [Rosegarden-user] Weird MIDI bug

2023-09-23 Thread Lorenzo Sutton

On 23/09/2023 08:50, Lorenzo Sutton wrote:

I Will,

On 22/09/2023 21:35, Will Godfrey wrote:

First off I don't know if this is down to Rosegarden or aplaymidi

If I set program change to patch number 122 in a Rosegarden track
Yoshimi responds to by loading the appropriate patch.
If I then export that track as a MIDI file and run that via aplaymidi 
connected

to Yoshimi, it's ignored. Any other patch value works correctly.

It make no difference which bank or part number is used, nor if 
anything else

is going on at the same time.

I found this entirely by chance when trying to create some demo files. 
I've got
round it by using patch number 120 which loads a similar sound, but 
can someone

find time to investigate?



At the moment I can only confirm that wierdly exporting a midi file with 
a track which has a program change 122 will generate a file where the 
program change is missing. As a counter-example I tried putting a 
program change 113 and that works, the program change is correctly output.


To check this I also used a handy midicomp program [1] which will dump 
the contents of a midi file as text and confirming the program change 
was missing in the file where it had been set to 122.


Just a few seconds after I hit the send something came to my mind... In 
0-counting MIDI program change 122 is actually 121.


121 is also the infamous 'Reset All Controllers' controller which was 
causing issues.


Now if a 122 (121 counting from 0) program change is present rosegarden 
outputs:


[MidiFile] writeTrack(): Found controller 121.  Skipping.  This is a 
HACK to address BUG #1404.


This doesn't happen with other program changes... So, this is definitely 
a bug of rosegarden confusing a 121 program change for a controller 
change. I'm not sure if someone familiar with this code can look into this.


I think it would be useful to open a bug report on sourceforge so it can 
be looked into :-D


Lorenzo



Lorenzo
[1] https://github.com/markc/midicomp#midicomp




___
Rosegarden-user mailing list
Rosegarden-user@lists.sourceforge.net - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user


Re: [Rosegarden-user] Weird MIDI bug

2023-09-23 Thread Lorenzo Sutton

I Will,

On 22/09/2023 21:35, Will Godfrey wrote:

First off I don't know if this is down to Rosegarden or aplaymidi

If I set program change to patch number 122 in a Rosegarden track
Yoshimi responds to by loading the appropriate patch.
If I then export that track as a MIDI file and run that via aplaymidi connected
to Yoshimi, it's ignored. Any other patch value works correctly.

It make no difference which bank or part number is used, nor if anything else
is going on at the same time.

I found this entirely by chance when trying to create some demo files. I've got
round it by using patch number 120 which loads a similar sound, but can someone
find time to investigate?



At the moment I can only confirm that wierdly exporting a midi file with 
a track which has a program change 122 will generate a file where the 
program change is missing. As a counter-example I tried putting a 
program change 113 and that works, the program change is correctly output.


To check this I also used a handy midicomp program [1] which will dump 
the contents of a midi file as text and confirming the program change 
was missing in the file where it had been set to 122.


Lorenzo
[1] https://github.com/markc/midicomp#midicomp


___
Rosegarden-user mailing list
Rosegarden-user@lists.sourceforge.net - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user


[Rosegarden-user] Weird MIDI bug

2023-09-22 Thread Will Godfrey
First off I don't know if this is down to Rosegarden or aplaymidi

If I set program change to patch number 122 in a Rosegarden track
Yoshimi responds to by loading the appropriate patch.
If I then export that track as a MIDI file and run that via aplaymidi connected
to Yoshimi, it's ignored. Any other patch value works correctly.

It make no difference which bank or part number is used, nor if anything else
is going on at the same time.

I found this entirely by chance when trying to create some demo files. I've got
round it by using patch number 120 which loads a similar sound, but can someone
find time to investigate?

-- 
Will J Godfrey {apparently now an 'elderly'}
https://willgodfrey.bandcamp.com/
http://yoshimi.github.io
Say you have a poem and I have a tune.
Exchange them and we can both have a poem, a tune, and a song.


___
Rosegarden-user mailing list
Rosegarden-user@lists.sourceforge.net - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-user