HardwareHeaven.com
Looking for the skin chooser?
 
 
  • Home

  • Reviews

  • Articles

  • News

  • Tools

  • GamingHeaven

  • Forums

  • Network

 

Go Back   HardwareHeaven.com > Forums > Hardware and Related Topics > kX Project Audio Driver Support Forum > SoundFonts and MIDI


Reply
 
Thread Tools
Old Mar 14, 2005, 02:37 PM   #1
DriverHeaven Newbie
 
Join Date: Jan 2005
Location: Prague
Posts: 16
Rep Power: 0
zvukovac is on a distinguished road

Soundfont API issue

Hi,

I'm attempting to write my own soundfont browser/player as an alternative to the one supplied with kXMixer.

My question is:
If I enumerate soundfonts, how can I find out which banks the soundfonts were loaded into? The API doesn't seem to provide any support on this.

The situation is much clearer if I load soundfonts myself as it is necessary to specify the bank number to use when loading a soundfont. Then I exactly know the soundfont<->bank assignments. But how do I determine these assignments without any notion of past loading/unloading activities ??? Is that feasible with the kX API?

Without this information it is impossible to use the get_preset_description() call since it assumes you to pass a bank number (which I don't know)...

Thanks a lot for an answer.

Any help will be appreciated.

Zvukovac
zvukovac is offline   Reply With Quote


Old Mar 21, 2005, 03:44 AM   #2
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,930
Rep Power: 62
Lex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really nice

Sorry, I totaly forgot your PM.
In case you haven't found the solution yet;

Banknr is stored in sfman_id in sfHeader struct.
Review sfHeader structure in soundfont.h

An example on how to enumerate sf and banknr,
search for 'ikx->enum_soundfonts' in kxctrl.cpp.

HtH,

/LeMury
Lex Nahumury is offline   Reply With Quote
Old Mar 21, 2005, 10:40 AM Threadstarter Thread Starter   #3
DriverHeaven Newbie
 
Join Date: Jan 2005
Location: Prague
Posts: 16
Rep Power: 0
zvukovac is on a distinguished road

Thanks a lot for your answer.

So the bank number is stored in 'sfman_id' field in sfHeader, right? Then my problem should be solved.

I just want to note that it's documented NOWHERE, isn't it a pitty?

And searching for 'ikx->enum_soundfonts' in kxctrl.cpp doesn't help int this case. Because the only place where this call is used is in the 'print_info' function which merely prints the soundfont names and the value of 'rom_ver.minor' field. By the way, what is this 'rom_ver.minor' field for? The 'soundfont.h' file says this is the "soundfont id"... Well, what is this "soundfont id" anyway?

Thank your for an explanation.

Zvukovac
zvukovac is offline   Reply With Quote
Old Mar 21, 2005, 05:43 PM   #4
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,930
Rep Power: 62
Lex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really nice

Quote:
And searching for 'ikx->enum_soundfonts' in kxctrl.cpp doesn't help int this case. Because the only place where this call is used is in the 'print_info' function....
I thought that's exactly what you wanted/asked for: Retrieve info on previous loaded soundfonts!
If so, this is done by accessing members of the sfHeader as done in kxctrl.cpp.
Either by sfman_id or rom_ver.minor.
Just experiment a bit and you'll find out.

Quote:
I just want to note that it's documented NOWHERE, isn't it a pitty?
Well, almost nothing is documented for that matter.

/LeMury
Lex Nahumury is offline   Reply With Quote
Old Mar 22, 2005, 11:00 AM Threadstarter Thread Starter   #5
DriverHeaven Newbie
 
Join Date: Jan 2005
Location: Prague
Posts: 16
Rep Power: 0
zvukovac is on a distinguished road

Ok, just to make it absolutely clear:

if I intend to use

get_preset_description(int bank, int preset, char *name)

WHAT do I pass for the "bank" parameter?

sfHeader.rom_ver.minor is USELESS - this is NO BANK NUMBER
and as you say it's no matter if I use rom_ver.minor or sfman_id.

So what should I use for the "bank" parameter from among the data stored in sfHeader?

Sorry for being that slow-witted.

Zvukovac
zvukovac is offline   Reply With Quote
Old Mar 22, 2005, 11:23 PM   #6
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,930
Rep Power: 62
Lex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really nice

Easy, easy,...
Quote:
get_preset_description(int bank, int preset, char *name)
WHAT do I pass for the "bank" parameter?
sfman_id
Quote:
So what should I use for the "bank" parameter from among the data stored in sfHeader?
sfman_id
Lex Nahumury is offline   Reply With Quote
Old Mar 23, 2005, 11:16 AM Threadstarter Thread Starter   #7
DriverHeaven Newbie
 
Join Date: Jan 2005
Location: Prague
Posts: 16
Rep Power: 0
zvukovac is on a distinguished road

I'm very sorry for the mess.

Yes, using 'sfman_id' for the bank number works perfectly.

Thank you for your help and kind patience...
___________

Now I got my app working almost according to my expectations.

But I still need to find out one more thing:

How to get information about soundfont cache size and its current consumption? Does the kX API have a way to do this?

Thanx once again.

Zvukovac

P.S. Do you think that kX users would be interested in introducing a new SF browser/player that I'm currently working on...? It's a Windows app aimed at soundfont browsing and viewing (i.e.playing). It's a dialog based app with a convenient file browser and a full-extent animated virtual keyboard. It allows you to load/unload soundfonts (even from SFArk, SFPack or zip files), change banks and presets, adjust master/synth volume, velocity, view RAM and cache consumption (thus the above question) and of course, it allows a user to play the keyboard with the selected soundfont. Now it works with kX drivers as well as with the original Creative's drivers. Do you think it would be worth posting it here at DriverHeaven or at the kX's site (for free of course)??? I'm really interested in your opinion. Thanks for any comments.
zvukovac is offline   Reply With Quote
Old Mar 23, 2005, 02:44 PM   #8
kX Lover
 
Samir's Avatar
 
Join Date: Jan 2003
Posts: 520
Rep Power: 0
Samir is on a distinguished road

I don't know if LeMury would be interested, but I WLOUD! This is something i waited for too long! Zvukovac: Have you finished SF browser/player app. for Creative driver yet, or it's the same app. for both kX & Creative drivers?

thank you!
__________________
MU3NKA 3A HAPO6!
Samir is offline   Reply With Quote
Old Mar 26, 2005, 11:55 AM   #9
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,930
Rep Power: 62
Lex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really nice

Quote:
Originally Posted by zvukovac
How to get information about soundfont cache size and its current consumption? Does the kX API have a way to do this?
Latest driver release support >32mb sf cache in host memory.
That is; User can load >32mb sf files, but max. sample playback remains 32mb of course.
I don't remember Eugene mentioning the exact max host cache size.
As for current consumption;
I'm not aware of a 'special function' to retrieve current consumption.
After a succesfull sf load, I simply cummulate total size,
or read sfheader->size and cummulate if sf was previously loaded.

Quote:
Originally Posted by zvukovac
P.S. Do you think that kX users would be interested in introducing a new SF browser/player that I'm currently working on...?
Yes of course. I'm sure it will be much appreciated.
Although most muso users will load sf through their sequencer, I have seen quite some
posts of users who missed a standalone sf loader/manager ala CT.
Looking forward to see your work!

/LeMury
PS:
One particulair related item/issue I've worked on and still plan to finish sometime,
is dynamicly loading/unloading Presets rather then entire sf files/banks.
I have finished a CT compatible version, but kX SF implementation doesn't support
preset loading/unloading so I had to find a workaround.
However, I stopped searching because of the sf attack issue which (IMO) renders kX sf capabilities useless.
Lex Nahumury is offline   Reply With Quote
Old Mar 26, 2005, 02:00 PM Threadstarter Thread Starter   #10
DriverHeaven Newbie
 
Join Date: Jan 2005
Location: Prague
Posts: 16
Rep Power: 0
zvukovac is on a distinguished road

That's great to hear there's someone who would appreciate my work!

It is currently in a state which is fully functional. But some features still need to be accomplished.

I assume I'll post a link to my app here in cca 2 weeks.

I find it necessary to mention some necessary facts in advance:
1) I will provide both binary and source code for FREE and...
2) ...I will provide NO guarantee either on the functionality of the code or future support. I work on the app in my free time (and there's pretty little of it for me!) and so I cannot promise I will work on bug fixes whenever a bug is discovered.
3) Although the designed GUI contains a progress bar for displaying status of sf memory consumption, this progress bar will be "dead" in the first release.

