Recent

Author Topic: Extended Module Player  (Read 2516 times)

TRon

  • Hero Member
  • *****
  • Posts: 3271
Re: Extended Module Player
« Reply #30 on: September 17, 2024, 05:51:11 pm »
https://modarchive.org/
+1

aminet's mods section

You could also look at the demoscene archives that lists all scene parties and results. Usually they also contain tracked music f.i. at demozoo.org.
« Last Edit: September 17, 2024, 06:05:39 pm by TRon »
This tagline is powered by AI

TRon

  • Hero Member
  • *****
  • Posts: 3271
Re: Extended Module Player
« Reply #31 on: September 17, 2024, 05:54:51 pm »
Huh, with one must I absolutely try?
All of them  :D

But there are several popularity lists on modarchive, just check one out. I like the featured list, these are specifically mentioned because the author did something special, new or out of the ordinary.

One of mods on my favourites lists is f.e. guitar slinger.
« Last Edit: September 17, 2024, 05:56:30 pm by TRon »
This tagline is powered by AI

Fred vS

  • Hero Member
  • *****
  • Posts: 3361
    • StrumPract is the musicians best friend
Re: Extended Module Player
« Reply #32 on: September 17, 2024, 06:15:17 pm »
Huh, with one must I absolutely try?
All of them  :D

OK, so nice plan for this winter.  ;)

About the XMP libraries, I was able to compile the source for Linux amd64, i386, arm32 and aarch64, all work perfectly (with uos).
For FreeBSD amd64 too.
But for Windows, I have the 64 bit version showed by Gigatron that is ok but the 32 version that I found needs the dependency libgcc_s_dw2-1.dll that must be copied in windows\system folder (here in Linux-wine).
Is there a other binary of libxpm.dll 32 bit available that does not need libgcc.dll dependency?
Also that library is big vs version 64 bit (590 kb vs 115 kb)
I would like to compile xpm source for Windows 32 bit but sadly I dont have a Windows machine.
[EDIT] The same for MacOS, a binary of libxmp.dynlib would be very welcome (I dont have a Mac machine to compile it).

In attachment, libxpm.dll 32 bit and his libgcc.dll dependency.

Thanks.

Fre;D
« Last Edit: September 17, 2024, 06:29:21 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

TRon

  • Hero Member
  • *****
  • Posts: 3271
Re: Extended Module Player
« Reply #33 on: September 17, 2024, 06:32:25 pm »
OK, so nice plan for this winter.  ;)
What I usually do is listen to one of the demo-scene and/or game music streaming channels and listen to that. That way I am able to keep informed about new tracks. The popular ones get's played often, the not so popular ones not that much (or not at all).

The nice thing about it is you can do that anywhere, anytime if you got time to kill (during coding or commuting for example) and with a good player, mark the tracks you really would want to grab for keeps.

Quote
Is there a other binary of libxpm.dll 32 bit available that does not need libgcc.dll dependency?
I honestly have no idea. It took me some time to figure out how to compile the sources from github but have not figured out yet of to include (external) dependencies.


Quote
I would like to compile xpm source for Windows 32 bit but sadly I dont have a Windows machine.
Same here.
This tagline is powered by AI

Lulu

  • Sr. Member
  • ****
  • Posts: 259
Re: Extended Module Player
« Reply #34 on: September 21, 2024, 08:58:06 am »
Quote
I would like to compile xpm source for Windows 32 bit but sadly I dont have a Windows machine.
Same here.
Hi all, I have a windows 7 32b machine, but compiling C code is an obscure process for me...
With some guidances, may be I can help you ?
Using CMake-GUI + MingWI was able to compile the dll, but with more dependancies:
Code: Pascal  [Select][+][-]
  1.         ntdll.dll => /c/windows/SYSTEM32/ntdll.dll (0x770a0000)
  2.         kernel32.dll => /c/windows/system32/kernel32.dll (0x75d10000)
  3.         KERNELBASE.dll => /c/windows/system32/KERNELBASE.dll (0x75130000)
  4.         msvcrt.dll => /c/windows/system32/msvcrt.dll (0x75b70000)
  5.         libgcc_s_dw2-1.dll => /mingw32/bin/libgcc_s_dw2-1.dll (0x72280000)
  6.         libwinpthread-1.dll => /mingw32/bin/libwinpthread-1.dll (0x723f0000)
  7.         libmcfgthread-1.dll => /d/CMake/MINGW-w64-gcc-mfc/mingw32/bin/libmcfgthread-1.dll (0x723e0000)
  8.         CRYPTBASE.DLL => /c/windows/system32/CRYPTBASE.DLL (0x74ed0000)
  9.  
