HISE Logo Forum
    • Categories
    • Register
    • Login

    Per voice pitch scripting

    Scheduled Pinned Locked Moved Scripting
    7 Posts 3 Posters 753 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jukea
      last edited by

      Hi,
      I must be missing something obvious in the way the sampler work, but I can't manage to script the pitch. For example, in his case I'm trying to alter the pitch of the sampler voices by a random factor:

      https://imgur.com/a/iuW3SlX

      The note gets played, but its pitch is never altered. Can it be done ? Am I doing it wrong ?

      1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey
        last edited by d.healey

        The scripted modulators work in a different way to normal MIDI processor scripts and require different commands (I don't fully understand them). I think you can use your script from a normal MIDI processor though.

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        1 Reply Last reply Reply Quote 0
        • J
          jukea
          last edited by jukea

          i tried moving function onVoiceStart(voiceIndex) in a script node, but it never get called. However, it does if it's part of a pitch modulator script. In that case, the Synth.setVoicePitchValue(voiceIndex, pitch);
          seems to do nothing.

          1 Reply Last reply Reply Quote 0
          • Christoph HartC
            Christoph Hart
            last edited by

            Just return a value from 0 to 1 from the function, the rest will be taken care of - the modulation intensity will be applied to the value and it will be converted to the correct range (in this case 0.5 ... 2.0).

            function onVoiceStart(voiceIndex)
            {
                return Math.random();
            }
            1 Reply Last reply Reply Quote 0
            • J
              jukea
              last edited by jukea

              Hm, I'm still missing something it seems. I did exactly as follows :

              • started HISE
              • created a sampler
              • dragged a wav on some note
              • open the pitch processor
              • added the code in voice start
              • clicked compile (no errors)

              When I click the note on the keyboard at the bottom, the pitch is always the same.

              pic for reference : https://imgur.com/a/haNigg5

              1 Reply Last reply Reply Quote 0
              • Christoph HartC
                Christoph Hart
                last edited by

                Have you set the intensity to something > 0? A script modulator is just like any other modulator and needs a intensity to work.

                1 Reply Last reply Reply Quote 0
                • J
                  jukea
                  last edited by

                  Thanks, works perfectly.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post

                  11

                  Online

                  1.7k

                  Users

                  11.9k

                  Topics

                  103.2k

                  Posts