News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

tiny mci multimedia player

Started by avcaballero, July 28, 2014, 06:25:24 AM

Previous topic - Next topic

Gunther

Dave,

Quote from: dedndave on August 21, 2014, 02:02:37 AM
probably, 20 to 20,000 is more common - i'll let you do the math   :P

why not using Abacus 2.0? Are you to lazy?  :lol: :lol: :lol:

Gunther
You have to know the facts before you can distort them.

dedndave

intrinsics are very time-consuming on an abacus - lol

Gunther

Quote from: dedndave on August 21, 2014, 05:16:29 AM
intrinsics are very time-consuming on an abacus - lol

That's interesting. I didn't know that. So; I've to update my model.

Gunther
You have to know the facts before you can distort them.

avcaballero

Hello, here's my source code. I didn't achieve get the spectrum analyzer work yet.

What i have tried is the next:

* Line 225. [call      WaveIn_Inicio]
Open de waveIn device to retrieve wave data from whatever the kind of music that mci were playing

* Line 300. [CreateThread RecogeWaveData]
In the TrimSpectrum timer we execute the recovering wave data that has the next subroutines:
  - WaveIn_Rellena. Retrieves wave data from the device opened. This is the heart of the though, but is too slow and no effective. Commented, but it is needed to get it working.
  - doFFT2. What the name says, second version.
  - clcLongBarrasEspectro. Calculates the length of the spectrum analyzer. This data will go to the vbEspectro array. Ten fields of byte values (16 maximum).
 
I have no much time to work on it, so any help would be nice :). I think that i'm near, but the waveIn device seems to be too slow, there must be another way or something to makes it work.

Regards

Gunther

You have to know the facts before you can distort them.

avcaballero

I have fixed a couple of things, now i don't allow start filling the wavein buffer before it has been filled plenty before. The motion of the spectrum analyzer bars are due now to the wave in device. Surely they needed to apply some reduction factor, i don't worry about that. The main problem is that the wavein buffer is filled up very slowly. I can't believe it, there must be anything wrong.

In the other hand, i believe that there's a rawdata label for mci command. Other land to explore...

Regards

guga

Hi Alfonso,

take a look at the source code of the directX of UFMod here: http://ufmod.sourceforge.net

It don´t seems to be that hard to port and it works as expected. Maybe it can help you fix on your own Bars (The example on dx uses only 2 channles of audio, but the filling of the bitmaps for them are simply gdi usage).

The functions that you may use are:
FillVUBars
RedrawVU
RedrawTimeP

All inside play_ds.c
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

avcaballero

Thank you, guga, i'll have a look, though i first wanted to make mci working, ufmod surely read directly from file, and i don't know yet if mci offers that lovely feature  ::) . When i have finished what i want to do/learn with mci i will start with directx/maybe external dlls like ufmod or others.

Regards.

guga

I`m currently also working on UFMod. Although it can be assembled in Masm as it is, the library is deeply confused. But, it works for mci as well (not only dx or openAI). It was biased on FMod, but the russian author is really insane :icon_mrgreen: :icon_mrgreen:

I´m trying to port it as a dll (or as a library, if i suceed to convert to RosAsm and later convert it to masm with JJ tool RosAsm2Masm) and fixing whatever i can be able to understand from that. But, if you plan to rewrite the asm version of UfMod, get ready, because  it is a pain to do.
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

avcaballero

Quote from: guga on August 25, 2014, 10:29:05 PM
if you plan to rewrite the asm version of UfMod, get ready, because  it is a pain to do.
Yes, I'm afraid so :biggrin:, i'll settle with a few things

avcaballero

Hello there, i noticed yesterday that the process of my program wasted many resources... hmmm a bit strange. What i want so many data for at the same time? Now, spectrum analyzer works fluently using wavein device inside some logical values. Nevertheless the bars motion appears to be a bit chaotic yet, i think that i have to calibrate the fft function. We will see...

Regards

guga

Great work.

But, the spectrum analyser is static here in WinXp. I mean, the bars shows up, but don´t move
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

avcaballero

 :biggrin: that's another history. You have to set the wave in device activated, as you want to talk to microphone. Ie, it is a little fudge for not to have reading directly from the audio file. Maybe would be possible to do a bypass directly to the WaveIn device, but I haven't got such high expectations, for the moment I settle for get it working.

Gunther

Well done, Alfonso.  :t

Gunther
You have to know the facts before you can distort them.

Siekmanski

It took me a bit longer to write, sorry Alfonso.
But i have rewritten everything to make things more flexible.
Also included a fresh written routine to calculate the FIR coefficients for low pass, high pass, band pass and band reject filters with a Hamming window.
Very handy timing routines and fast sample type conversion routines.
I'll comment and explain as much as possible and rename labels and text from Dutch to English.  :biggrin:
When i'm ready i will post all the source code and maybe open a new thread to explain some stuff if you guys are interested.
I know that there are other ways to do spectrum analyzers but you can do a lot of nice things with FIR filters.

Here is the exe with a 1 octave 10 band analyzer and 2 short wav samples.
Just load your favorite wav file and enjoy watching the music.  :eusa_dance:
There is maybe 1 thing of which i'm not certain, that is the Direct3d9 code.
I've kept it very minimal so i hope it works on other PC as well.
You will need at least a PC with SSE2 ( didn't include a test.... )

Creative coders use backward thinking techniques as a strategy.