I have no idea how to remove them.
wishing you a nice life!
GitHub repositories https://github.com/Lulu04

Fred vS

  • Hero Member
  • *****
  • Posts: 3361
    • StrumPract is the musicians best friend
Re: Extended Module Player
« Reply #35 on: September 21, 2024, 11:04:04 pm »
Quote
I would like to compile xpm source for Windows 32 bit but sadly I dont have a Windows machine.
Same here.
Hi all, I have a windows 7 32b machine, but compiling C code is an obscure process for me...
With some guidances, may be I can help you ?
Using CMake-GUI + MingWI was able to compile the dll, but with more dependancies:
Code: Pascal  [Select][+][-]
  1.         ntdll.dll => /c/windows/SYSTEM32/ntdll.dll (0x770a0000)
  2.         kernel32.dll => /c/windows/system32/kernel32.dll (0x75d10000)
  3.         KERNELBASE.dll => /c/windows/system32/KERNELBASE.dll (0x75130000)
  4.         msvcrt.dll => /c/windows/system32/msvcrt.dll (0x75b70000)
  5.         libgcc_s_dw2-1.dll => /mingw32/bin/libgcc_s_dw2-1.dll (0x72280000)
  6.         libwinpthread-1.dll => /mingw32/bin/libwinpthread-1.dll (0x723f0000)
  7.         libmcfgthread-1.dll => /d/CMake/MINGW-w64-gcc-mfc/mingw32/bin/libmcfgthread-1.dll (0x723e0000)
  8.         CRYPTBASE.DLL => /c/windows/system32/CRYPTBASE.DLL (0x74ed0000)
  9.  
I have no idea how to remove them.

Is it not possible to compile libxmp with MS Visual Studio?
Maybe it will need only MS dependencies?

[EDIT] In the README file, there is :
Quote
To build for Windows using Visual Studio, use Makefile.vc:
  nmake -f Makefile.vc   (read/edit Makefile.vc as necessary.)
« Last Edit: September 22, 2024, 03:12:28 am by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Lulu

  • Sr. Member
  • ****
  • Posts: 259
Re: Extended Module Player
« Reply #36 on: September 22, 2024, 04:23:54 pm »
Hi Fred,
I don't have VS installed, so I tryed to install it but without success: during the installation, when the main form appears, the program crash without any message. Searching in Program Files folder, there is only a "Microsoft Visual Studio\Installer" folder, no VS.exe or similar.
wishing you a nice life!
GitHub repositories https://github.com/Lulu04

Fred vS

  • Hero Member
  • *****
  • Posts: 3361
    • StrumPract is the musicians best friend
Re: Extended Module Player
« Reply #37 on: September 22, 2024, 07:54:56 pm »
Hello Lulu.

Sadly I dont have a Windows machine and last time I installed Visual Studio was a looong time ago, when no web connection was needed.
Maybe there are here Windows users with Visual Studio installed that may help.

Fre;D
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Lulu

  • Sr. Member
  • ****
  • Posts: 259
Re: Extended Module Player
« Reply #38 on: September 22, 2024, 08:42:05 pm »
I'm sorry I can't do better...

Best regards
wishing you a nice life!
GitHub repositories https://github.com/Lulu04

Fred vS

  • Hero Member
  • *****
  • Posts: 3361
    • StrumPract is the musicians best friend
Re: Extended Module Player
« Reply #39 on: September 22, 2024, 11:34:25 pm »
Hello.

If your Windows 32 bit system does not have libgcc_s_dw2-1.dll installed and you dont want to install it on your system, you may load it with dynlibs.loadlibrary(' libgcc_s_dw2-1.dll') before to load the xmp.lib.
Note that you must use the same name as the original library libgcc, renamed library will not work.

So, for Windows 32 bit, copy the libraries given in attachment here in the root directory of the project.
 https://forum.lazarus.freepascal.org/index.php/topic,68475.msg530191.html#msg530191

