I want to control the volume of the output using Sound command.


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Nov 2013
    Posts
    17

    Default I want to control the volume of the output using Sound command.

    I am going to use SOUND command to produce a white noise.

    Is there any way to control from the program the volume of the output ?

    I want to take a result with max volume and then the volume will decrease to minimum. Something like this |\ |\ |\.

    The noise of a steam train engine.

    It is here, http://usuaris.tinet.cat/fmco/download/TuShuuu10.asm but i don't know assembly, and here http://usuaris.tinet.cat/fmco/dccfunc_en.html Tushuuu project.

    Thank you!

  2. #2
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: I want to control the volume of the output using Sound command.

    What specifically are you trying to do? Change the volume in a pattern, or just make it louder / softer?
    If it's the latter, changing the final 358 stage to include a variable resistor would be simplest.

  3. #3
    Join Date
    Nov 2013
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Re: I want to control the volume of the output using Sound command.

    I want to make the sound of chuff-chuff.

  4. #4
    Join Date
    Nov 2013
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Re: I want to control the volume of the output using Sound command.

    My issue is that i don't know how to create white noise, without using the SOUND command.
    If i knew, it would be easier to me, to make the pattern of the sound i want.

    The other choice is to to connect the output of the sound to a transistor and with an interrupt and PWM output to the base of the transistor.

  5. #5
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: I want to control the volume of the output using Sound command.

    To me, white noise is a random frequency in the audible range. Using the SOUND command gives you a specific frequency. Packing together commands to give you a randomish frequency won't be what I think of as white noise.

    To make a specific sound, as the whistle on a train, or music, the chuff-chuff sound, will require you to know the frequency or key of the sound and use the sound command to approximate it.

    From experience I've found feeding the output from a 12F683 into a speaker doesn't generate a very "loud" sound. You'll have to amplify it somehow and I don't know why you couldn't use a pin off the the chip to control the volume of the sound. I'm sure someone will shoot a hole in that theory but why not?

    I'm thinking if you're going to go through that trouble why don't you get an actual recording of the train whistle or horn signals and put them on a SD card and just have it play into the amplifier? Might be easier and sound better than trying to approximate locomotive horn signals with a PIC.

    My nickels worth.

  6. #6
    Join Date
    Nov 2013
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Re: I want to control the volume of the output using Sound command.

    Actually, If i knew the frequency of sound command 255, which is a white noise, it would be easy for me to edit it.
    Paco here http://usuaris.tinet.cat/fmco/dccfunc_en.html has made it with Tushuuu and assembly.

    He uses TMR2 as PWM generator for sound, Vref module for volume control, TMR1 for Envelope timing, TMR0 for software noise generator, internal comparator for mixing sound and noise.
    RB0 is DCC input, RB3 (PWM) conected to RA1 (comparator), RA2 outputs to a buffer OPAMP, RA4 to OPAMP output throught a resistor and to another OPAMP buffer for output to a buzzer.

    The size of the circuit is the reason that i need software edit of the sound. The circuit must be very small.

Similar Threads

  1. pt2258+16f877 how can i use for 5.1 volume control ?
    By whyliving in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 26th January 2008, 17:51
  2. Volume Control On Piezo
    By Peter1960 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th August 2007, 04:34
  3. sound command
    By micro in forum General
    Replies: 0
    Last Post: - 1st April 2006, 18:09
  4. Volume Control IC's
    By HarryK in forum General
    Replies: 0
    Last Post: - 8th March 2005, 08:46
  5. Sound and sound control with minimal parts
    By bartman in forum General
    Replies: 23
    Last Post: - 18th January 2005, 14:08

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts