20 May '13 - 10:37 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
  Home Help Search Login Register  
  Show Posts
Pages: [1] 2 3 ... 8
1  Developments / BASS / Re: BASS_ChannelGetData for video file such as (.avi) on: 14 Jan '13 - 16:12
You are doing something which I guess isn't intended to be that way ...

For example ffmpeg can do that too, also it outputs the Progress on the command line it would be cleaner to use this tool which is inteded to be used for a/v conversion/encoding. If someone for example inputs something different than standard avi in your Application you could get a Problem ...
ReplyReply Reply with quoteQuote
2  Developments / BASS / Re: BASS_DSHOW Video Library on: 13 Jan '13 - 15:28
@Kachi: If you dont find a way to do it using Bass you can download ffmpeg for example here: http://ffmpeg.zeranoe.com/builds/ and use the command from that website, check the part where it says "Extracting sound from a video, and save it as Mp3" !!
ReplyReply Reply with quoteQuote
3  Developments / BASS / Re: Extracting audio from video file on: 13 Jan '13 - 10:45
You can extract audio from videos easily using the command line tool ffmpeg if you don't find a way to do it using Bass, check the commands at "Extracting sound from a video, and save it as Mp3" on that Website.
ReplyReply Reply with quoteQuote
4  Developments / BASS / Re: Non-Realtime BPM detection with beat locations on: 10 Jan '13 - 17:41
First you have to know if you want to analyse a File with Bass without Playing it you need to use a so called Decoding Stream.
You can use the Class BassFx, try to use "BassFx.BASS_FX_BPM_BeatDecodeGet".

Here you can find an example code which gets the Beats of a Decoding Stream using a Callback which is called when a Beat is found: http://www.bass.radio42.com/help/html/7799e7ea-d193-3521-02af-6a3f9a3d3833.htm

But please take in mind that the BassFx Beat Detector isn't very state of the Art in Beat Detection ...
ReplyReply Reply with quoteQuote
5  Developments / BASS / Re: Draw FFT graph for peak frequency identification c# on: 9 Jan '13 - 17:32
Quote
? according to my knowledge Bass.net API doesn't have a system to request FFT data for given time period, It just returns FFT data based on the flag we provide right?

You can do this by using BASS_ChannelGetPosition and to get the current Position of your decoding channel and use BASS_ChannelBytes2Seconds to look if you have for example the average FFT Data of 500 ms.

Another Method using a simpler approach:

* You take the PCM Values (Samples of the Audio File;"Sound Wave Dots/Points", take using ChannelGetData) of your clipped sample and run in a loop from Start of your Original Song to the End of it and always check the Average difference of these next X Samples, so if that Method finds the right Spot, the difference should be very low because the following Sound Waves are almost exactly the same !
I didn't think fully through that Approach but if its an easy example, just some seconds "cut out" from another File you could get good results with this Method.
ReplyReply Reply with quoteQuote
6  Developments / BASS / Re: Draw FFT graph for peak frequency identification c# on: 3 Jan '13 - 20:43
Yes, the Frequency is the same but imagine the following:

The FFT catches the Sound Wave of Frequency 1 after it made one full wave in that Frequency so you have that as a Peak Frequency with a higher Amplitude than if the FFT starts at a Point where you can for example only see half of that Sound Wave and half of a Wave with a different Frequency (they are mixed), so the Amplitude of your Peaks depends on where your FFT takes place in the different Sound Waves ...

Summary: A half not completely finished Sine Wave with 400 Hz has the same frequency as a "full one" but its not as clear as full one !
ReplyReply Reply with quoteQuote
7  Developments / BASS / Re: Draw FFT graph for peak frequency identification c# on: 3 Jan '13 - 18:37
I think the Reason why the Amplitudes are different is that the FFT Results depends on "where you start" in your Audio File, even if it exactly the same File and you start FFTing it some milliseconds later, the FFT Windows (Samples) start and stop at different waveforms so it will also generate different results !

The FFT Function looks at the SoundWaves and tries to find Frequencies in it, so it has for example "splitted" soundwaves where you cannot see the real shape of one sound wave (for example one 440hz wave ) it will generate different fft results.

Since the FFT Amplitude Differences are not that big you can try to compare the Results in these two ListBoxes, check how much Amplitude difference for example there is in average to find some Value how "good" the Match/Result of your Application is.


While thinking about that I was having another idea to try out:

* For example you have 5 seconds of the clip song
* You run through the original song in 5 seconds steps and at every step you compare the next 5 seconds Samples (PCM Float Samples) of the original song which the 5 seconds sample values of your splitted song.
* If the difference of the sound waves is very low then you just found the spot in your original song where the clipped sample was taken out from !