I hope someone will find my app useful.

Zvukovac
zvukovac is offline   Reply With Quote
Old Mar 26, 2005, 02:07 PM Threadstarter Thread Starter   #11
DriverHeaven Newbie
 
Join Date: Jan 2005
Location: Prague
Posts: 16
Rep Power: 0
zvukovac is on a distinguished road

Samir,

yes, I've already finished my app for work with SB drivers (it works ok) and I'm currently "tuning" it to work with kX drivers as well. So the final app will support both types of drivers.

However, now it is necessary to switch between kX and SB drivers "manually" as I don't know of any way of determining what type of driver a particular system is running. But I guess this should be easy to find out. Or do you, guys, have any suggestions as to how to get this information? LeMury?

Zvukovac
zvukovac is offline   Reply With Quote
Old Mar 26, 2005, 03:54 PM   #12
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,930
Rep Power: 62
Lex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really nice

Different possiblities;
1. Through basic Windows multimedia API calls you can get all installed
driver caps and info strings.
Just do some string comparison to determine what drivers are installed.

2. To determine if and how many kX cards;

ikx = new iKX();
if(!ikx)
{
// No kX driver or error init interface
ikx=0;
return;
}

if(ikx->init(i) == 0)
{
// kX driver and device_number(i) present
}
else
{
// kX driver or device_no(i) not present or not working properly
}
ikx->close(); // don't forget to close after done!
ikx=0;
delete ikx;


