Jump to content
Welcome, Guest
Existing user? Sign In

Sign In



Sign Up
The MatriX
  • Welcome To Ghbsys
  • CS GO Streaming Version is released. Have fun streaming while cheating!
  • Have a Payment Issue? Send us a Support ticket.
  • Make a thread if you need support or join our discord for live support.
  • Have Suggestions? Make a thread and you'll earn Ghbsys Points for implemented suggestions.
  • Join our discord to stay well connected! Don't forget to integrate your discord to the site
  • Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum

    Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of [GHB] - GAmEhAcKbAsTaRdS Forum by signing in or creating an account.
    • Start new topics and reply to others
    • Subscribe to topics and forums to get email updates
    • Get your own profile page and make new friends
    • Send personal messages to other members.

    [Tutorial C++] Simple Bass Test


    VentralieX
     Share

    Recommended Posts

    Szenario:

    You got some new speakers and you want to test the different bass frequenzies.
    Sure you can find some bass tests on Youtube, but it makes even more fun if you can code one yourself.

     

    First we include some things.
    I already commented them so I don't think that I have to say for what they are.

    #include <iostream> //For the input and output of text
    #include <Windows.h> //We neeed this to use the Windows-Functions
    

    Then we use the namespace std.

    I use this so that I dont have to write always a std:: before the cout's.

    using namespace std;
    

    Then we begin with the coding.

    int main(void)
    {
    	cout << "##################################" << endl;
    	cout << "######## BASS TEST LOADING #######" << endl;
    	cout << "##################################" << endl;
    	for (int i = 5; i >= 1; i--) //Countdown from 5 to 1
    	{
    		cout << i << endl;
    		Sleep(1000); //Waits 1 second before the program continues
    	}
    

    Now our console is full of numbers from the countdown. But we want to have a clear console.

    So we use a function of Windows.h :

    system("cls"); //This clears the console
    

    Now to the main part of the bass test.

    for(int i = 150; i >=10; i = i - 10) //Counts down from 150 to 10 and always makes -10 steps. So: 150, 140, 130,...
    	{
    		cout << "bass frequenzy: " << i << " Hz"; //Gives out the current frequenzy
    		Beep(i, 5000); //This makes the sound. The first value is the frequenzy we want to use. In our case this is the value of the for-loop. And the second value is how long the frequenzy should play. In our case this is 5 seconds.
    		system("cls"); //After every run of the loop we want to clear the console again
    	}
    
    	cin.get(); //After the test is finished we wait until the user press ENTER
    	return 0;
    }
    

    Thats it. If you have any questions, feel free to ask :)

    Link to comment
    Share on other sites

    Thank you for that gonna try that out soon cause I get new speakers bananalove.gif

    Link to comment
    Share on other sites

    Thank you very much for your feedback :)

    Link to comment
    Share on other sites

    Very cool dude, I just got a new set of speakers and a bass speaker package. I will try this out!

    Link to comment
    Share on other sites

    Very cool dude, I just got a new set of speakers and a bass speaker package. I will try this out!

     

    Let me know about the outcome ;)

    Link to comment
    Share on other sites

    Guest
    This topic is now closed to further replies.
     Share

    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...