|
Irrational86
Posts: 960
|
 |
« Reply #20 on: 11 Jan '04 - 06:04 » |
Quote
|
lol...ok, thanks, hehehe
|
|
|
|
|
Logged
|
|
|
|
|
DanaPaul
Posts: 335
|
 |
« Reply #21 on: 11 Jan '04 - 10:25 » |
Quote
|
Arthur, you have e-mail with a small attachment  Incidentally, I've started a web page that includes a collection of suggestions for Delphi distributable example code applications. If anyone has sugestions or comments please post or send e-mail... http://members.aol.com/wtgdana/delphi_distributable_code.htm
|
|
|
|
|
Logged
|
|
|
|
|
Irrational86
Posts: 960
|
 |
« Reply #22 on: 11 Jan '04 - 15:59 » |
Quote
|
Excuse me Dana, but you got a mistake in your webpage about the DWORD type, look at these two screen shots (this is the help for Delphi 7)...focus on the red circle Screen shot 1Screen shot 2
|
|
|
|
« Last Edit: 11 Jan '04 - 15:59 by XMinioNX »
|
Logged
|
|
|
|
|
Chris
Posts: 1505
|
 |
« Reply #23 on: 11 Jan '04 - 17:07 » |
Quote
|
Sorry Dana there are no Diffrends about the normal DWord and the Windows DWord... Here are some excerpt from the Orginal Delphi 6 Sources (between delphi6 and delphi 7 are no difference about the IntegerTypes
Longword 0..4294967295 32 Bit, unsigned 32 Bit
---------------------------------------------------------------------
now lets jump to the orginal Windows.pas
DWORD = Types.DWORD
-------------------------------------------------------
now lets jump to the Types.pas
DWORD = LongWord
Greets chris
|
|
|
|
|
Logged
|
|
|
|
|
DanaPaul
Posts: 335
|
 |
« Reply #24 on: 11 Jan '04 - 22:00 » |
Quote
|
I'll update the page with this info.
In Delphi 2 Windows.pas declares... DWord = integer. LongWord type doesn't exist, and Cardinal comes the closest to a 0..4294967295 4 byte integer type, but in theory only.
IMHO, regardless of Delphi version, re-typecasting DWord type isn't progress.
|
|
|
|
|
Logged
|
|
|
|
|
Alex
Guest
|
 |
« Reply #25 on: 23 Jan '04 - 00:11 » |
Quote
|
Hi, i found the following DSP code for c from a link in this thread and i want to use it in delphi. I know that there is a similar function in bass_fx20alpha but i want to try it The C code was Here's a simple dynamic amplification DSP... #define amptarget 30000 // target level #define ampquiet 800 // quiet level #define amprate 0.02f // amp adjustment rate
typedef struct { float gain; // amplification level int delay; // delay before increasing level int count; // count of sequential samples below target level int high; // the highest in that period int quiet; // count of sequential samples below quiet level } AUTOAMPSTUFF;
void CALLBACK autoamp(HDSP handle, DWORD channel, void *buffer, DWORD length, AUTOAMPSTUFF *amp) { short *data=(short*)buffer; DWORD c; for (c=0;c<length/2;c++) { int s=(int)(data[c]*amp->gain); // amplify sample int sa=abs(s); if (abs(data[c])<ampquiet) amp->quiet++; // sample is below quiet level else amp->quiet=0; if (sa<amptarget) { // amplified level is below target if (sa>amp->high) amp->high=sa; amp->count++; if (amp->count==amp->delay) { // been below target for a while if (amp->quiet>amp->delay) // it's quiet, go back towards normal level amp->gain+=10*amprate*(1-amp->gain); else amp->gain+=amprate*amptarget/amp->high; // increase amp amp->high=amp->count=0; // reset counts } } else { // amplified level is above target if (s<-32768) s=-32768; else if (s>32767) s=32767; amp->gain-=2*amprate*sa/amptarget; // decrease amp amp->high=amp->count=0; } data[c]=(short)s; // replace original sample with amplified version } }
...
AUTOAMPSTUFF amp;
amp.gain=1; amp.delay=BASS_ChannelSeconds2Bytes(handle,1)/2; amp.count=amp.high=amp.quiet=0; BASS_ChannelSetDSP(handle,(DSPPROC*)&autoamp,&); I managed to go this far because of some knowladge in PHP but i don't know what to use instead of data[c] to read the samples type TAUTOAMPSTUFF = record gain: float; // amplification level delay: Integer; // delay before increasing level count: Integer; // count of sequential samples below target level high: Integer; // the highest in that period quiet: Integer; // count of sequential samples below quiet level end; ..... implementation var amp:TAUTOAMPSTUFF;
const amptarget = 30000; // target level ampquiet = 800; // quiet level amprate = 0.02; // amp adjustment rate
procedure DynamicAmp(handle: HDSP; channel: DWORD; buffer: Pointer; length: DWORD; user: DWORD); stdcall; var c: DWORD; data: PSingle; S,sa: Integer; begin data := buffer; c := 0; for c := 0 to (length div 2) do begin s := data[c] * (amp.gain)); // amplify sample sa := abs(s); if ((abs(data[c])) < (ampquiet)) then inc(amp.quiet) // sample is below quiet level else amp.quiet := 0;
if (sa < amptarget) then // amplified level is below target begin if (sa > amp.high) then amp.high := sa; inc(amp.count); if (amp.count = amp.delay) then // been below target for a while begin if (amp.quiet > amp.delay) then // it's quiet, go back towards normal level amp.gain := amp.gain + (10 * amprate * (1 - amp.gain)) else amp.gain := amp.gain + (amprate * amptarget / amp.High); // increase amp amp.high := 0; // reset counts amp.count := 0; end; end else // amplified level is above target begin if s > 32767 then s := 32767 else if s > 32767 then s := 32767; amp.gain := amp.gain - (2 * amprate * sa / amptarget); // decrease amp amp.high := 0; amp.count := 0; end; data[c]=s; // replace original sample with amplified version end;
end; Thank you Alex
|
|
|
|
|
Logged
|
|
|
|
|
3delite
Guest
|
 |
« Reply #26 on: 14 Feb '04 - 21:48 » |
Quote
|
Hi! I was looking for a dsp equalizer for my app, when I came across BASS_FX and found out it's exactly what I needed!!! Please add support for 32bit floating point dsp data soon!!! When will the final be ready!??? You may want to check out, bass_fx will be a plugin for MP3 Stream Editor 1.3 hopefully in full 32bit fp! http://3delite.fly.toCheers!
|
|
|
|
|
Logged
|
|
|
|
|
3delite
Guest
|
 |
« Reply #27 on: 15 Feb '04 - 19:35 » |
Quote
|
Working on the plugin, I wonder am I doing it right?  My code looks like, setup: BASS_ChannelGetAttributes(Stream.Channel, freq, vol, pan); for i := 0 to 8 do begin Result := BASS_FX_DSP_Set(Stream.Channel, BASS_FX_DSPFX_PEAKEQ, DSPPriority); case i of 0: Bands.fCenter := 100; 1: Bands.fCenter := 250; 2: Bands.fCenter := 500; 3: Bands.fCenter := 1000; 4: Bands.fCenter := 3000; 5: Bands.fCenter := 5000; 6: Bands.fCenter := 8000; 7: Bands.fCenter := 11000; 8: Bands.fCenter := 14000; end; Bands.lBand := i; Bands.fBandwidth := (FormConfig.TrackBarBandWith.Position / 10); Bands.FQ := 0; Bands.fGain := - FormConfig.Tag2Bar(i).Position; Bands.lFreq := freq; BASS_FX_DSP_SetParameters(Stream.Channel, BASS_FX_DSPFX_PEAKEQ, @Bands); end; And the params changing code: if FormConfig.NeedUpdate then begin FormConfig.NeedUpdate := False; for i := 0 to 8 do begin Band.lBand := i; BASS_FX_DSP_GetParameters(Channel, BASS_FX_DSPFX_PEAKEQ, @Band); Band.fGain := - FormConfig.Tag2Bar(i).Position; BASS_FX_DSP_SetParameters(Channel, BASS_FX_DSPFX_PEAKEQ, @Band); end; end; When I change the lower freqs it doesn't seem to work. The higher freqs work ok. Any ideas?
|
|
|
|
|
Logged
|
|
|
|
|
(: JOBnik! :)
Posts: 984
|
 |
« Reply #28 on: 20 Feb '04 - 20:33 » |
Quote
|
Hi  * Sorry, but the 32-bit version of BASS_FX is not ready yet. Have fun!  JOBnik! 
|
|
|
|
« Last Edit: 20 Feb '04 - 20:36 by (: JOBnik! :) »
|
Logged
|
|
|
|
|
3delite
Posts: 623
|
 |
« Reply #29 on: 23 Feb '04 - 05:24 » |
Quote
|
Tryed to follow the example code logic like this: BASS_ChannelGetAttributes(Stream.Channel, freq, vol, pan);
Result := BASS_FX_DSP_Set(Stream.Channel, BASS_FX_DSPFX_PEAKEQ, DSPPriority); Result := BASS_FX_DSP_Set(Stream.Channel, BASS_FX_DSPFX_PEAKEQ, DSPPriority); Result := BASS_FX_DSP_Set(Stream.Channel, BASS_FX_DSPFX_PEAKEQ, DSPPriority); Result := BASS_FX_DSP_Set(Stream.Channel, BASS_FX_DSPFX_PEAKEQ, DSPPriority); Result := BASS_FX_DSP_Set(Stream.Channel, BASS_FX_DSPFX_PEAKEQ, DSPPriority); Result := BASS_FX_DSP_Set(Stream.Channel, BASS_FX_DSPFX_PEAKEQ, DSPPriority); Result := BASS_FX_DSP_Set(Stream.Channel, BASS_FX_DSPFX_PEAKEQ, DSPPriority); Result := BASS_FX_DSP_Set(Stream.Channel, BASS_FX_DSPFX_PEAKEQ, DSPPriority); Result := BASS_FX_DSP_Set(Stream.Channel, BASS_FX_DSPFX_PEAKEQ, DSPPriority); for i := 0 to 8 do begin case i of 0: Bands.fCenter := 100; 1: Bands.fCenter := 250; 2: Bands.fCenter := 500; 3: Bands.fCenter := 1000; 4: Bands.fCenter := 3000; 5: Bands.fCenter := 5000; 6: Bands.fCenter := 8000; 7: Bands.fCenter := 11000; 8: Bands.fCenter := 14000; end; Bands.lBand := i; Bands.fBandwidth := (FormConfig.TrackBarBandWith.Position / 10); Bands.FQ := 0; Bands.fGain := - FormConfig.Tag2Bar(i).Position; Bands.lFreq := freq; BASS_FX_DSP_SetParameters(Stream.Channel, BASS_FX_DSPFX_PEAKEQ, @Bands); end; And it's working! I think...  Well anyway full source code for all the plugins is here: http://web.axelero.hu/csanadim/MP3SE/download/mp3se_plugin_sdk.zipDocs (under construction): http://web.axelero.hu/csanadim/MP3SE/developer.htmlCan't wait for the final!!!
|
|
|
|
|
Logged
|
|
|
|
|
3delite
Posts: 623
|
 |
« Reply #30 on: 21 Mar '04 - 16:29 » |
Quote
|
* VERSION 2.0 (not "alpha") will support: * 32-bit floating-point including in: DSP, Tempo, BPM & Reverse. * Multi Channel in some DSPs. * Planning to release till the end of this month/year  
|
|
|
|
|
Logged
|
|
|
|
|
(: JOBnik! :)
Posts: 984
|
 |
« Reply #31 on: 21 Mar '04 - 19:26 » |
Quote
|
Hi Sooooooooooo.... SORRY  I just don't have so much time lately, I got a new job and all the time I'm just working... and working... and...  * It will be updated  Have fun!  JOBnik! 
|
|
|
|
|
Logged
|
|
|
|
|
3delite
Posts: 623
|
 |
« Reply #32 on: 10 Apr '04 - 19:54 » |
Quote
|
mmmokay...  One more question, I have here. Does it work undex win98? I am having some problems, when loading the plugins, which use bass_fx.dll, LoadLibrary() fails...  No problems on XP.
|
|
|
|
|
Logged
|
|
|
|
|
(: JOBnik! :)
Posts: 984
|
 |
« Reply #33 on: 11 Apr '04 - 16:57 » |
Quote
|
Hi  One more question, I have here. Does it work undex win98? I am having some problems, when loading the plugins, which use bass_fx.dll, LoadLibrary() fails...  No problems on XP. I've tested BASS_FX with WinME and it's works perfectly  * Please write some more info about errors that you get. Have fun!  JOBnik! 
|
|
|
|
|
Logged
|
|
|
|
|
3delite
Posts: 623
|
 |
« Reply #34 on: 13 Apr '04 - 02:54 » |
Quote
|
I'm afraid I can't tell you much more. I write the plugins in Delphi, simple DLLs, and then load them with SafeLoadLibrary(). It works perfectly on XP, but on my Win98, for some strange reason SafeLoadLibrary() or LoadLibrary() (tryed both) returns 0 handle, but only for those plugins which use bass_fx.dll.  Other plugins, like bass_wa.dll user, load ok on both systems. Tryed to copy bass_fx.dll to the plugins folder, which doesn't make much sense since the other plugins don't need this, but that wouldn't help either. Ian pointed out this bug, I'm only running on XP here... None of my code runs, as the plugin won't even load, so I really don't have any more ideas... 
|
|
|
|
|
Logged
|
|
|
|
|
(: JOBnik! :)
Posts: 984
|
 |
« Reply #35 on: 18 Apr '04 - 10:49 » |
Quote
|
Hi  I've checked your software with WinXP and WinME and it works perfectly with BASS_FX  Have fun!  JOBnik! 
|
|
|
|
|
Logged
|
|
|
|
|
3delite
Posts: 623
|
 |
« Reply #36 on: 18 Apr '04 - 16:28 » |
Quote
|
 Must be that Win98/Win98SE difference...  I'll test it on SE, for sure! 
|
|
|
|
|
Logged
|
|
|
|
|
Chief Sunet
Guest
|
 |
« Reply #37 on: 19 Apr '04 - 20:34 » |
Quote
|
My app needs an "A/B" function, where the user clicks a button when he hears where he wants to start a loop. He then clicks the button again where he wants the loop to end.
The function BASS_FX_TempoGetApproxSeconds returns an approximation of the position being heard after applying a tempo change. That and an approximation of the new length using the same function would be enough to calculate where in the original file the user's loop starts so that I can loop what the user wants looped.
The problem is that although BASS_FX_TempoGetApproxSeconds returns a Float. It's only accurate out to the second. That's just not good enough for a loop.
Is it possible that you could get BASS_FX_TempoGetApproxSeconds to return a position approximation that is accurate at least out to the hundredth place in the next version?
Do you know of an option other than BASS_FX_TempoGetApproxSeconds?
|
|
|
|
|
Logged
|
|
|
|
|
(: JOBnik! :)
Posts: 984
|
 |
« Reply #38 on: 24 Apr '04 - 21:14 » |
Quote
|
Hi  I'm checking it out  Meanwhile I'm about to add a new Example to BASS_FX "package" showing how to make it able to use Sync and BASS_FX's Tempo  Have fun!  JOBnik! 
|
|
|
|
|
Logged
|
|
|
|
|
MindWorkSoft
Posts: 13
|
 |
« Reply #39 on: 26 Apr '04 - 01:05 » |
Quote
|
Hi JOBnik,
I am now reprogramming again my Whoosh Mp3 to make compatible with your latest version of BASS_FX and BASS.
The latest vesion is so nice specially the BPM/Tempo, I wish you can add another function that I really need and that is the Real time Beat Tap, so that aside from Auto BPM detection, user can also define thier BPM value for the song, or I you could share a little code for Beat Tap.
Thanks Dards
|
|
|
|
|
Logged
|
|
|
|
|