Recent

Author Topic: UOS: Store a sound in memory and only use uos_Play inside a OnTimer event  (Read 19242 times)

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1228
Re: UOS: Store a sound in memory and only use uos_Play inside a OnTimer event
« Reply #30 on: February 24, 2017, 12:26:53 am »
features for the library ?
read midifiles ?
manage midi events ?
manage soundfonts ?
why not bass + bassmidi library ?
have a look to tonegrid . Lazarus source code,   pasmidi.pp file can be easily enhanced
« Last Edit: February 24, 2017, 12:29:36 am by Jurassic Pork »
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: UOS: Store a sound in memory and only use uos_Play inside a OnTimer event
« Reply #31 on: February 24, 2017, 12:47:48 am »
Quote
read midifiles ?
Yes.

Quote
manage midi events ?
Yes.

Quote
manage soundfonts ?
Yes.

Quote
why not bass + bassmidi library ?
Because bass is not open-source (but I like it and have used it extensively).

Quote
pasmidi.pp file can be easily enhanced
Houla, I did not know this one, many thanks for the tip, I will take a look now.

Thanks JP.

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

fauri

  • New Member
  • *
  • Posts: 15
Re: UOS: Store a sound in memory and only use uos_Play inside a OnTimer event
« Reply #32 on: February 24, 2017, 02:33:10 am »
why not bass + bassmidi library ?

Unfortunately, BASS is free only for personal use. But I don't understand why prefer BASS over FMod (which has a interesting free Indie license for commercial use). Almost nobody talks about FMod here. Is there any Free Pascal headers for this library?

@Fred, looking forward to a midi support for UOS!
« Last Edit: February 24, 2017, 08:37:38 am by fauri »

fauri

  • New Member
  • *
  • Posts: 15
Re: UOS: Store a sound in memory and only use uos_Play inside a OnTimer event
« Reply #33 on: February 24, 2017, 11:11:04 am »
@Fred, the last update in UOS solved my problem! Even using uos_CreatePlayer, uos_AddIntoDevOut, uos_AddFromFile and uos_Play in each OnTimer event, the processor use no more than 0.5%. The memory is also perfect, with very low usage all the time!

Congratulations for your work!

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: UOS: Store a sound in memory and only use uos_Play inside a OnTimer event
« Reply #34 on: February 24, 2017, 12:07:44 pm »
@fauri : Yep, I am very happy that it works for you.

And many thanks to reveal a problem in uos.

Fre;D
« Last Edit: February 24, 2017, 08:51:40 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

metis

  • Sr. Member
  • ****
  • Posts: 300
Re: UOS: Store a sound in memory and only use uos_Play inside a OnTimer event
« Reply #35 on: February 27, 2017, 05:47:27 pm »
@fauri

Quote
But I don't understand why prefer BASS over FMod

Me neither - I always preferred 'Fmod' to 'BASS'.

Quote
Almost nobody talks about FMod here.
Well, now You found someone, who does.  :D
Searching for "Fmod" in this Forum, You'll find some more Topics related to 'Fmod'. (But not too much)  :(

Quote
Is there any Free Pascal headers for this library?
Fmod3 came with Delphi-Wrapper, and -Examples (I still got them on my PC, if You need them).
With Fmod4 (= FmodEx), the API was totally redesigned, and there were no more Delphi-Wrapper/-Examples included.  :'(
So I had the same Question like You some Years ago, and asked in the FmodEx-Forum - Here's the Answer:

"Unfortunately we are not proficient with the Delphi language. In the past we provided delphi headers that were maintained by third parties however those headers fell into disrepair.
If you have any questions about delphi usage with FMOD I suggest asking questions here on the forum. Perhaps some other users can help out."
  %)

After this, I took the Fmod-VB-Wrapper, that came with Fmod v4.30.02, and ported it to Delphi-Pascal.
(At that Time, I still used VB6 and Delphi7, and wasn't that familiar with C.)
-> see the Attachment 'fmod-4.30.02_VB2Delphi7ByMetis.7z'.

Notes:
- This Wrapper is 7 Years old.
  I wrote it for FmodEx v4.30.02, and never did any Updates.
- This Wrapper is not complete.
  I didn't port the entire Fmod-Functionality, but it has all Features to write a Fmod-Player with Pascal.
- I never tried this Wrapper with Lazarus, but it should work in Delphi-Mode.
-> You may take my Fmod-Wrapper, and modify, extend, improve it.  ;)

BTW:
Fmod is a very powerful AudioEngine with really good Features, Sound, and Response, but
meanwhile I left it. Currently I use FFmpeg+SDL+OpenGL+Portaudio for Audio&Video, see:
FFPlay4Laz = "NON(!)-EXE FFPlay4Laz":
http://forum.lazarus.freepascal.org/index.php/topic,26666.0.html
FFInfo4Laz = "Component for retrieving data from video files":
http://forum.lazarus.freepascal.org/index.php/topic,22038.0.html

 :)
« Last Edit: February 27, 2017, 05:49:07 pm by metis »
Life could be so easy, if there weren't those f*** Details.
My FFmpeg4Lazarus = FFPlay4Laz + FFGrab4Laz + FFInfo4Laz

 

TinyPortal © 2005-2018