3. Can't remember exactly, but IIRC SF SDK also provides some methods.

etc.

/LeMury

Last edited by LeMury; Mar 27, 2005 at 04:19 AM. Reason: typo
Lex Nahumury is offline   Reply With Quote
Old Apr 15, 2005, 01:06 PM Threadstarter Thread Starter   #13
DriverHeaven Newbie
 
Join Date: Jan 2005
Location: Prague
Posts: 16
Rep Power: 0
zvukovac is on a distinguished road

Hi there!

Here is the link to my SFMan app:

http://zvukovac.muzika.cz

I'm sorry for the awfully sloooooooooow connection but it's a free demo webhosting - no miracle and it will expire on 30/9/2005... doesn't anyone know about a fast & free webhosting for SFMan? Up to 5 MB would be just enough. Any tips?

Zvukovacz

P.S. Please read the comments at that site... apart from others it will tell you that SFMan is proved to run ONLY on a Windows XP machine with Soundblaster Live 5.1 and kX drivers. Please let me know if you are not able to run the app or encounter any problems with it. I will try to resolve it. Please attach your configuration description (i.e. HW&SW setup), too. Thanks.
zvukovac is offline   Reply With Quote
Old Apr 15, 2005, 03:02 PM Threadstarter Thread Starter   #14
DriverHeaven Newbie
 
Join Date: Jan 2005
Location: Prague
Posts: 16
Rep Power: 0
zvukovac is on a distinguished road

One more note about SFMan:
Some features are not finished, some are buggy. If you're looking for a product that is ready to go, just forget about SFMan or wait till next release. The current (pre-)release is intended for SF enthusiasts who were waiting for an app like this a long time and feel like they cannot wait any longer. Those people are likely to respect the current poor state of the app (although it's functional and fully sufficient for my needs).

Zvukovacz
zvukovac is offline   Reply With Quote
Old Apr 16, 2005, 03:57 AM   #15
Long Time ***** Friend
 
thomasabarnes's Avatar
 
Join Date: Jan 2003
Location: USA
Posts: 1,373
Rep Power: 58
thomasabarnes will become famous soon enough
System Specs

Zvukovac:

Great work on this man!!! I have an Audigy, and used it with the 3537 driver, so far. Gona try it with 3538h, soon.


Let me make a few comments. 1st, I had a bit of a problem trying to download the app. I see now that the file size is 500kb, correct? Now, I get no image or icon for the app. There's just the name SFMan.exe. I click on it an the User Interface comes up.

This is a really nice app for auditioning one's soundfont collection! I can use the Soundfont Explorer and browse to any soundfont location! I'm using a MIDI keyboard controller, and the pitch bend and Modulation wheels work great, too!

As for the File Locations dialog box, I dont understand how it's suppose to work. Because if I set a directory in the Soundfonts Location section under Others, The directory I set there, is not the directory I see, if I close and reopen the app.

I'm glad you created and presented this app, though. This takes the place of MIDI OX for me for playing soundfonts standalone. Thanks for presenting this to us!
__________________

May a song always touch you in a positive way.
Sonar 8.5.3 PE, Windows 7 Pro 64Bit, MOTU UltraLite MK3, 150 GB HDD, 250 GB HDD, 1 TB HDD 7200 rpm,
My Music Production: Top 40, Contemporary Christian, Pop/Rock, Decent Rap, Inspirationals, and Children Songs

Last edited by thomasabarnes; Apr 18, 2005 at 01:04 AM.
thomasabarnes is offline   Reply With Quote
Old Apr 17, 2005, 03:17 PM   #16
kX Lover
 
Samir's Avatar
 
Join Date: Jan 2003
Posts: 520
Rep Power: 0
Samir is on a distinguished road

Well, there is some download trouble for sure... I was able to download it after 4-5 attempts, using Firefox...

