diff options
| author | Max Horn | 2002-10-12 00:26:24 +0000 |
|---|---|---|
| committer | Max Horn | 2002-10-12 00:26:24 +0000 |
| commit | cdb7b137896e72d1aa28eca14e88b03b3cfc68af (patch) | |
| tree | 7bb4a3491b08c6eca17f0e1f228021a73a6688f0 /sound | |
| parent | 8ea56e58a86ca14fa4420ba573ac9d9c0a5602a9 (diff) | |
| download | scummvm-rg350-cdb7b137896e72d1aa28eca14e88b03b3cfc68af.tar.gz scummvm-rg350-cdb7b137896e72d1aa28eca14e88b03b3cfc68af.tar.bz2 scummvm-rg350-cdb7b137896e72d1aa28eca14e88b03b3cfc68af.zip | |
revised options dialog
svn-id: r5130
Diffstat (limited to 'sound')
| -rw-r--r-- | sound/mididrv.cpp | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/sound/mididrv.cpp b/sound/mididrv.cpp index bf5395c2e4..1c6a5b333b 100644 --- a/sound/mididrv.cpp +++ b/sound/mididrv.cpp @@ -815,11 +815,15 @@ void MidiDriver_QT::send(uint32 b) break; case 0xE0:{ // Pitch bend - long theBend = (long)midiCmd[1] | (long)(midiCmd[2] << 8); // QuickTime specifies pitchbend in semitones, using 8.8 fixed point values; - // but iMuse sends us the pitch bend data relative to +/- 12 semitones. Thus - // we have to convert it to the QT format. - theBend = (theBend - 0x4000) * 6 / 128; + // but iMuse sends us the pitch bend data as 0-32768. which has to be mapped + // to +/- 12 semitones. Based on this, we first center the input data, then + // multiply it by a factor. If all was right, the factor would be 3/8, but for + // mysterious reasons the actual factor we have to use is more like 1/32 or 3/64. + // Maybe the QT docs are right, and + long theBend = (long)midiCmd[1] | (long)(midiCmd[2] << 7); + theBend = (theBend - 0x2000) * 2 / 64; + NASetController(qtNoteAllocator, qtNoteChannel[chanID], kControllerPitchBend, theBend); } break; @@ -880,6 +884,9 @@ int MidiDriver_CORE::open(int mode) if (au_output != NULL) return MERR_ALREADY_OPEN; + if (mode == MO_STREAMING) + return MERR_STREAMING_NOT_AVAILABLE; + _mode = mode; int err; @@ -914,6 +921,21 @@ int MidiDriver_CORE::open(int mode) // start the output AudioOutputUnitStart(au_output); +#if 1 + // Send initial pitch bend sensitivity values for +/- 12 semitones. + // For information on control change registered parameters, + // which includes the Pitch Bend sensitivity settings, + // visit http://www.midi.org/about-midi/table3.htm, + // Table 3a. + int chan; + for (chan = 0; chan < 16; ++chan) { + MusicDeviceMIDIEvent(au_MusicDevice, (0xB0 | chan), 101, 0, 0); + MusicDeviceMIDIEvent(au_MusicDevice, (0xB0 | chan), 100, 0, 0); + MusicDeviceMIDIEvent(au_MusicDevice, (0xB0 | chan), 6, 12, 0); + MusicDeviceMIDIEvent(au_MusicDevice, (0xB0 | chan), 38, 0, 0); + } // next for +#endif + return 0; } |
