• Register
  • Help
Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Topic: Is there a bug in the KSP?

Share/Bookmark
  1. #1
    Senior Member Big Bob's Avatar
    Join Date
    Jun 2005
    Location
    Apple Valley, California
    Posts
    323

    Exclamation Is there a bug in the KSP?

    Try the following experiment. Load some instrument with sustained tones, like an organ. Clear any existing Script and then enter this simple 3-line script:

    on note
    play_note ($EVENT_NOTE - 12,$EVENT_VELOCITY,0.-1)
    end on

    Click 'Apply' and try it.
    This simple script simply doubles any key you hit with the same pitch an octave lower. The created octave should last until you release the key that caused it.

    Now, here's the problem. Take a finger and sweep it back and forth across your keyboard, playing rapid glissandos. After a few swipes, notes will begin to get stuck on.
    This of course shouldn't happen.

    I think we've got trouble right here in River City!
    Big Bob (aka Wonderful Bob)

  2. #2

    Re: Is there a bug in the KSP?

    Hi Big Bob,

    Quote Originally Posted by Big Bob
    Try the following experiment. Load some instrument with sustained tones, like an organ. Clear any existing Script and then enter this simple 3-line script:

    on note
    play_note ($EVENT_NOTE,$EVENT_VELOCITY,0.-1)
    end on

    Click 'Apply' and try it.
    This simple script simply doubles any key you hit with the same pitch an octave lower. The created octave should last until you release the key that caused it.

    Now, here's the problem. Take a finger and sweep it back and forth across your keyboard, playing rapid glissandos. After a few swipes, notes will begin to get stuck on.
    This of course shouldn't happen.

    I think we've got trouble right here in River City!
    I tried this just like you said and not only didn't I experience any stuck notes, I also didn't get any octave notes.

    What I did find is that the scpript editer (almost anything to do with text in Kontact) is extremely "buggy". I think that's probably another topic in itself.

    Is the syntext (or what ever you call it) you have here exactly right?

    T. S.

  3. #3
    Senior Member Big Bob's Avatar
    Join Date
    Jun 2005
    Location
    Apple Valley, California
    Posts
    323

    Re: Is there a bug in the KSP?

    Whoops!, I see that I left out the -12. The first parameter of the play_note function should be $EVENT_NOTE - 12. Sorry, let me try to fix this but it's probably too late to edit the original post.

    Nope, it wasn't too late, I just corrected it. Sorry for the mistake. Try it now.
    Big Bob (aka Wonderful Bob)

  4. #4

    Re: Is there a bug in the KSP?

    Got it Big Bob,

    The octaves worked great but I didn't experience and stuck notes. I'm useing the stand alone version of Kontact. I ran my fingers up and down the keyboard many times and no stuck notes.

    T. S.

  5. #5
    Senior Member Big Bob's Avatar
    Join Date
    Jun 2005
    Location
    Apple Valley, California
    Posts
    323

    Re: Is there a bug in the KSP?

    Maybe my 'finger' is faster than yours ? I too was running in standalone mode. To exonerate my keyboard, I concocted a sequence running up and down the C major scale at a pretty good clip. As long as the duration of the notes are shorter than the separation between notes, the problem doesn't seem to occur. But, as soon as the notes overlap by 25% or so, the problem occurs within a half-dozen or so glissandos. Furthermore, if I 'Bypass' the script and then run the same sequence or use my magic sliding finger, I can't produce the problem. For my money, this pretty well points the finger at the KSP.

    If no one else can produce this problem, then maybe it's some horrible thing like the KSP doesn't like running properly on my hardware! If anyone else can reproduce this problem, please let me know. Thanks.
    Big Bob (aka Wonderful Bob)

  6. #6

    Re: Is there a bug in the KSP?

    OK Big Bob,

    I did manage to get notes to stick 'Sounding on" twice. This was after many many tests with different organs. However, most of the time even though the notes weren't sounding, the keyboard at the bottom of Kompact indicted that several notes were stuck on (the keys indicated as being depressed).

    I did all this by basicaly laying my left hand and my right arm (up to my elbow ) down on the keybord and slowly then quickly moveing them up and down.

    I then thought all this might be a polyphony problem so I set the #Voices to 120 and sure enough, the keys at the bottom them selves didn't stick any more.

    Like I said I could only get notes to actualy stick on (sounding) twice and no matter what I did (set the voices to 16, etc.) I couldn't get it to happen again.

    Exactly which instrument are you useing when this happens? Check the polyphony thing and see if that makes any difference.

  7. #7
    Senior Member Big Bob's Avatar
    Join Date
    Jun 2005
    Location
    Apple Valley, California
    Posts
    323

    Post Re: Is there a bug in the KSP?

    Hey T.S. thanks so much for your persistence. For you, and for the benefit of anyone else who is willing to help out here, let me elaborate a little to clarify things.

    This problem is statistical in nature, probably due to some kind of 'race' condition between 'parallel' processes. Because it's statistical, it can be stubornly absent sometimes and annoyingly persistent at others. As the script gets more complex, the frequency of occcurence of this problem seems to rise. But also, when a script gets complex, the probability of an undiscovered bug in the script itself also looms large.

    So, I attempted to reduce the problem to its essence with a script so simple that it itself can be eliminated from contention. Unfortunately, this simple script doesn't have as high a probability of producing the problem and sometimes you really have to work your 'sliding finger' to death trying to make it happen. However, it's not a polyphony problem because I can produce the problem without ever sounding more than a few notes simultaneously. As I indicated earlier, I have a simple MIDI sequence which will trigger the problem (if you run it long enough) and it never sounds more than two notes at once.

    If your hardware configuration is such that you can run K2 in standalone mode and still drive it from your sequencer (via MIDI, out and back into your computer for example), I can attach a standard MIDI file that you can try. It's important to run K2 in standalone mode because there are just too many other potentially clouding issues when using K2 as a plugin. With K2 as a plugin we have to deal with interactions between K2 and the host sequencer (and just a casual glance at the forums will reveal how many subtle issues come up that way).

    Let me spend a little time to see if I can't concoct a better little script that causes the problem to appear more easily. In the meantime, if you'd like to try this one, I think it will cause the problem more frequently. This script generates 3 chord tones for each key you hit and this makes it more probable that the problem conditions will arise in a given period.

    on note
    play_note($EVENT_NOTE - 12,$EVENT_VELOCITY,0,-1)
    play_note($EVENT_NOTE - 5,$EVENT_VELOCITY,0,-1)
    play_note($EVENT_NOTE - 8,$EVENT_VELOCITY,0,-1)
    end on

    Let me know if your willing to try the sequencer thing, etc.

    Thanks again for you willingness to help.
    Big Bob (aka Wonderful Bob)

  8. #8
    Senior Member Big Bob's Avatar
    Join Date
    Jun 2005
    Location
    Apple Valley, California
    Posts
    323

    Post Re: Is there a bug in the KSP?

    I'd like to attach a Standard MIDI file to this post, but apparently that feature isn't enabled for me. However, I'm also going to post this on NI's forum where I can upload an attachment, please download it there.

    This Standard MIDI file of up and down glissandos. This sequence is 36 bars long and consists of 4 bars of glissandos followed by 2 bars of silence. This 4-2 pattern is repeated six times. The reason for the pauses is so that you can hear if there are any stuck notes (they're harder to hear while the glisses are happening). Also, you can't just stop the sequence to listen for stuck notes because most sequencers send an 'all notes off' message when they stop.
    I've been using an organ from the K2 library titled 1960s E_Organ.nki. With this sequence and even the simple form of the script (the 3-line octaver) the problem occurs quite regularly. On very rare occassions, I can get all the way thru the sequence without a stuck note, but, most of the time stuck notes occur almost once per 6 bar pattern.

    Again, I need to emphasize that you should try to run K2 in stand alone mode. You can do this if you simply send your sequencer output to a real hardware MIDI connector and then send it back as a hardware input to K2.

    Meantime, I'll work on a more sensitive script for those of you who can't do the sequencer thing, but can do the experiment with your keyboard.
    Big Bob (aka Wonderful Bob)

  9. #9

    Re: Is there a bug in the KSP?

    Which notes are hanging - the actual played note, the triggered (play_note) notes, or both?

    You could put a counter and a message in the "on release" event to know if all the note offs are being triggered as an aid to troubleshooting. For instance, if in the on "note event" you only have a a single "play_note" then your count should always be an even number as in the following example.
    Code:
    on release
       inc(count)
       message(count)
    end on
    This will show the total number of note release/note offs and if it is an odd number or a number that is not a multiple of however many "play_notes" are in the "on note" section plus one (for the original note) then that might get us a step closer to sussing this out.

    I've had a bit of experience with the scripting and have not experienced the issue that you are experiencing. Have you updated to the latest version of K2? I think there has been a single update since its initial release.

    Regarding the race condition theory - it could very well be a threading issue, but its impossible to tell without real debugging. I'm running a P4 with hyper-threading enabled, not that multi-proc would be necessary to cause the race condition. Have you contacted NI support about this?

    fizbin

  10. #10
    Senior Member Big Bob's Avatar
    Join Date
    Jun 2005
    Location
    Apple Valley, California
    Posts
    323

    Smile Re: Is there a bug in the KSP?

    Hi Fizbin.

    Thanks for your suggestions.

    Which notes are hanging - the actual played note, the triggered (play_note) notes, or both?
    It's a little hard to tell, just by the sound, but I suspect it may be the generated note(s).

    You could put a counter and a message in the "on release" event to know if all the note offs are being triggered as an aid to troubleshooting. For instance, if in the on "note event" you only have a a single "play_note" then your count should always be an even number as in the following example.
    Actually I've done a lot of just that sort of thing, especially when I first experienced the problem with the complete script that I was developing. I'm routinely using 4 edit boxes when debugging so that I can display several counts at the same time. In addition, I'm using two ui_tables of 12 elements each to display octave-independent pitch data. Every such tally that I could devise indicated the expected parity, yet notes were still left on. I'm an old, embedded microprocessor programmer from the 'dark ages' before fancy debuggers were available. So I'm very familiar with using whatever primitive thing might be available to get a handle on where things are going wrong. And, since it wasn't showing up anywhere that I could see, I was beginning to suspect that it might be a problem in the KSP machinery itself. But your suggestions are very appropriate.

    I've had a bit of experience with the scripting and have not experienced the issue that you are experiencing. Have you updated to the latest version of K2? I think there has been a single update since its initial release.
    I do have the latest version of K2. And, I'm glad to hear you say that you haven't yet experienced this problem. If you read this thread, you may have noticed that T.S. hasn't been able to produce the kind of error rate that I'm experiencing either. It's beginning to smell like I may have a problem with something other than K2.

    It also looks like I might have been hoisted on my own pitard! I wanted to avoid the additional problems that might have arisen from running in plugin mode, so I've been doing all my testing in standalone mode. However, since both you and T.S. have indicated that you're not having the same problem,
    just for kicks, I ran my test MIDI sequence using K2 as a plugin and lo and behold, I haven't been able to get a failure! The common denominator (on my system) when running K2 standalone, is an old Roland UM-2 MIDI interface and I'm beginning to think it may be playing at least some part in this problem. I have a fairly recent driver for it but not the latest. I'll update the driver later today and I'm also going to re-run all the tests using my AP2496 MIDI I/O. Unfortunately this won't be easy to do because of the way I've got things cabled. But, then (sigh) nothings easy is it?

    I'll post again as soon as I know something. Thanks again for your input.
    Big Bob (aka Wonderful Bob)

Go Back to forum

Bookmarks

Posting Permissions

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