Octave transpose slider?

#1

I haven’t dug into scripting yet, but this might be a good time!
I was wondering if this octave-transpose script could be “translated” to a slider widget where the only values would be
-48 -36 -24 -12 0 +12 +24 +36 +48?

#2

Not so easy, as the values sent from a Widget go from 0.0 to 1.0
At this time you cannot define discrete values a widged should send.
You could use 2 widgets: 1 is sending values to a 2nd widget which is mapped to the transpose of
the Midi In.
In scripting you could then check the value and translate it to the desired value the 2nd widget should be set.
But this is not so elegant.

1 Like
#3

I haven’t looked at that script but this is trivial to do with scripting and a single widget.

On WidgetValueChanged(newValue : double) from Transposer
    var value : integer
            t : integer
    
    // Break into 9 segments, 0 to 8    
    value = Round(newValue * 100) / 12

    // Scale the value
    t = Round(Scale(value, 0, 8, -48, 48))

    SetGlobalTranspose( t)
End

The above should work fine!

1 Like
#4

You are right, this way it is working fine.
But I think Furillo wanted a slider which “snaps” into discrete values.

But maybe I misinterpreted his question.

1 Like
#5

Thanks, but is this a global transpose? My idea was to have an octave transpose slider per Midi in-block.

#6

Attached is a sample gig with a rackspace and a script that responds to a widget and changes the MidiIn block transpose by octaves (from -48 through +48)

Transposer.gig (9.4 KB)

1 Like
#7

@dhj I slightly modified your script to force a slider to “snap” to the different octave values. I don’t know if it is the best way to do it, but I would be curious to see how it behaves with a real motorized slider :face_with_raised_eyebrow:
Transposer_2.gig (18.3 KB)

1 Like
#8

@David-san Here is your request for motorised slider :wink:

Works nicely your script!
Audio is from iPhone, think you can hear the motor of slider…
I’m sending Pitch bend and using sync.

4 Likes
#9

Thank you @keyman it is very nice :+1:

It seems that it “snaps” well on both sliders when moving the screen slider on the touch screen, but I have the feeling, that when moving the hardware slider, it doesn’t “snap” while the screen slider does. But maybe it’s just an impression?

1 Like
#10

I think it does not have much space in between settings to snap and sort of hold its position, that and it’s not a Ferrari fader…:laughing:

#11

By the way if you want to use it as a “pitchbend slider”, you could simplify the script to keep continuous values and snap only to a unique center tick :stuck_out_tongue_winking_eye:

1 Like
#12

Ummm I’m still not that at ease with scripts… but I love them all!!