Check my attached Graphics to see what I mean (The Graphic of the idea i just described is not really true, its more than 1% difference for sure) !
ReplyReply Reply with quoteQuote
8  Developments / BASS / Re: Draw FFT graph for peak frequency identification c# on: 2 Jan '13 - 19:24
@Kachi: I mean that you could make an average amplitude of the whole song and then only pick blocks which are for having for example a 30% higher average amplitude than the total song, so it would pick loud (significant) blocks instead of just picking everything in a fixed interval. As a second requirement I was suggesting to check that the "louder than average" blocks need to be atleast some hundred milliseconds long.
ReplyReply Reply with quoteQuote
9  Developments / BASS / Re: advice: compare the tone on: 30 Dec '12 - 21:15
If youre going to use FFT Results to check if a Note is singed by a Singer you should taken in mind that there might be Harmonics occuring like most Music Instruments have them, their Frequency is multiples of the Notes Frequency.

So if you Play an A4 (440 Hz) on the Guitar for example and check the FFT Results, you sometimes get 440 Hz as the Peak Frequency and also get 440*2 Hz or 440*3 Hz too as a Peak Frequency. So I would be intersted if that occurs on Notes which are singed by Humans too. Take a look at that Chart to see a typical FFT Result of a Guitar Tone: http://cnx.org/content/m13514/latest/guitar_A_220hz.png

So maybe could you post some Spectrums of Singer Voices or an MP3 to let me check it ? Since Im not a (trained) Singer I cannot check for myself if there are harmonics too.

The attached File shows a Spectrum of me trying to sing some tones, it looks like there are Harmonics too (Look at the thick Horizontal Lines).

Some months ago I was about to make a "Singin Trainer", an Application where you select for example 1 Tone and sing it for some Seconds and it gives you Points and a Diagram to check if the Frequency is correct, if the Frequency is stable etc and train it to get better. I was also thinking of some special Features like a "Stair" where you have to change from Low Tones to High Tones and the Software shows you every step you made up or down in Frequency.
ReplyReply Reply with quoteQuote
10  Developments / BASS / Re: advice: compare the tone on: 28 Dec '12 - 23:07
Hello firemen,

by saying "sing in the tone" do you mean that you want to check if the Singer sings the same note (one note with one frequency) as it is on a recorded MP3 File ?
If yes then it would help me you show us two Recordings as examples, so the tone as it is recorded the tone as a singer could sing it.
ReplyReply Reply with quoteQuote
11  Developments / BASS / Re: want to display a waveform in Hi-resolution using BASS.Net.DLL on: 28 Dec '12 - 19:20
Hello, take a look at the WaveForm Class from Bass it can be used to draw WaveForms !

Edit: I made some nice WaveForm-Like Graphics, the green Graphic is like that: If the Amplitude is higher (its "louder") then the more green Color will be painted. The X-Axis is the Time Axis. I like that Graphic because it shows the Structure of a Song for example better and shows repeated patterns too. In my example the very green Parts are Drum Beats.

ReplyReply Reply with quoteQuote
12  Developments / BASS / Re: Draw FFT graph for peak frequency identification c# on: 28 Dec '12 - 11:20
Maybe it would be better for you purpose that you don't pick your blocks in fixed time frames like every 500 ms, you should make conditions like it needs to be at least 500ms long and it needs to have a higher Amplitude than usual (be loud), so you let your Program run through the Original Song and let it find "good" blocks.

So it would be like that:

* The Analyser runs through the Original Song and find Parts/Blocks which are for example atleast 500ms long and are at least having a higher than the average Amplitude. Lets say it finds 30 Blocks (Short Song).
* Then the Analyser runs through the Sample Song an finds lets say 2 of this 30 Blocks so it could be a match.

Which "finds" i mean having the same or similar Peak Frequencies with similar Amplitude.


Another thing to taken in mind: If 2 500ms blocks have both the Peak Frequency 100 Hz it could be the case that one is a really heavy drum with almost only 100 Hz and the other one is just a random noise which has 100 Hz a lot and the other Frequencies almost as much as the Peak Frequency ! So you should compare more than only the Peak Frequency. Take a look at my attached Graphic.
ReplyReply Reply with quoteQuote
13  Developments / BASS / Re: Draw FFT graph for peak frequency identification c# on: 26 Dec '12 - 17:31
First please make sure you FFT Results (The Floats) are shown like 0.0000123 not like 6.54E-05 if not then start with that first because its a lot easier to read/interpret that way.

Then you have to know that in each FFT Sample Array (For example 2048 Values) there is one Array Position which has the highest Value, that means one Frequency which with the highest Amplitude (Which was "found" to be the strongest in that Sample).

So you can just loop through the FFT Arrays and find the highest Value like the for loop in that Thread: http://www.un4seen.com/forum/?topic=8284.msg57255#msg57255
Once you have the Position of the Highest Value in yor Array you can calculate which Frequency it stands for and then this is your Peak in the Sample.

I used the C# Charts Control from Microsoft to draw my Graph which you see on the Screenshot.


Try to do it step by step and ask if you have Problems with any of the steps !
ReplyReply Reply with quoteQuote
14  Developments / BASS / Re: FFT values not within -1 to 1 range on: 26 Dec '12 - 17:20
@kachi: Yes exactly, what you think is just another represantion of float numbers like saga posted !
ReplyReply Reply with quoteQuote
15  Developments / BASS / Re: FFT values not within -1 to 1 range on: 25 Dec '12 - 11:50
Hello Kachi,

