Author Topic: BASS_MIDI_StreamSetFonts and OSX 64 bit Catalina  (Read 879 times)

Salvo

  • Posts: 111
I state that this code on OSX32 works great,
on the latest 64-bit Apple OSX Catalina and compiling with Delphi 10.3 it doesn't work.

var fSoundfont: array [0 .. 1] of BASS_MIDI_FONTEX;

          fontSf2 := BASS_MIDI_FontInit(PChar('sound.sf2'), BASS_UNICODE or BASS_MIDI_FONT_MMAP);
          BASS_MIDI_FontLoad(fontSf2, -1, -1);
         
          fontSF2nofx := BASS_MIDI_FontInit(PChar('sound.sf2'), BASS_MIDI_FONT_NOFX or BASS_UNICODE or BASS_MIDI_FONT_MMAP); //
          BASS_MIDI_FontLoad(fontSF2nofx, -1, -1);

          fSoundfont[0].font := fontSf2;
          fSoundfont[0].spreset := -1; // all soundfont presets
          fSoundfont[0].sbank := -1; // soundfont bank 128 (drums)
          fSoundfont[0].dpreset := -1; // all destination presets
          fSoundfont[0].dbank := 0; // destination bank 128 (drums)
          fSoundfont[0].dbanklsb := 0; // destination bank LSB 0

          fSoundfont[1].font := fontSF2nofx;
          fSoundfont[1].spreset := -1; // all soundfont presets
          fSoundfont[1].sbank := 128; // soundfont bank 128 (drums)
          fSoundfont[1].dpreset := -1; // all destination presets
          fSoundfont[1].dbank := 128; // destination bank 128 (drums)
          fSoundfont[1].dbanklsb := 0; // destination bank LSB 0

          BASS_MIDI_StreamSetFonts(0, PBASS_MIDI_FONTEX(@fSoundfont), 2 or BASS_MIDI_FONT_EX);
         
return -> FALSE
Why ??


Salvo

  • Posts: 111
Re: BASS_MIDI_StreamSetFonts and OSX 64 bit Catalina
« Reply #1 on: 9 Dec '19 - 22:30 »

after-> BASS_MIDI_StreamSetFonts(0, PBASS_MIDI_FONTEX(@fSoundfont), 2 or BASS_MIDI_FONT_EX);

BASS_ErrorGetCode -> 20


Ian @ un4seen

  • Administrator
  • Posts: 22959
Re: BASS_MIDI_StreamSetFonts and OSX 64 bit Catalina
« Reply #3 on: 10 Dec '19 - 13:03 »
It looks like the issue is that the Delphi "LongInt" type is 64-bit rather than 32-bit on 64-bit OSX. Please try replacing all instances of that in the BASSMIDI.PAS file with "Integer".

Salvo

  • Posts: 111
Re: BASS_MIDI_StreamSetFonts and OSX 64 bit Catalina
« Reply #4 on: 10 Dec '19 - 16:27 »
Thank you so much.
You are great.
Everything works.
 :) :) :) :) :) :)