flat assembler
Message board for the users of flat assembler.
Index
> Main > How to implement Qbasic's Sound and Play Statement? |
Author |
|
LiuJunfeng 11 Mar 2004, 15:50
How to implement Qbasic's Sound and Play Statement which can let the PC speaker sound some music?
|
|||
11 Mar 2004, 15:50 |
|
Cas 05 Apr 2004, 05:24
I remember there was a port.... forty-something hex, which controled the frequency of the speaker, then another one lets you enable or disable it... but it's been a long time that I don't check that.
Anyway, when you want to develop a PLAY routine, you must do something more complex: remember that musical notes do NOT grow lineally with frequency. Suppose note 0 is LA440, then: frequency = 440*(root(12;2)^note) That is, if the frequency of a note is F and you want to get the frequency of a note which is one semitone higher, you must multiply F by the twelveth root of two. The same way, to get the frequency of that note, but in the next octavia, you simply multiply F by 2. Hope this is useful to you. |
|||
05 Apr 2004, 05:24 |
|
LiuJunfeng 05 Apr 2004, 13:01
Thank you! I know this, what you said is Equal Temperament, there are already many programs.
But I would prefer Just Scale(harmonic tuning), that's why I want to do it by myself. see more info at : http://www.phy.mtu.edu/~suits/scales.html |
|||
05 Apr 2004, 13:01 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.