locked
Play musical chords (using Console.Beep)

    Question

  • This post is much more to-the-point than the one I was typing when I accidentally clicked on an index entry and lost my post (I'm typing this on Document Explorer).  Which, quite frankly, means a easier read for you.

     

    I'm trying to make a library that allows console applications to play music via the Console.Beep method.  Chords are stored as arrays of notes.  When a chord is played, it scrolls through the chord, playing each note for 1ms, and repeating the sequence multiple times until the desired total duration is reached.

     

    I had figured this would play the notes so quickly that it would sound like a chord.  But the notes do not sound in unison.  Is there any way I can get Console.Beep to play anything that sounds more like a chord?

    Saturday, January 12, 2008 11:04 PM

Answers

  • Console.Beep uses a single voice.  There is no way you can get it to play a chord.

     

    Note:  The original IBM (and clones) motherboards always used a single voice.  Back in the 80's, you would have to use a hobby computer such as the Commodore 64 (3 voices) or an Atari (4 voices) in order to simulate a chord.  I think the PC jr. may have had more than one voice.  But the IBM was considered a business computer and not used for making music. 

     

     

    Sunday, January 13, 2008 2:05 AM

All replies

  • Console.Beep uses a single voice.  There is no way you can get it to play a chord.

     

    Note:  The original IBM (and clones) motherboards always used a single voice.  Back in the 80's, you would have to use a hobby computer such as the Commodore 64 (3 voices) or an Atari (4 voices) in order to simulate a chord.  I think the PC jr. may have had more than one voice.  But the IBM was considered a business computer and not used for making music. 

     

     

    Sunday, January 13, 2008 2:05 AM
  •  

    What I'm hoping for is at least something that sounds like a chord, even if it isn't.  Maybe it doesn't have to be Console.Beep to work in my program, but it has to be simple.  I'm hoping there is a way to alternate between two or more pitches at a fast enough rate that they sound to the human ear like they are being played at the same time.  I've seen other programs do this before.
    Sunday, January 13, 2008 2:49 AM
  • try messing around with this

    http://www.portal42.net/mario.txt

    make sure to add

    using System.threading;

     

    enjoy

     

    EDIT:

    Console.Beep(5000, 7000)

    //Console.Beep(5 kiloherts, 7seconds);

    just to show you how it works

    the first number being the pitch which is what you will have to mess around with until you get it right and the second number is how long you want the note to hold

    • Edited by LittleBlue Wednesday, November 17, 2010 6:02 PM More in depth
    Wednesday, November 17, 2010 4:27 PM
  • console.beep has major latency issues, if I didnt, you would be able to modulate the single frequency, in other words, instead of playing 1 pure frequency for 1 second strait, you would play 1000 different frequencies that were a millisecond each across a 1 second time span, and the dominant sound would still be your original frequency, but you would get the effect of timbre(like you could make it sound like a guitar, or a trombone, etc...) you could modulate with as many overtones and undertones as you want.
    If you want something you've never had, you need to do something you've never done.
    Wednesday, June 22, 2011 4:44 AM
    Moderator
  • Can I use Console.Beep for simule human sounds (voice) ? For example, using Beep for simule the sound of word "Error" ? any sample about it ?


    Tuesday, January 22, 2013 1:30 PM