Introduction
This program was created in order to substitute laboratory frequency generator. It shows how to use API function - WavOut for playing sound with different frequencies in the range 1 Hz...20000 Hz (not all sound cards support so high frequencies), different amplitudes and phase shifts. The program is created in C++ Builder 5 platform. In future, I am planning to add complex signal generation supporting, amplitude, frequency and phase modulation. All new versions with source code will be available here. In this program, you also can find an example on how to extract the icon with different sizes from an exe or DLL file (ExtractIconEx function). With any remarks or wishes, you can write me to member@one.lv.

And this is a new version with channels division support:

| You must Sign In to use this message board. |
|
| | Msgs 1 to 9 of 9 (Total in Forum: 9) (Refresh) | FirstPrevNext |
|
 |
|
|
 |
|
 |
the project is very much fascinated, but i had not get all the files in source code of project.. ie vlc.h.. i search it on web but got different coding for the same file i.e. vlc.h so would you please attach it ...
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
i compile the source code on C++ Builder 2007 Lite and i get the error :"Project Project1.exe raised exception class EAccessViolation with message 'Access Violation at address 0040227 in module 'Project1.exe'.Write of address 00000001'." i have not done any changes to the code. i am planning to add sweep feature to the program. my computer runs on MS windows vista home premium sp1 english. debugger marks the line: buf[cnt]=(unsigned char)(cos(phase+cnt*x)*amp+127); after the error. this line is from FillBuf function on Generator.cpp
what do you think is causing the error and do you have any suggestions about handling or preventing it.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
i solved access violation error on FillBuf function by declaring the function as __fastcall instead of inline, but then there are four errors of the same type on four lines where buf is present on the function MRepaint:
void TMForm::MRepaint() { FImage->Canvas->FillRect(FImage->Canvas->ClipRect); FImage->Canvas->MoveTo(0,buf[0]/2); FImage->Canvas->Pen->Color=clBlue; for(int cnt=0;cnt<width;cnt++)> FImage->Canvas->LineTo(cnt,buf[cnt*2]/2); FImage->Canvas->MoveTo(0,buf[1]/2); FImage->Canvas->Pen->Color=clRed; for(int cnt=0;cnt<width;cnt++)> FImage->Canvas->LineTo(cnt,buf[cnt*2+1]/2); }
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
When I change the frequency, I hear 'clicks' between frequencies (only happens while changing frequency). Crossfading between the old and new frequency would make the clicks go away. Do you have any code for crossfading, or know where to get information about how to do it? I guess one could just slow down the transition to the new frequency by going up/down in steps rather than all at once. Any other ideas? I made a program that has the same problem (clicks) and would like to fix it. Thanks!
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
 |
It's nice to see a CBuilder project on Code Project. Personnaly I appreciate both CBuilder and Visual C++ as compilers but the best C++ website is this one
Yarp http://www.senosoft.com/
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I like the idea about that, you've done a great work. Here are some proposition for the next version : - other waveforms (let's say triangle, rectange, ...) - maybe you could remove the phase, it makes no difference for human ears. - support a mixture of different frequencies/waveforms
Greets, Alex
Don't try it, just do it! 
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Alexander M. wrote: - maybe you could remove the phase, it makes no difference for human ears.
It makes a difference depending on the students using the lab. For instance, high school physics includes interference of waves, in particular sound waves. It's a pretty cool experience to setup two speakers and play two phased signals on each. You can walk around and hear how the signal gets louder and weaker in the field of interference.
What would be very interesting, IMO, would be to generate different waves on different channels.
-- Din mamma.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Ok. In the character of next step i plane supply this program with triangle & rectangle waveforms support, and channels division. But later. Now i must to set to my bachelor work.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
General
News
Question
Answer
Joke
Rant
Admin