Then:
Code: Pascal  [Select][+][-]
  1. uses
  2. dynlibs, ...
  3.  
  4. var
  5. gcc_Handle: TLibHandle = dynlibs.NilHandle;
  6. ...
  7.  
  8.  procedure TxmpConsole.ConsolePlay;
  9. begin
  10.   ordir := IncludeTrailingBackslash(ExtractFilePath(ParamStr(0)));
  11.   gcc_Handle := loadlibrary(ordir + 'libgcc_s_dw2-1.dll'); // load libgcc before xmp
  12.     if xmp_Load(ordir + thelib) then
  13.     begin
  14.    ...
  15.    end;
  16. ...
  17. unloadlibrary(gcc_Handle); // unload libgcc at end.
« Last Edit: September 23, 2024, 01:47:05 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Guva

  • Jr. Member
  • **
  • Posts: 97
Re: Extended Module Player
« Reply #40 on: September 26, 2024, 07:27:16 am »
raylib version player.

Code: Pascal  [Select][+][-]
  1. program project1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. uses
  6.   {$IFDEF UNIX}
  7.   cthreads,
  8.   {$ENDIF}
  9.   Classes, SysUtils, CustApp, raylib, uos_libxmp;
  10.  
  11. type
  12.   { TRayApplication }
  13.   TRayApplication = class(TCustomApplication)
  14.   protected
  15.     procedure DoRun; override;
  16.   public
  17.     constructor Create(TheOwner: TComponent); override;
  18.     destructor Destroy; override;
  19.   end;
  20.  
  21.   const
  22.     AppTitle = 'raylib - basic window';
  23.     SampleRate = 44100;
  24.     BufferSize = 8192 ; // buffer size=8192 is now Ok  !!!
  25.  
  26. var
  27.   playing: boolean;
  28.   ctx: xmp_context;
  29.   stream: TAudioStream;
  30.   mi: xmp_module_info;
  31.   fi: xmp_frame_info;
  32.   ti : xmp_test_info;
  33.   ci : xmp_channel_info;
  34.   moduleName: string;
  35.   format : string;
  36.  
  37. procedure FillAudio(bufferData: Pointer; frames: LongWord); cdecl;
  38. begin
  39.   if xmp_play_buffer(ctx, bufferData, frames * 4, 0) < 0 then
  40.     playing := False;
  41. end;
  42.  
  43. constructor TRayApplication.Create(TheOwner: TComponent);
  44. var
  45.   ordir, thelib: string;
  46. begin
  47.   inherited Create(TheOwner);
  48.   InitWindow(800, 600, AppTitle); // for window settings, look at example - window flags
  49.  
  50.   ordir := IncludeTrailingBackslash(ExtractFilePath(ParamStr(0)));
  51.   {$IFDEF windows}
  52.   thelib := 'libxmp.dll';
  53.   {$Else}
  54.   thelib := 'libxmp-64.so';
  55.   {$ENDIF}
  56.   writeln(GetApplicationDirectory + thelib);
  57.  
  58.   if xmp_Load(GetApplicationDirectory + thelib) then
  59.   begin
  60.     ctx := xmp_create_context();
  61.     ordir := GetApplicationDirectory + 'oxygene_part_iv.s3m';
  62.  
  63.     if xmp_load_module(ctx, PChar(ordir)) <> 0 then
  64.     begin
  65.       writeln('Load module error.');
  66.       Exit;
  67.     end;
  68.     xmp_start_player(ctx, SampleRate, 0);
  69.     playing := True;
  70.   end;
  71.  
  72.   InitAudioDevice;
  73.  
  74.   SetAudioStreamBufferSizeDefault(BufferSize);
  75.  
  76.   stream := LoadAudioStream(SampleRate, 16, 2);
  77.  
  78.   SetAudioStreamCallback(Stream,@FillAudio);
  79.  
  80.   PlayAudioStream(stream);        // Start processing stream buffer (no data loaded currently)
  81. end;
  82.  
  83. procedure TRayApplication.DoRun;
  84. begin
  85.  
  86.   while (not WindowShouldClose) do // Detect window close button or ESC key
  87.   begin
  88.     // Update your variables here
  89.     if playing then
  90.     begin
  91.       xmp_get_module_info(ctx, mi);
  92.       xmp_get_frame_info(ctx,fi);
  93.       moduleName := string(mi.module^.name);
  94.       format := string(mi.module^.typ);
  95.     end else
  96.     StopAudioStream(stream);
  97.  
  98.    // Draw
  99.     BeginDrawing();
  100.       ClearBackground(RAYWHITE);
  101.       DrawText(Pchar('bmp: ' + IntToStr(fi.bpm)), 190, 200, 20, DARKGRAY);
  102.       DrawText(Pchar('speed: ' + IntToStr(fi.speed)), 190, 220, 20, DARKGRAY);
  103.       DrawText(Pchar('position: ' + IntToStr(fi.pos)), 190, 240, 20, DARKGRAY);
  104.       DrawText(Pchar('pattern: ' + IntToStr(fi.pattern)), 190, 260, 20, DARKGRAY);
  105.       DrawText(Pchar('row: ' + IntToStr(fi.row)), 190, 280, 20, DARKGRAY);
  106.       DrawText(Pchar('module channels: ' + IntToStr(mi.module^.chn)), 190, 300, 20, DARKGRAY);
  107.       DrawText(Pchar('used channels: ' + IntToStr(fi.virt_used)), 190, 320, 20, DARKGRAY);
  108.       DrawText(Pchar('Title : ' +  moduleName), 190, 340, 20, DARKGRAY);
  109.       DrawText(Pchar('type : ' + format), 190, 360, 20, DARKGRAY);
  110.     EndDrawing();
  111.   end;
  112.  
  113.   // Stop program loop
  114.   Terminate;
  115. end;
  116.  
  117. destructor TRayApplication.Destroy;
  118. begin
  119.   // De-Initialization
  120.   UnloadAudioStream(stream);   // Close raw audio stream and delete buffers from RAM
  121.   CloseAudioDevice();         // Close audio device (music streaming is automatically stopped)
  122.   xmp_end_player(ctx);
  123.   xmp_release_module(ctx);
  124.   xmp_free_context(ctx);
  125.   CloseWindow(); // Close window and OpenGL context
  126.   inherited Destroy;
  127. end;
  128.  
  129. var
  130.   Application: TRayApplication;
  131. begin
  132.   Application:=TRayApplication.Create(nil);
  133.   Application.Title:=AppTitle;
  134.   Application.Run;
  135.   Application.Free;
  136. end.
  137.  
  138.  

