
-----------------------------------
facultyofmusic
Tue Dec 23, 2008 1:51 pm

octive problems?
-----------------------------------
this is a program which i made for y isp for a musical keyboard.  I made one here with seven white keys.  when I press them, they'll give me the correct sound.  now i added two octive buttons (goes higher or lower key).  and what I expected it to do was when I press the key, the keyboard's notes go one octive higher.  however, after I press the octive button, i press the key, it will go up by one octive (nothing wrong there) but if i press one of the keys again ,it will go a higher octive, not staying in one octive.  So it goes up everytime i press a keyboard key.  how can i fix this?  do i have to put 3 if commands under every other if?
import GUI

var mainScreen : int := Window.Open ("position:65;50,graphics:900;600")
var octiveUp, octiveDown, exitButton, picID : int
var playTarget, addToPlayTarget1, addToPlayTarget2 : string
var blackKeyPlayButton : string
var octiveCh : string(1) := ""
var wTT : string



procedure rulers
    drawline (0, 580, 1000, 580, 1)
end rulers

proc title
    cls
    locate (1, 50)
    put "Wave Studio"
    put ""
end title

proc octive
    locate (3, 1)
    if GUI.GetEventWidgetID = octiveUp then
        put "octive up"
        octiveCh := ">"
        GUI.Enable (exitButton)
    else
        if GUI.GetEventWidgetID = octiveDown then
            put "Octive Down"
            octiveCh := ""
        GUI.Enable (exitButton)
    else
        if GUI.GetEventWidgetID = octiveDown then
            put "Octive Down"
            octiveCh := "