1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

Timpani Script Request

Discussion in 'Scripting Workshop' started by Justin M, Mar 14, 2006.

Thread Status:
Not open for further replies.
  1. Justin M

    Justin M NI Product Owner

    Messages:
    76
    I wonder if it would be possible for one of the great script writers out there (Jay, Jay, Nils, Bob, Dave - sorry if I missed any) to create a script for the following:

    In many orchestral libraries the timpani (& other percussion) have a left hand & right hand sample normally mapped in different octaves.

    Could a script be created that alternates, every other note ,between the original note and a user defined transposed note (i.e. original then two octaves above - for timpani, or, original then a tone above for snare drum)

    Hope this is possible and thanks in advance,

    Justin
     
  2. kotori

    kotori NI Product Owner

    Messages:
    1,153
    Sure. Is this what you're looking for:
    Code:
    { script to transpose every other note }
    on init
      declare $alt
      declare $id
      declare ui_value_edit $transpose(-50,50,1)
      declare ui_value_edit $st_width(0,100,1)
      $transpose := 24
    end on
    
    on note
      ignore_event($EVENT_ID)
      $id := play_note($EVENT_NOTE+$transpose*$alt, $EVENT_VELOCITY, 0, -1)
      change_pan($id, (($alt*2)-1)*$st_width*10, 0)
      $alt := ($alt + 1) mod 2  
    end on
    You can increase the st_width (stereo width) setting to increase the amount of left/right panning alternation.

    If you're willing to rearrange your instruments slightly it's also possible to solve this without scripts using round robin as group start option.

    Best,
    Nils
     
  3. Justin M

    Justin M NI Product Owner

    Messages:
    76
    Nils,

    Thats great, thanks very much - and so quick too!!

    I wonder if I may be so bold as to ask you for another script:

    In GPO you can load Player 1,2,3 of the same instrument which, I presume, uses the TKT or ensemble builder method of using adjacent samples detuned.

    Would it be possible to have a script that could create a player 2,3 etc by taking the midi input from the notation prog, playing user defined adjacent samples (i.e. 1 semitone, 1 tone up or down) but detuning them back to the original played notes.

    This would enable several notated lines in a notation programme (i.e. 1st Clarinet, 2nd Clarinet etc) to play in unison but without phasing.

    All the best,

    Justin
     
  4. kotori

    kotori NI Product Owner

    Messages:
    1,153
    Hi Justin,
    have you tried Jay's Ensemble Maker script?
    If that script doesn't do exactly what you want, please explain what you want to do differently.

    Best,
    Nils
     
  5. Justin M

    Justin M NI Product Owner

    Messages:
    76
    Hi Nils,

    Thanks for your reply. I have got Jays Script and it works a treat on one melodic line or channel. However I work from a notation program (Sibelius 4) and what I need is a script that will allow me to load for example:

    In Sibelius I have 1st Clarinet on channel 1, 2nd Clarinet on Channel 2 and 3rd Clarinet on Channel 3.

    In kontakt I would load 3 instances of the same Clarinet patch on midi channels 1-3 respectively. The first instance plays as is. The second instance needs a script that would play adjacent samples say semitone up (user definable) but transpose them to sound the correct pitch. The third instance needs the same script using different adjacent samples again, say semitone down but transposed to sound the correct pitch.

    This avoids phasing when the parts end up unison and helps with a hanging note problem that is caused by sibelius when two parts use the same sample.

    I know that this is all possible by reprogramming each instrument patch, however a script would save a massive amount of time.

    I hope I have explaned this well enough and look forward to some (more!) help from your good self.

    Justin
     
  6. kotori

    kotori NI Product Owner

    Messages:
    1,153
    Hi again Justin,
    I wrote a little script that does the transpose and pitch-bend-back thing for secondary voices. Be sure to transpose to multiples of the intervals with which your instruments have been sampled (you probably already knew that). In addition it provides two very simple humanizing elements: random tuning and sloppiness. Please let me know if you want to change the way it works in any way.

    Best,
    Nils
    Code:
    { Script that transposes and pitch-bends back for secondary voices to avoid
      phasing problems. In addition it provides to very simple humanizer settings -
      tuning (optionally random) and start timing sloppiness (always random). }
    on init
      declare ui_value_edit $transpose(-12,12,1)       { number of notes }
      declare ui_value_edit $tuning(-50000,50000,1000) { number of cents }
      declare ui_value_edit $slop(0,500,10)            { number of ms    }
      declare ui_button $random                        { whether detuning is random }
      $random := 1
      move_control($random, 2, 2)
      declare polyphonic $id
      make_persistent($transpose)
      make_persistent($tuning)
      make_persistent($slop)
      make_persistent($random)
      message("")
    end on
    
    on note
      ignore_event($EVENT_ID)
      if ($slop > 0)
        wait(random(0, $slop*1000))
      end if
      $id := play_note($EVENT_NOTE + $transpose, $EVENT_VELOCITY, 0, -1)
      if ($random = 1)
        change_tune($id, -100000*$transpose + random(-$tuning, $tuning), 0)
      else
        change_tune($id, -100000*$transpose + $tuning, 0)
      end if
    end on
     
  7. Cyril Blanc

    Cyril Blanc NI Product Owner

    Messages:
    670
    If you have Logic, you do not need a script, you need just to set an environment that does it
    Look at the transformer/ alternate.
    If you need it contact me at blanc(point)cyril(at)wanadoo(dot)fr
     
  8. Justin M

    Justin M NI Product Owner

    Messages:
    76
    Thanks for your input Cyril, but as you can see above I use Sibelius 4 so this is no good for me.

    Nils - You astound me again with your speed and generosity.
    However, there is one slight problem :). The release samples are not transposed. I know that this has been a problem with Bobs TKT script and indeed Jays Ensemble builder involves deselecting the release trigger button in the group editor.

    BTW - I have sent you a PM

    Again, many thanks,

    Justin
     
  9. Big Bob

    Big Bob Forum Member

    Messages:
    606
    Hi Justinm,

    Just out of curiosity, why do you say that the handling of release samples are a problem with the Ultra TKT. I thought I had addressed that problem by allowing you to tell the script which group was the release group so that the script could optionally trigger the correctly-pitched sample on release. Is there something about that process that you find not to work properly?

    Bob
     
  10. Justin M

    Justin M NI Product Owner

    Messages:
    76
    Hi Bob,

    Sorry I didnt mean to criticise your work as I appreciate your contributions very much. I use EWQLSO (as well as Opus One) and it is very noticable when the release sample is not triggered correctly. I have found that even when selecting the release group it seems not to trigger correctly (almost a muted sound).

    I have followed your postings on the NSS forum but I cant contribute as, for some strange reason, I have not been able to register properly (for about 2 years!!).

    Keep up the good work and I look forward to your Legato/Vibrato Script.

    All the best Justin
     
  11. Big Bob

    Big Bob Forum Member

    Messages:
    606
    Hey Justin,

    I didn't think you were criticizing my work, I'm just genuinely interested to hear that someone is still having some kind of release triggering problem. I honestly thought that had been put to rest a long time ago.

    I'm a little puzzled by the statement 'even when selecting the release group'. Does that mean there are times when you don't select it? If you use the Ultra TKT with an instrument that has a release group, you must select that group or it will sound coincidentally with every attack!

    Why don't you send me a PM and maybe we can solve the problem you're having. It could just be that there is some bug in the script that was overlooked.

    Is anyone else having a problem using the Ultra TKT in a release group situation? I'm still around to help, and my consulting fees are quite reasonable ;-)

    God Bless,

    Bob
     
  12. Justin M

    Justin M NI Product Owner

    Messages:
    76
    Hi Big Bob,

    I cant send you a PM as your profile deosn't allow it and indeed as I mentioned earlier I cant log on to NSS forum - must have said something controversial in the past.

    To clarify, what I should have said is that:

    I use your TKT script quite a lot but most of my libraries dont have release samples and therefore do not require the release samples to be selected. However with EWQLSO the release trail is so integral to the sample that it is very noticable when it deosn't trigger. I do select the appropriate release group which means it deosn't trigger at the 'note on' but indeed it also deos not trigger at the 'note off'. The other thing is that there is more than one release sample per note depending on the velocity.

    Justin
     
  13. Big Bob

    Big Bob Forum Member

    Messages:
    606
    Hi Justin,

    That shouldn't matter (as long as all the release samples are in one group) because the Ultra TKT triggers the release sample at the same velocity as the played note.

    I'll have to revisit my profile to see what happened but I know that people send me PMs all the time on the NS forum. If I can't get it working here, you could try joining the NS forum.

    In the meantime, if you aren't afraid to try some editing of the script, find the 'on release' handler and go down to about the 9th line which reads:
    Code:
    play_note($EVENT_NOTE - $Span,$EVENT_VELOCITY,0,1)
    
    (This same construct also appears on the 15th line but we want the one on the 9th line)

    Just for kicks, try changing the last parameter (1) to 0 so that the line reads:
    Code:
    play_note($EVENT_NOTE - $Span,$EVENT_VELOCITY,0,0)
    
    If you get the courage (and the time) to try this, tell me what if any effect this has on your stunted release samples.

    God Bless,

    Bob

    PS The PM option did seem to be turned off, so I turned it back on. Mayber now you'll be able to send me a PM.
     
  14. kotori

    kotori NI Product Owner

    Messages:
    1,153
    Now I have fixed this problem - which was a lot trickier than I first thought if one wants to support polyphonic playing - and slightly extended the humanizer capabilities. I figured more people might be interested in this so I added it to my scripts web page and called the script Part Maker.

    Best,
    Nils
     
  15. Dup

    Dup NI Product Owner

    Messages:
    73
    Hello,
    Thanks for the script :
    Timpani Script Request
    But seem that there is something wrong : sometimes the notes are not played, we must need the end of the sample?!
    Try to like this ta-ka-ta-ka-ta..small pause ta-ka-ta-ka-ta : the second groups of notes are not played we must need to wait to play the second fives notes
    Best regards
    Dup
     
  16. kotori

    kotori NI Product Owner

    Messages:
    1,153
    Hi Dup
    Sorry, but I don't know if I really understand the problem. Do you mean that once in a while notes drop out? I find it very hard to believe that it would have to do with this script. Does it work if you bypass the script? You're talking about the timpani script, right?

    Anyway, I noticed that the timpani script doesn't save its two settings. I tried to make it as short as possible, but apparently it got a little too short. Here's a fix for that with two extra lines added:
    Code:
    { Timpani script, transposes every other note (now also saving settings) }
    on init
      declare $alt
      declare polyphonic $id
      declare ui_value_edit $transpose(-50,50,1)
      declare ui_value_edit $st_width(0,100,1)
      make_persistent($transpose)
      make_persistent($st_width)
      $transpose := 24
    end on
    
    on note
      ignore_event($EVENT_ID)
      $id := play_note($EVENT_NOTE+$transpose*$alt, $EVENT_VELOCITY, 0, -1)
      change_pan($id, (($alt*2)-1)*$st_width*10, 0)
      $alt := ($alt + 1) mod 2  
    end on
     
  17. Dup

    Dup NI Product Owner

    Messages:
    73
    Hello,
    Thanks for your answer, I send you a *.jpg to be more comprehensive :
    Hope it helps.
    Best regards
    Dup
     

    Attached Files:

  18. kotori

    kotori NI Product Owner

    Messages:
    1,153
    Hi Dup, please try with the version of the script in my last post. If it still doesn't work please PM me and we'll try to solve it. Btw. do you have any other scripts loaded on the same instrument?

    Best,
    Nils
     
  19. Big Bob

    Big Bob Forum Member

    Messages:
    606
    Hi guys,

    Earlier in this thread, Justin indicated that he was having a problem with the Ultra TKT Script not handling release samples properly. Since most of the back and forth communication with Justin was done with PMs, I'm posting this for the benefit of any others that may be interested in this topic.

    I carefully reviewed the code and re-ran extensive tests with the UTKT and the bottom line is that the code is correct as is, and I haven't been able to reproduce Justin's problem. I don't have the EWQLSO library that is giving him the problem but I did check the TKT under as many similar conditions as I could. There is apparently something about either the library or how Justin has it set up, that is giving him a problem.

    So, as kind of an open call, is anyone else having release sample problems with the Ultra TKT, especially if you are using the EWQLSO library? If so, I'd like to hear about it. If this is a more or less wide-spread problem, I would like to be able to reproduce it and then correct it. Any constructive input along these lines would be appreciated. For example, does this library have something unusual like perhaps more than one release group or some associated script that is fighting the UTKT, etc?

    Thanks,

    Bob
     
  20. T.S.

    T.S. NI Product Owner

    Messages:
    581
    Hi Bob,

    I've used the TKT script with Gold on a number of occasions and had no problem at all, it worked great. However, I got to thinking and realized that almost any instrument I might use it on would be one that wouldn't have any "rel" tails so I decided to check it out.

    I loaded an istrument that had one "on" group and one "rel" group. Unfortunately I couldn't get the 'rel" groups to work properly. If the script was set up for 3-variations it would play the 1st rel correctly, the 2nd rel 1/2 step down, and the 3rd a 1/2 step up. With 5-variations it played 1st correct, 2nd 1/2 down, 3rd 1/2 up, 4th 1 whole step down, 5th a whole step up.

    I tried selecting the "rel" group under "No Release Group" as well as "Mute_Release" but it didn't seem to matter.

    I did this as a quick test and may have missed something. Is there something your aware of I might have missed?

    God bless you Bob, and let me know if there's anything else you want me to try.

    TS
     
Thread Status:
Not open for further replies.