Fred vS

  • Hero Member
  • *****
  • Posts: 3361
    • StrumPract is the musicians best friend
Re: Extended Module Player
« Reply #41 on: September 26, 2024, 11:56:37 am »
raylib version player.

Code: Pascal  [Select][+][-]
  1. program project1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. uses
  6.   {$IFDEF UNIX}
  7.   cthreads,
  8.   {$ENDIF}
  9.   Classes, SysUtils, CustApp, raylib, uos_libxmp;
  10.  
  11. type
  12.   { TRayApplication }
  13.   TRayApplication = class(TCustomApplication)
  14.   protected
  15.     procedure DoRun; override;
  16.   public
  17.     constructor Create(TheOwner: TComponent); override;
  18.     destructor Destroy; override;
  19.   end;
  20.  
  21.   const
  22.     AppTitle = 'raylib - basic window';
  23.     SampleRate = 44100;
  24.     BufferSize = 8192 ; // buffer size=8192 is now Ok  !!!
  25.  
  26. var
  27.   playing: boolean;
  28.   ctx: xmp_context;
  29.   stream: TAudioStream;
  30.   mi: xmp_module_info;
  31.   fi: xmp_frame_info;
  32.   ti : xmp_test_info;
  33.   ci : xmp_channel_info;
  34.   moduleName: string;
  35.   format : string;
  36.  
  37. procedure FillAudio(bufferData: Pointer; frames: LongWord); cdecl;
  38. begin
  39.   if xmp_play_buffer(ctx, bufferData, frames * 4, 0) < 0 then
  40.     playing := False;
  41. end;
  42.  
  43. constructor TRayApplication.Create(TheOwner: TComponent);
  44. var
  45.   ordir, thelib: string;
  46. begin
  47.   inherited Create(TheOwner);
  48.   InitWindow(800, 600, AppTitle); // for window settings, look at example - window flags
  49.  
  50.   ordir := IncludeTrailingBackslash(ExtractFilePath(ParamStr(0)));
  51.   {$IFDEF windows}
  52.   thelib := 'libxmp.dll';
  53.   {$Else}
  54.   thelib := 'libxmp-64.so';
  55.   {$ENDIF}
  56.   writeln(GetApplicationDirectory + thelib);
  57.  
  58.   if xmp_Load(GetApplicationDirectory + thelib) then
  59.   begin
  60.     ctx := xmp_create_context();
  61.     ordir := GetApplicationDirectory + 'oxygene_part_iv.s3m';
  62.  
  63.     if xmp_load_module(ctx, PChar(ordir)) <> 0 then
  64.     begin
  65.       writeln('Load module error.');
  66.       Exit;
  67.     end;
  68.     xmp_start_player(ctx, SampleRate, 0);
  69.     playing := True;
  70.   end;
  71.  
  72.   InitAudioDevice;
  73.  
  74.   SetAudioStreamBufferSizeDefault(BufferSize);
  75.  
  76.   stream := LoadAudioStream(SampleRate, 16, 2);
  77.  
  78.   SetAudioStreamCallback(Stream,@FillAudio);
  79.  
  80.   PlayAudioStream(stream);        // Start processing stream buffer (no data loaded currently)
  81. end;
  82.  
  83. procedure TRayApplication.DoRun;
  84. begin
  85.  
  86.   while (not WindowShouldClose) do // Detect window close button or ESC key
  87.   begin
  88.     // Update your variables here
  89.     if playing then
  90.     begin
  91.       xmp_get_module_info(ctx, mi);
  92.       xmp_get_frame_info(ctx,fi);
  93.       moduleName := string(mi.module^.name);
  94.       format := string(mi.module^.typ);
  95.     end else
  96.     StopAudioStream(stream);
  97.  
  98.    // Draw
  99.     BeginDrawing();
  100.       ClearBackground(RAYWHITE);
  101.       DrawText(Pchar('bmp: ' + IntToStr(fi.bpm)), 190, 200, 20, DARKGRAY);
  102.       DrawText(Pchar('speed: ' + IntToStr(fi.speed)), 190, 220, 20, DARKGRAY);
  103.       DrawText(Pchar('position: ' + IntToStr(fi.pos)), 190, 240, 20, DARKGRAY);
  104.       DrawText(Pchar('pattern: ' + IntToStr(fi.pattern)), 190, 260, 20, DARKGRAY);
  105.       DrawText(Pchar('row: ' + IntToStr(fi.row)), 190, 280, 20, DARKGRAY);
  106.       DrawText(Pchar('module channels: ' + IntToStr(mi.module^.chn)), 190, 300, 20, DARKGRAY);
  107.       DrawText(Pchar('used channels: ' + IntToStr(fi.virt_used)), 190, 320, 20, DARKGRAY);
  108.       DrawText(Pchar('Title : ' +  moduleName), 190, 340, 20, DARKGRAY);
  109.       DrawText(Pchar('type : ' + format), 190, 360, 20, DARKGRAY);
  110.     EndDrawing();
  111.   end;
  112.  
  113.   // Stop program loop
  114.   Terminate;
  115. end;
  116.  
  117. destructor TRayApplication.Destroy;
  118. begin
  119.   // De-Initialization
  120.   UnloadAudioStream(stream);   // Close raw audio stream and delete buffers from RAM
  121.   CloseAudioDevice();         // Close audio device (music streaming is automatically stopped)
  122.   xmp_end_player(ctx);
  123.   xmp_release_module(ctx);
  124.   xmp_free_context(ctx);
  125.   CloseWindow(); // Close window and OpenGL context
  126.   inherited Destroy;
  127. end;
  128.  
  129. var
  130.   Application: TRayApplication;
  131. begin
  132.   Application:=TRayApplication.Create(nil);
  133.   Application.Title:=AppTitle;
  134.   Application.Run;
  135.   Application.Free;
  136. end.
  137.  
  138.  

Hello Guva.

Nice demo!
Dont forget to add xmp_UnLoad() in TRayApplication.Destroy() otherwise you will get a memory leak.
Note too that uos_libxmp.pas was updated: https://github.com/fredvs/uos/blob/main/src/uos_libxmp.pas

Fre;D
 
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Guva

  • Jr. Member
  • **
  • Posts: 97
Re: Extended Module Player
« Reply #42 on: September 26, 2024, 12:18:16 pm »
Dont forget to add xmp_UnLoad() in TRayApplication.Destroy() otherwise you will get a memory leak.
Oh thank you

Guva

  • Jr. Member
  • **
  • Posts: 97
Re: Extended Module Player
« Reply #43 on: September 28, 2024, 04:53:05 am »
« Last Edit: September 28, 2024, 06:57:01 am by Guva »

Gigatron

  • Full Member
  • ***
  • Posts: 144
  • Amiga Rulez !!
Re: Extended Module Player
« Reply #44 on: September 28, 2024, 03:20:43 pm »
Nice job @Guva especially the equalizer part;
Sub Quantum Technology ! Ufo Landing : Ezekiel 1-4;

 

TinyPortal © 2005-2018