Zvukovac, i must admit that your program is GREAT! Very simple & clean, standalone exe, i'm very, very, happy with it! Haven't noticed any problems so far... One more thing; would it be simple enough to add feature to be able to play using pc-keyboard? Only one octave or two, i would like to be able to test some chords, without using MIDI keyboard attached...
__________________
MU3NKA 3A HAPO6!
Samir is offline   Reply With Quote
Old Apr 18, 2005, 01:13 PM Threadstarter Thread Starter   #17
DriverHeaven Newbie
 
Join Date: Jan 2005
Location: Prague
Posts: 16
Rep Power: 0
zvukovac is on a distinguished road

Hi, guys,

I'm really very pleased you like my app though it's not finished yet. I'm working on improvements.

As to the download:
I must agree downloading from that site is a hell! But that's because I didn't pay for the webhosting and just settled with a free "demo" version which significantly limitates traffic. I'm sure the app deserves a better site but who's gonna pay it? Or don't you guys know of any FREE webhosting that could satisfy our needs? Or - doesn't anyone have a fast site that would be able to accomodate the app? Very little space is needed - 1 MB would suffice...

As to the functionality:

Thomasabarnes:
- the invisible app icon is a bug and I will put it right as soon as possible.
- the "Soundfont Location" setting is useless in this release. I put it there as I thought it would have been nice for a user to specify his/her preferred soundfont location and then have the explorer open in that location... but then I decided to start the explorer in the last directory opened which seems more convenient to me... In future I want to support both these options and let the user decide what suits him best.

Samir:
- I will add the pc-keyboard soundfont auditioning feature in the next release. I guess it shouldn't be a lot of work and I find the feature useful as well.

Thank you guys for your comments.

Any other comments are welcome.

Zvukovacz
zvukovac is offline   Reply With Quote
Old Apr 23, 2005, 03:21 PM   #18
DriverHeaven Junior Member
 
Join Date: Feb 2005
Posts: 71
Rep Power: 0
John Lodge is on a distinguished road

There is something wrong with the way sfman loads large soundfonts. SGM-180 for example.

Using 3538h (since I'm using a SB0400) loading the font in the Kx soundfont window works fine, and indeed sfman also loads it but sfman leaves the app "fagile"; touching a few keys works but anything more like the pan etc, causes a BSOD. Not sure who is doing it (could be sfman or Kx).

As well it is a bit odd to sort the presets on alpha; from font to font dependent on spelling the presets are going to move all over the place. Leaving them in numerical order makes them a bit easier to find.
John Lodge is offline   Reply With Quote
Old Apr 25, 2005, 11:43 AM Threadstarter Thread Starter   #19
DriverHeaven Newbie
 
Join Date: Jan 2005
Location: Prague
Posts: 16
Rep Power: 0
zvukovac is on a distinguished road

Quote:
Originally Posted by John Lodge
There is something wrong with the way sfman loads large soundfonts. SGM-180 for example.
I will investigate it.

Quote:
Originally Posted by John Lodge
touching a few keys works but anything more like the pan etc, causes a BSOD.
Sorry, what is BSOD?

Quote:
Originally Posted by John Lodge
it is a bit odd to sort the presets on alpha. Leaving them in numerical order makes them a bit easier to find.
Good point. Sorting on alpha is not desired. I will put it right in next release.

Zvukovacz
zvukovac is offline   Reply With Quote
Old Apr 25, 2005, 02:18 PM   #20
DriverHeaven Junior Member
 
Join Date: Feb 2005
Posts: 71
Rep Power: 0
John Lodge is on a distinguished road

BSOD = Blue Screen Of Death. The diagnostic leftover when XP crashes to the floor.

By the way it is instantaneous. It does not start to process and die it goes in a flash if the wrong thing is selected,
John Lodge is offline   Reply With Quote
Old Apr 25, 2005, 04:49 PM Threadstarter Thread Starter   #21
DriverHeaven Newbie
 
Join Date: Jan 2005
Location: Prague
Posts: 16
Rep Power: 0
zvukovac is on a distinguished road

Quote:
Originally Posted by John Lodge
By the way it is instantaneous. It does not start to process and die it goes in a flash if the wrong thing is selected,
Sorry, I don't understand. What is instantaneous? What is supposed to "start to process and die"? Sorry, I'm not native English.
zvukovac is offline   Reply With Quote
Old Apr 25, 2005, 06:55 PM   #22
DriverHeaven Junior Member
 
Join Date: Feb 2005
Posts: 71
Rep Power: 0
John Lodge is on a distinguished road

It dies immediately on mouse clicking. It does not start to execute and perhaps run out of memory or something it is a fast terminate.
John Lodge is offline   Reply With Quote
Reply

Bookmarks

Thread Tools