Author |
Topic
|
Twang
Posts: 126
|
Posted - Fri Jun 07, 2002 8:06 am
|
|
|
Can this be done using the DirectX SDK?
Is there a CEP-specific API and, if so, where is it documented?
thanks,
- Twang
|
|
kblackwell
Location: USA
Posts: 37
|
Posted - Fri Jun 07, 2002 12:26 pm
|
|
|
Quote: |
Can this be done using the DirectX SDK?
Is there a CEP-specific API and, if so, where is it documented? |
I had similar wonderings, did a search, found some older discussion. I suppose you know about the Direct X files web site and the toolkit that Cakewalk provides for free? I have no idea whether it can work with CEP, or what operating system it requires, etc. I have, however, tried using the XFM SDK specifically for CEP, which you can get right here on this site (go to the download area). It works. I happen to have an old version of Visual C++ Developer Studio, and had no problems getting it to work.
Modifying one to make it do what I want has been more problematic, however, as there aren't enough examples for using various kinds of controls in the dialog box (sliders, etc.). Worse off, the SDK has not been updated for CEP 2, meaning it gives you no way to make the XFM show up in the Multitrack window for real-time effects, and no way to use the dynamic controls (automation) there. I asked Syntrillium for help with this a few days ago, and have not gotten any reply whatsoever yet. You have to pay close attention to what you're doing, as the ReadDataEx and WriteDataEx routines take arguments dealing with "samples" where "sample" is defined as both a left and right value when operating on a stereo waveform, and they return a number of bytes instead. Plenty of room there for mistakes even when you think you *are* paying attention.
Does anybody have any nice XFM example code to share besides that provided by the SDK?
_________________
--
Keith W Blackwell |
|
|
|
Twang
Posts: 126
|
Posted - Fri Jun 07, 2002 1:19 pm
|
|
|
Howdy KB
thanks for the reply. I'm guessing that the API updates, documenting them, or both are the last things on the CEP2 to-do list. (I have no way to know, just thinking like a programmer.)
"I had similar wonderings, did a search, found some older discussion. I suppose you know about the Direct X files web site and the toolkit that Cakewalk provides for free?"
No, I haven't done any hands on with this kind of stuff for a while. Can you post the link to that DX site?
"[...] the XFM SDK specifically for CEP [... in] the download area [...] works."
Oh cool! I missed that. Great I'll dig it up and muck around with it this weekend.
"Modifying one to make it do what I want has been more problematic, however, as there aren't enough examples [...]"
Time to hack and test sounds like...
" the [old] SDK has not been updated for CEP 2 [...] I asked Syntrillium for help with this a few days ago, and have not gotten any reply whatsoever yet."
Hmmm... I have no idea how their responses are to such queries, but I'm a bit baffled about my not getting an email response for a *sales* request. (Do you guys want to sell me something or not ? ;-)
"[... routines] take arguments dealing with 'samples' [...] and return a number of bytes instead. Plenty of room there for mistakes even when you think you *are* paying attention. "
I sure hope this is standardized across the API, as in the rtn val is the bytes sucessfully sent/received or an error code. Anything else, or a mix could get pretty goofy... well I shouldn't judge without seeing the code...
"Does anybody have any nice XFM example code to share besides that provided by the SDK?"
Ditto the request. Best way to learn is while you burn brain cells on other's code.
ciao
- T
|
|
|
|
Twang
Posts: 126
|
Posted - Fri Jun 07, 2002 2:08 pm
|
|
|
BK:
Skimmed the APISPRO.doc. I see what you mean about the ReadDataEx() returning bytes read in terms of samples - whereas the WriteDataEx() returns the "units of samples, not bytes."
Same thing only different? ;-)
If the newer API is like this one, it seems like it would be pretty straightforward ... but the multiple wave and multiple file functions look kinda hairy.
I'll bet a cup of coffee and two 96kHz samples that the new API drops all the routines listed as 'obsolete' in the current doc, modifies the CI struct, and adds whatever new functions CEP 2 has that older versions don't, while maintaining the same approach. (Unless CEP 2 was a total rewrite ?? If so, we may have longer to wait!)
- T
|
|
kblackwell
Location: USA
Posts: 37
|
Posted - Sat Jun 08, 2002 1:45 pm
|
|
|
Quote: |
I'll bet a cup of coffee and two 96kHz samples that the new API drops all the routines listed as 'obsolete' in the current doc, modifies the CI struct, and adds whatever new functions CEP 2 has that older versions don't, while maintaining the same approach. (Unless CEP 2 was a total rewrite ?? If so, we may have longer to wait!) |
The SDK as is works with CEP 2, as that is what I am using. But there is no indication how to access newer features.
I've been pulling my hair out over a series of problems, one thing after another. Most of it is because my plugin needs to always have some prior and successive data available when processing any given sample. Simple matter of programming, right? But I keep seeing really weird things. Like when then plugin finishes, the progress meter hangs there without ever going away (until I press "Cancel") because the last few samples never get read in. The ReadDataEx routine keeps telling me it read 0. Well, it's probably yet another thing I'll eventually figure out that I did wrong. Still, it sure would have helped if they had made some sample code available that does this. I can't tell for sure, but I don't think ReadDataEx works on negative offsets (I was hoping it would return 0's), or maybe even with offsets prior to the selection area, or if it does work, perhaps it needs a balancing WriteDataEx? Or maybe my code has still more undiscovered bugs (duh). Like I said, it's a confusing world to program in, where "sample" is really 2 samples in a stereo waveform, but you put them into an array of floats where each index is just 1 actual value. You really have to watch your steps. I've been trying to use a naming convention for all the variable and such that keeps it clear what their "units" are, and this has helped clear up some things.
I also haven't been able to get the dialog box control changes (made by the user during Preview) to actually show up within the running code. Thought I got everything in needed for that, but no dice. Oh, actually, Preview is generating some weird noisy modulation at the moment, so I'm having to just click "OK" and see what happens. Yet another bug to work out.
My intent was to work in the complex plane, but to get the imaginary component I figure I need the instantaneous derivative (slope) of the waveform at each sample. Sorry, I've only had one DSP class (an intro), so perhaps it is a well-known procedure how to go from a real waveform to a complex waveform, but I'm trying to make this up as I go (the theory/idea side of things can be a lot more fun and more of a learning experience that way). I'm using something like a sum of squares of the delta of samples before and after to get a better
approximation, though ultimately I was hoping to do some interpolation using the FFT features available in the SDK. Using the slope and actual sample value as points on a 2-D plane, you can then convert to polar coordinates and do interesting things to the angle, or whatever, before converting back to an instantanous rectangular value to output. But my "slope" ends up with a glitch in it every so often. I've been surprised to see that ReadDataEx is always returning less than what I'm asking for. Sounds like a logic error in my code to manage walking through the data in a loop. Or....
Hey, I think I better go back and re-read that ReadDataEx documentation. :-)
|
|