Shop OBEX P1 Docs P2 Docs Learn Events
Trumpet Program Freqout Help! — Parallax Forums

Trumpet Program Freqout Help!

Euphonium 1Euphonium 1 Posts: 1
edited 2005-05-16 15:42 in BASIC Stamp
Hi!·I am trying to make a trumpet-simulator and I am having a problem.· I am using many loops with Freqout and my problem is with the Period.· I want to keep a sustained note until I change the fingering of my buttons.· I have tried using Do Until loops and they work exactly how I want them to.· My problem is that I can hear every single time that the loop repeats itself with an interruption in the tone because I have to set a number value in the Period.· The only way I can keep a sustained note is by changing the Period to very very small (like 5 milliseconds); my problem here is that the small gap of interuption mixes with my Frequency and changes the sounding frequency to a much lower pitch.· The only solution I know is finding the mixed frequency and trying to set that to be the sounding frequency; my problem here is that I don't know how high the frequency is that is caused by the interruption.· I have everything else in the program working just perfectly.· Please help me ASAP (this project is due very soon).···tongue.gif· Thanks!· Attached is my program (I can't really explain what's what though!)

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-05-16 02:18
    Sadly, you may not get better than you have -- it's just the nature of FREQOUT in that it's designed to play frequency (or two) for a specified period. I once tried to make a light-controlled Theremin but was never happy with the breaks in the sound. I wish there was a different answer, but short of synthesizing the frequencies yourself (by toggling a pin a some rate), I can't thing of a way to get a smooth transition between notes.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • prprogprprog Posts: 18
    edited 2005-05-16 15:28
    Euphonium1

    Ideas:

    Can you set the previous played note to 0 (duration/period) before playing the next one? (Like a MIDI message)

    Can you make a loop to "count" the· Period and then set it on the FREQOUT command? (it will count the time the valves·(buttons) are press --> then set Period value for that time) Yes this might generate some delay on the simulation.

    PRPROG
  • prprogprprog Posts: 18
    edited 2005-05-16 15:42
    Euphonium1

    Another idea:

    Set the value of Period to its longest value ---> kept track of the valve combination and var_button(partial)--> if the combination change ---> do a sound_off ---> set new frequout value.
Sign In or Register to comment.