In a returned FFT Data Array, Index stands for Frequency (Lower FFT Lengths means its more like A Band than an actual Frequency) and Value stands for the corresponding Amplitude of that Frequency in the Sample you requested.
Amplitude ("Power") is usually somewere between 0 and 1.

The following code (untested!) which I already posted once can be used to get a FFT Sample and Interpret it (Which Frequency has wich Amplitude).

float[] temp_fft = new float[8192 / 2];
int ret = Bass.BASS_ChannelGetData(_playBackHandle, temp_fft, (int)(BASSData.BASS_DATA_FFT8192 | BASSData.BASS_DATA_FFT_REMOVEDC));
for (int a = 1; a < temp_fft.Length; a++)
{
float freq_now = (float)(index * sampleRate) / (temp_fft.Length * 2);
float amplitude_now = temp_fft[a];
}


So let's say your Audio File is 10 Seconds of 440 Hz Sine Tones then the Result of this Code should be that when freq_now is about 440 Hz you should have the highest amplitude_now Value there !
ReplyReply Reply with quoteQuote
16  Developments / BASS / Re: BASSMIDI - Playback using hardware or software-emulated synthesizer on: 25 Jun '12 - 23:08
@std66: There is the midi-dot-net Library for C# .NET which allows you to directly access MIDI Functions, you can for example simulate playing Notes on a Piano with a fixed BPM Speed, so you could build a "virtual Piano" easily. It also can play chords but I have tried Chords yet.

I think this would be the better choice for you than dealing with MIDI via Low Level Windows Functions.
ReplyReply Reply with quoteQuote
17  Developments / BASS / Re: RTP Multicast in C# on: 25 Jun '12 - 21:43
Don't use Bass.BASS_ChannelGetData in a loop, this will just cause 100 % CPU (1 Core on Multicore), make your Programs Thread Block, make it slow and waste CPU time.

Just imagine you have a leak in a Tank and to stop the leaking fluid you don't put a Bucket underneath it to catch the Drops, you currently try to move the Backet as fast as possible under the Leak to catch any fluid which flows out of it ...

You should use Callbacks instead of calling Bass.BASS_ChannelGetData in a loop, a Recording Callback for example gets called whenever new data "arrived" from the recording channel (Microphone Input for example). Take a look at the Docs to see how to use (Recording) Callbacks and post back if you have troubles applying it.
ReplyReply Reply with quoteQuote
18  Developments / BASS / Re: Fast file decode on: 25 Jun '12 - 21:37
@fmcoder: In theory the Disk should have about 40-60 MB/S (Normal SATA Disks) so it would be lees than 1 MB on the disk side in the File is getting read at once and then processed at once, the memory also should be very fast. Also in theory you have nowadays usually multicore systems so the CPU Utilization which is I guess is currently 1 core only could be some more cores - some more possible MP3 decoder performance.

Even Audacity takes about 3 Seconds do decode & display a 10 MB MP3 File, so even this already well developed tool needs some Seconds to draw the Waveforms.

If you are dealing with for example a not so frequently changing library or dealing with Files where you acces the Waveforms multiples times then I would also recommend like drugoimir suggested to decimate an cache the Waveform data so you don't have to go through the whole decode/calculate peaks/draw procedure every time.
ReplyReply Reply with quoteQuote
19  Developments / BASS / Re: ID3v2 new 'Subsong System' idea on: 25 Jun '12 - 15:01
I personally think its the best if each MP3 File is tagged with Informations like Song, Artist etc. and if the MP3 File is nonsplitted I think a CUE is enough and for including a cover, you can just put 1 jpg File in the same Folder which would be read as a Cover (coverart.jpg has to be the Filename I think) for that Album by most Media Players.

I think the "Industry" has already covered the Problems of defining Covers and for Dividing Nonstop/Nonsplitted MP3 into single Tracks/Artist Information etc. Also providing more Informations has been covered by providing Composer etc. in the ID3v2 Tags.

I might be wrong but I don't think there is a real need/interest of the feature/Idea you described.

However there are other Parts, for example Audio Feature Extraction, Analysis, Audio Comparisation etc. which has not been covered yet much and is very challenging too which could need some Attention and "Boost" by Programmers.
For example to find Ways to compare two Songs and define how "similar" they are close to how Humeans do - Speed (Beat/BPM Detection), Frequency Levels (How Much High&Low Parts), Dynamics (How fast/often the Volume Changes) and others.
ReplyReply Reply with quoteQuote
20  Developments / BASS / Re: Multiband compressor on: 25 Jun '12 - 14:44
What you are doing is getting FFT Spectral Analysis Data, I think you have to get PCM Samples instead and modify them to put them back into a stream later !
These PCM Samples are basically Points which "make" the Sound Waves.

The FFT Data is for Signal Analysis, shows you which Frequencies are contained.
ReplyReply Reply with quoteQuote
Pages: [1] 2 3 ... 8
Powered by SMF 1.1.18 | SMF © 2013, Simple Machines