Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Output specific frequencies with digital electronics

  1. Apr 12, 2010 #1
    I'm trying to figure out how to build a breadboard instrument using either push buttons or logic switches as they keys that will play each note. The issue that i am having is that I don't think finding all of the perfect resistor and capacitor combinations for each note is a good idea. So, i want to use digital hardware to produce the frequencies. Any ideas how?
     
  2. jcsd
  3. Apr 12, 2010 #2
    What specific musical scale are you interested in? See

    http://www.phy.mtu.edu/~suits/Physicsofmusic.html

    Some scales are easier than others to generate from a single high-harmonic crystal oscillator. Are you concerned about the phase of the harmonics?

    Bob S
     
  4. Apr 12, 2010 #3
    The simplest method is to use a microcontoller and program it with every note.

    Another way is to start with a high frequency stable oscillator, and then have a switched frequency dividers to generate various notes.
     
  5. Apr 12, 2010 #4
    Bob S.-

    I was looking to just do The basic notes A,B,C,D,E,F,and G maybe with sharps and flats if the design is simple or small enough.
    I'm not sure if i should be concerns about the phase of the sound. Can you elaborate on why i would need to?

    waht-

    I wanted to avoid using a micro controller to program the frequencies.

    I was looking at using the divider setup that you mentioned. i am just not sure on how to do so. Looking at the frequencies of musical notes i've noticed that i can produce different octaves of the notes by dividing but not different notes. I'm not positive on this but pretty sure. So what i am seeing is that i would need to use several combinations of resistors and capacitors to produce a divideable frequency to further produce different octaves of that frequency.

    Is that a practical way of approaching this?
     
  6. Apr 12, 2010 #5
    What do chords sound like if you don't control the phase of all the harmonics, or are you planning on playing only one note at a time?
    By the way, what musical scale are you planning on using?

    Bob S
     
  7. Apr 22, 2010 #6
    I only plan on playing one note at a time. Also, I was looking at the blues scale (no reason in particular).
    This is the blues scale given on the website:

    Note
    of Blues Scale Ratio
    1 1
    2 6/5
    3 4/3
    4 45/32
    5 3/2
    6 9/5
    7 2

    I'm looking to use one main frequency and divide it into the rest. Everything in the circuit is pretty much set. The only part I can't figure out is how to divide the main frequency accordingly. For example, there is no way of dividing a frequency by five and then multiplying it by 6 (as far as I know). I was thinking there may be some way of doing some math and getting all the fractions listed above into a form with 1 as the numerator. That way i would be able to divide by one number to get a good frequency. (thinking about it now that doesn't seem like it'll work but still, food for thought.)

    This is frustrating me to no end so any help is greatly appreciated and I'll post the final circuit if anyone can give me some assistance.
     
  8. Apr 22, 2010 #7

    berkeman

    User Avatar

    Staff: Mentor

  9. Apr 22, 2010 #8

    MATLABdude

    User Avatar
    Science Advisor

    Apologies if I'm being patronizing, as I do not know your level of background / knowledge.

    What you *could* do is to control a Digital-to-Analog Converter (DAC) and synthesize an arbitrary waveform that you then feed to an amplifier. This is (basically) the same way your PC / laptop or MP3 player generates not only 'pure tones' but also play the whole gamut of music and sounds that we play through them these days:
    http://en.wikipedia.org/wiki/Digital-to-analog_converter

    However, since you're more interested in playing individual notes, you may be interested in waveform generator ICs, or better yet, sinewave generators (these would produce 'pure' tones probably quite similar to what you hear from most tuners). For instance, the Fairchild ML2035 is SPI-settable: you simply tell it which frequency to produce, and it outputs that frequency!
    http://media.digikey.com/pdf/Data Sheets/Fairchild PDFs/ML2035.pdf

    ...Unfortunately, they don't seem to make it anymore, and none of the major players seem to have it in stock (as seen at www.findchips.com) Maxim doesn't make/sell the MAX038 family anymore either, which was a far more robust IC. You may be able to find one of these if you look hard enough (or Digikey or Mouser may actually be able to quote you for some of these) Not sure if this shows the ascendancy of DACs or what, but they seem to be a dying breed these days!

    About the only one of these I CAN find is the Exar ICL8038, from one vendor (though I didn't look terribly hard):
    http://www.jdr.com/interact/item.asp?itemno=ICL8038CCPD [Broken]

    Good luck!

    EDIT: This page also summarizes the three ICs I mentioned:
    http://www.siliconfareast.com/waveform-gen.htm
     
    Last edited by a moderator: May 4, 2017
  10. Apr 23, 2010 #9
    I'm trying to avoid using micro-controllers to just give me what I want. I guess I want to do it the old fashioned way. .

    I'm not sure how I would control a DAC to "synthesize a waveform" like you say.

    Basically what I plan on doing is getting a main frequency (some sort of oscillator), then dividing it into the 7 frequencies of a blues scale, then i will input those signals into a multiplexer which is controlled by logic switches to give a "Breadboard instrument" of sorts.

    The issue that i am having is that i am not sure how to divide the main frequency into the required frequencies. I don't necessarily mean "required". What i want is the relationship between the frequencies. The relationship is in one of my earlier posts (blues scale).

    I don't need to have just one main frequency, but i didn't want to settle with making multiple oscillators with the set components that i have. With a setup like this i would get multiple outputs that don't relate as well as i would like and that would take up way more space than i would like (with more problems to add to that).

    I hope this explanation is more. . . explanitive? Thanks for all the help I've been receiving (especially the google search hehe). More is still needed. Also, try to excuse my grammar, I have ten million things to do and can't think very straight at the moment.
     
  11. Apr 23, 2010 #10

    berkeman

    User Avatar

    Staff: Mentor

    Did you even read my link? I'm thinking not....

    EDIT -- we tend to frown on new posters here who aren't willing to do most of the work on their questions themselves...
     
  12. Apr 23, 2010 #11
    -Berkeman

    I did read your link, it directed me to a list of micro-controller links that previously stated i was avoiding.

    I did not mean to be so condescending in my reply, but I use google as well. It is not always a good source of information. Which is why I came here and have been coming here for some time.

    My problem will be solved one way or another. I am not using this forum to get the work done for me, just assistance to an issue I am facing. Please redirect your patronization for myself somewhere else, as i believe it is not tolerated.

    ---

    Now, relating to my problem.

    I have decided to use a 555 timer for my main frequency, because every other oscillator i have used has been very unreliable (or i have been too sleepy while working). I have a set frequency that i developed from the scale i posted earlier. I am about to start experimenting with counters to try to divide the signal's frequency to the appropriate amount. Unfortunately, i only have access to divide-by-2 +divide-by-8 counters, and the frequencies I need to divide into to won't do this so well. If i can't determine any other solution I may end up getting some weird values, which may not sound so well in the end.
     
  13. Apr 23, 2010 #12

    berkeman

    User Avatar

    Staff: Mentor

    The links in the hit list that I skimmed appeared to be frequency synthesizer ICs that could be used stand-alone OR with a uC as the master. I understood that one of your requests was that no uC would be involved, so I was surprised that you didn't mention something about the synthesizers in the link.

    Are you familiar with how frequency synthesizers work? They can give you all kinds of strange effective divide ratios. It does seem like it would be easiest for you to use an audio frequency synthesizer IC at the core of your circuit, and figure out what you want to put around it to select the multiply/divide numbers.

    Are you up for using a PAL or some other logic to control the IC?
     
  14. Apr 24, 2010 #13
    -I feel like what I am am doing is creating a frequency synthesizer in the first place. Maybe with just more specific frequencies? I'm not too familiar with how frequency synthesizers work.

    - PLL? and I have no problem changing the circuit up at all. What did you have in mind?
     
  15. Apr 24, 2010 #14

    MATLABdude

    User Avatar
    Science Advisor

    If you look at the Wikipedia link on Digital-to-Analog Converters I gave, you'll see two waveforms about a quarter of the way down (beside the basic ideal operation and practical operation sections). If you wanted to output a sine wave, you'd need to tell the DAC to output, say, 0V at one particular moment, and then a few microseconds later, tell it to output 0.1V.

    The key idea is that the DAC will output whatever voltage value you tell it to. You need to update the value the DAC outputs every few milliseconds so that you get something that looks like a sinusoid on the oscilloscope. Usually it isn't perfect, but it'll often be good enough (you just need to choose the right DAC for your particular application!)

    That said, it sounds like you just want something that connects a particular biasing network to a 555 whenever one button is pressed. That's easy enough to do with some SPST or DPST buttons, and a handful of capacitors / resistors.

    EDIT: The description of the DAC above is in contrast to the frequency synthesizer that Berkeman (and to a lesser extent, myself) have been telling you about. Instead of continuously telling the DAC what voltage value it should be outputting at any particular moment, you just tell the frequency synthesizer, "Make me a sinusoid of this frequency! Engage!"
     
  16. Apr 26, 2010 #15

    berkeman

    User Avatar

    Staff: Mentor

    A frequency synthesizer uses a VCO as part of the PLL building block, along with a programmable divider in the feedback comparison path. That is how you are able to synthesize different frequencies of various multiply & divide ratios:

    http://en.wikipedia.org/wiki/Frequency_synthesizer

     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook