Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
MIDI in WINE pt. 2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
ComPro
n00b
n00b


Joined: 03 Jul 2005
Posts: 14
Location: Binary Land

PostPosted: Sun Jul 10, 2005 4:51 am    Post subject: MIDI in WINE pt. 2 Reply with quote

I've been having issues with playing MIDIs in WINE. if the MIDI contains a pitch bend, it is played 100 times higher (or lower) than it should. for example, the program I use to create MIDIs allows you to bend the note by two by entering a value of 200. in order to make it sound right in WINE, the value must be 2, but once the MIDI is exported and played outside of WINE, it once again sounds incorrect because of the incorrect data that was entered to compensate.

I have determined that it is not a Timidity problem since Timidity plays MIDIs perfectly outside of WINE. It is also not a kernel issue, as I have tried a number of different kernels, all with the same result.

The last time this sounded right was when I was running Ubuntu.

Does anyone have any ideas as to how I could go about fixing this?
Back to top
View user's profile Send private message
Ian Goldby
Guru
Guru


Joined: 18 May 2002
Posts: 539
Location: (Inactive member)

PostPosted: Sun Jul 10, 2005 4:06 pm    Post subject: Reply with quote

I would say that it is almost certainly a problem that the MIDI synth (you implied you are using Timidity) is not getting the proper pitch-bend range set up from the MIDI player.

http://www.practicalpc.co.uk/computing/sound/miditop5.htm wrote:
5. Weird pitch bend
You load a MIDI file that uses pitch bend and the pitch bend sounds either totally OTT or is non-existent. This can happen when the pitch bend range of the recording instrument is different to that of the receiving instrument. Most instruments have a facility for setting their pitch bend range. A common setting is one octave but some may default to two semitones.
If you dig around inside your synth's settings you should find a parameter which lets you set the pitch bend range. You can probably also set this via MIDI messages.
If you have a GM instrument, the following list of data can be entered in the editor to set the pitch bend range:
Controller 101 0 RPN MSB
Controller 100 0 RPN LSB
Controller 6 12 Set pitch bend to 12 semitones
Controller 101 127 RPN MSB
Controller 100 127 RPN LSB
You can vary the middle value to change the pitch bend range.

I don't know whether the exported MIDI file contains the commands to set the pitch bend range, or whether the player is doing this. Since you are presumably using two different MIDI players, then my guess is that it is this that is the problem. One of them is setting the pitch bend range to something wierd and the other is not.

Have a look in the preferences to see if either has a setting for pitch bend range. Alternatively, put a command at the start of the MIDI file to explicitly set the range.

---

P.S. Are you by any chance using wine-20050628 and ALSA? If you are, you may be able to help me with a problem I have. Do you know anything about the MIDI Mapper - e.g. where can I find it?
Back to top
View user's profile Send private message
ComPro
n00b
n00b


Joined: 03 Jul 2005
Posts: 14
Location: Binary Land

PostPosted: Sun Jul 10, 2005 4:20 pm    Post subject: Reply with quote

It looks like this information is for a hardware synthesizer, which does me no good, unfortunately. Thanks, though.

As for your problem, open up regedit and head over to "HKCU\Software\Wine". Create a new key called "ALSA". Within that, create a string value called "MidiPort" and give it the value of "128:0". Create another string value named "PlaybackDevice" and give it the value of "default".

Then head to "HKCU\Software\Wine\Drivers" and for the "audio" entry, change it to say "alsa".

After that, close out of the registry editor and start timidity in ALSA sequencer mode. I use the following command line options:

timidity -iAv -B2,8 -Os

Fire up your program, and you should see "Wine Midi Mapper", followed by four Timidity entries. Go through them until you find one that will play. It's generally the first one.

This could be a good test for my problem as well. If you can, please play something with pitch bends and let me know if it's messed up. Thanks a lot!

-ComPro
Back to top
View user's profile Send private message
Ian Goldby
Guru
Guru


Joined: 18 May 2002
Posts: 539
Location: (Inactive member)

PostPosted: Sun Jul 10, 2005 4:37 pm    Post subject: Reply with quote

You are a star. I'll try this shortly.

As for your pitch-bend problem, I've no experience with Timidity, but I guess that it is a GM-compatible MIDI synth. If so, then the commands to set the pitch-bend range are just as described in the quote I gave above and it doesn't matter if the synth is a software or hardware one. Essentially, you need to send Timidity a RPN code (Registered Parameter Number) for 'pitch bend sensitivity'. More simply, you could make sure Timidity is reset before you start playing and that (one of) the MIDI player(s) is not mucking about with the default pitch-bend range.
Back to top
View user's profile Send private message
ComPro
n00b
n00b


Joined: 03 Jul 2005
Posts: 14
Location: Binary Land

PostPosted: Sun Jul 10, 2005 7:12 pm    Post subject: Reply with quote

I can not find any options for Timidity to change that, as specified in the quote.
Back to top
View user's profile Send private message
Ian Goldby
Guru
Guru


Joined: 18 May 2002
Posts: 539
Location: (Inactive member)

PostPosted: Mon Jul 11, 2005 7:26 pm    Post subject: Reply with quote

Thanks - that worked. I had to create HKCU\Software\Wine\Drivers (it didn't already exist) and add the audio=alsa value. I've got some problems with timing (which may actually make it unusable) but at least everything is wired together properly now. As far as I can tell, pitch bends are working correctly.

Right, back to your problem. I wouldn't necessarily expect to find any options in Timidity to set the pitch-bend range, but I would expect it to respond to the GM messages that set this up remotely. So what I am trying to suggest is that you go into your sequencer and find the commands to send an RPN message for pitch bend sensitivity. How you will do this will depend entirely on what sequencer you are using.

Actually, I'm a bit confused when you say that a value of 200 in your sequencer creates a pitch bend of 2 semitones (so it sounds like the bend value is in cents). MIDI values are limited to the range 0-127. So your sequencer must be doing something behind the scenes to remap this range.

Can we just get the symptoms clear?
1. Using the sequencer in Windows, a pitch-bend of 200 results in a heard pitch bend of 2 semitones.
2. Using the same sequencer, but running under wine, a pitch-bend of 200 results in a heard pitch bend of 200 semitones - i.e. so high or low you can't even hear it anymore! (200 semitones is >16 octaves, which would take any audible sound pretty much beyond the range of human hearing, and certainly beyond the range of MIDI notes.)
3. Using the same sequencer, running under wine, a pitch-bend of 2 results in a heard pitch bend of 2 semitones.
4. If you export the MIDI file from this sequencer and play the result through a Linux MIDI player, a pitch-bend of 200 sounds like 2 semitones. It doesn't matter whether the MIDI is exported from the player running under Windows, or under wine.

Is this correct? Is it still correct if you restart Timidity between each experiment?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
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