impossible to access midi modules and control some parameters of the sample osc

hello I have created a modulation matrix on the macro page, but midi modules such as lfo or envelopes do not appear as possible sources in the drop-down list, as they do if you do it from the matrix of any zone (Photo 1)
why are they not accessible, is it normal or is it that I am doing something wrong?
it is also not possible to control some parameters of the sample Osc editor in a proper way such as sample strat, sample end, loop start … none works well with knob, slider, text or any other control, I understand that maybe they are a lot of values to handle them from a knob but there has to be some way to control them from the macro page as is done with the flags inside sampler.
please, gentlemen of steinbreg, I think they are two very important things so that they are not available.

Can someone confirm that it is not possible to do these two things?
:unamused:

hello I have created a modulation matrix on the macro page, but midi modules such as lfo or envelopes do not appear as possible sources in the drop-down list, as they do if you do it from the matrix of any zone (Photo 1)
why are they not accessible, is it normal or is it that I am doing something wrong?

You’re right. It looks like a bug to me. Maybe you should report it.

it is also not possible to control some parameters of the sample Osc editor in a proper way such as sample strat, sample end, loop start … none works well with knob, slider, text or any other control, I understand that maybe they are a lot of values to handle them from a knob but there has to be some way to control them from the macro page as is done with the flags inside sampler.

If you mean by clicking and dragging in the waveform display, then no. You can connect those parameter to knobs, sliders… but as you discovered it doesn’t work very well. I guess the best option probably is value box.

You’re right It looks like a bug to me. Maybe you should report it.

Thank you misohoza for confirming it, I thank you.
How do I report the error? Do I have to send some email to the support?

You can connect those parameter to knobs, sliders … but as you discovered it doesn’t work very well.

It is not that they do not work very well, is that they simply hit some jumps that it is impossible to adjust (or have you got it to work decently?)

I guess the best option is probably value box.

In fact, this is the only control that is going well, but it does not have any use since it moves in steps one by one and however small the sample usually has more than 300,000 steps so you can spend a lifetime to adjust it :slight_smile:

please gentlemen of steinberg you need a solution for this …

How do I report the error? Do I have to send some email to the support?

I meant to post it in Issues section of the forum.

It is not that they do not work very well, is that they simply hit some jumps that it is impossible to adjust (or have you got it to work decently?)

You could use a combination of value box and sliders.

Here’s one way how to do it. You can type in the value into the box or click into the waveform. It’s not perfect because you need to select which parameter you want to edit by clicking and/or dragging in the waveform.
Sample Osc.zip (8.73 KB)

1 Like

cool, I take my hat off to you.
I know that I am not in a position to ask for anything so I fully understand that I ignore this, there would be a couple of details that would have to be done to make this functional …

  • The flags would have to respond to snap to zero crossing when activated, to avoid clicking
  • It would also be necessary to control the sustain lopp XFade parameter, as you have done with the sampleStart and the others
  • the drawn loop selection has to disappear when loop is off.
  • zoom on the sample (I guess this is already too much;))

I know this is a steinberg thing and I will put it in suggestions (Feature Requests) since this seems very necessary to me.
thanks again for your time

The macro page waveform control is more of a visual aid rather than a full blown sample editor. So some of the functionality is not easy to implement on macro page. Maybe it was done like that on purpose.

Hiding the drawn loop selection could be done with a range slider and disable control linked to loop mode parameter. That’s the easy bit.

For the crossfade parameter you could add another value box, but you wouldn’t see the resulting crossfade reflected in the waveform.

While zooming could be done it would conflict with the horizontal faders that span the entire sample length.

As far as I know there’s no way to figure out zero crossings with current scripting possibilities.

As far as I know there’s no way to figure out zero crossings with current scripting possibilities.

Too bad this would be the most important thing.
I think I will have to do it again with the selection of zones, with a scrip that you modify (based on a script of yours, called Layer Selector) that bypass the midi input of all the zones, except the selected one.
the problem is that I also need to select the choice zone as if you manually select it from program so that for example the play post function is seen touring the envelopes of the selected zone
any clue on how to do it about this script

zones = this.parent:findZones()

function getZoneNames()
  zoneNames = {}
  for i, zone in ipairs(zones) do
        zoneNames[i] = zone.name
  end
end

getZoneNames()

defineParameter("ZoneSelect", nil, 1, zoneNames)


function onNote(event)
  playNote(event.note, event.velocity, -1, zones[ZoneSelect])
end

regards

Not sure I understand what you are trying to do.

Do you have an Envelope template and you want it to be linked to currently selected zone?

You can find more info about editing scope here:

Here’s an example preset. It has a simple UI script that creates a string list parameter (variable) used to set the scope.
Amp Envelope.zip (10.7 KB)

Not sure I understand what you are trying to do.

sorry my english is really bad :frowning:

Do you have an Envelope template and you want it to be linked to currently selected zone?

exactly, what I would like is that when choosing an area it is linked with the envelopes. I realized with your example that I was missing the script to be inserted in the main macro folder to be able to use the scope in the group folders of the envelopes, however the example does not work, but I think it is because I have the zones put in layers, attached photo so you can see my configuration. You will see how in the macro page zone there is no Zone in parameter value.
thank you very much for your help and happy new year

however the example does not work, but I think it is because I have the zones put in layers

Yes.

You need to adjust the ui script so that it actually finds the zones.

for i = 1, 2 do -- Check first 2 layers
  local layer = getElement():getLayer(i)
  local zones = layer:findZones()

  local zoneScopes = {}

  for j = 1, #zones do
    zoneScopes[j] = "@0:"..layer.name.."/@0:"..zones[j].name.."/"
  end

  defineParameter("ZoneSelect"..i, nil, 1, zoneScopes)
end

This checks first two layers and creates a ZoneSelect parameter for each layer. If you need to search more layers change first line of the script.
Amp Envelope 2.zip (8.7 KB)

Hi
sorry because I had to put this before, the way I use the envelopes is different from yours.
I use amp, filter and pitch envelopes in a common way for the two layers (I don’t want them independent) so I use the @type: Layer / @ type: Zone / for all the parameters of the envelopes.
when using its scripts, the scope causes each zone to have an individual edition of the envelope and ignores (@type: Layer / @ type: Zone /)
Without using the scope, envelope tracking only happens when I am in zone 1 of layer 1.
With midi envelopes there is no problem always follow up.
I have modified your program with an exact configuration to the one I have.
so you can see better what I mean

regards
Amp Envelope 2 (mod).zip (15.4 KB)

I see now.

When you set the scope like this it affects all zones but displays the controls for and “tracks” the first zone. If the first zone doesn’t play it doesn’t show the playback position.

So you need to make sure first zone always plays.
Do you have more layers? Some that don’t use the zone selector script?

Move it up in the program tree so it appears first (from top of the program tree)

If I had a layer with an oscillator, I have put this layer the first in the program tree and now there is always follow-up of the envelope, thank you very much, steinberg I should give you a salary :slight_smile:

Hello misohoza,
the Script with the Sample Osc is very useful and I trie to modify it so that the Sample can be found in another Zone. But because I still don’t know much about scripting I get an Error and it will not work.
The error Message:
Syntax Error:Line 65:‘end’ expected (to close ‘function’ at line 32) near : on Load:attempt to call a nil value

So I added an “end” and another and another… but it will not fix the Problem.
Maybe you know how to fix it.
Thank you for help.

function sampleStartChanged()
  local zones = this.parent:findZones(true)
  for i, zone in ipairs(zones) do
    zone:setParameter("SampleOsc.SampleStart", SampleStart)
end

function sampleEndChanged()
  local zones = this.parent:findZones(true)
  for i, zone in ipairs(zones) do
    zone:setParameter("SampleOsc.SampleEnd", SampleEnd)
end

function loopStartChanged()
  local zones = this.parent:findZones(true)
  for i, zone in ipairs(zones) do
    zone:setParameter("SampleOsc.SustainLoopStartA", LoopStart)
end

function loopEndChanged()
  local zones = this.parent:findZones(true)
  for i, zone in ipairs(zones) do
    zone:setParameter("SampleOsc.SustainLoopEndA", LoopEnd)
end

defineParameter("SampleStart", nil, 0, 0, 0x7fffffff, sampleStartChanged)
defineParameter("SampleEnd", nil, 0, 0, 0x7fffffff, sampleEndChanged)
defineParameter("LoopStart", nil, 0, 0, 0x7fffffff, loopStartChanged)
defineParameter("LoopEnd", nil, 0, 0, 0x7fffffff, loopEndChanged)

defineParameter("Filename", nil, "", function () filenameChanged() end)

function filenameChanged()
  local sample = AudioFile.open(Filename)
  local zones = this.parent:findZones(true)
  for i, zone in pairs(zones) do
  if sample.valid and zone then
    zone:setParameter("SampleOsc.Filename", Filename)
    defineParameter("SampleStart", nil, 0, 0, sample.length, sampleStartChanged)
    defineParameter("SampleEnd", nil, sample.length, 0, sample.length, sampleEndChanged)
    defineParameter("LoopStart", nil, 0, 0, sample.length, loopStartChanged)
    defineParameter("LoopEnd", nil, 0, 0, sample.length, loopEndChanged)
    
    this:setParameter("SampleStart", 0)
    this:setParameter("SampleEnd", sample.length)
   
    local loops=sample.loops
    if loops[1] then
      zone:setParameter("SampleOsc.SustainLoopModeA", 1)
      this:setParameter("LoopStart", loops[1].loopStart)
      this:setParameter("LoopEnd", loops[1].loopEnd)
    else
      zone:setParameter("SampleOsc.SustainLoopModeA", 0)
      this:setParameter("LoopStart", 0)
      this:setParameter("LoopEnd", 0)
    end
  end
end

function onLoad()
  local zones = this.parent:findZones(true)
  for i, zone in ipairs(zones) do
    zone:setParameter("Filename", zone:getParameter("SampleOsc.Filename"))
   end
end

You are missing quite a few “ends”.

Each function needs one and each “for” loop needs one too. But apart from that, what are you trying to achieve? Because the script doesn’t make much sense if used for multiple zones. Each sample will likely have different length. This will affect possible sample end and loop end.

I have one Synth and one Sample zone. If I use the script as it is, it seems that the functions are set to the Synth Zone because the Synth Zone is the first Zone. After I change the order of the Zones it will work in some cases, but some other functions will not work as before. So I change the order back and try to work with the script.

So now I added some more “ends” and it works. But everytime I restart the Program I have to reload the Sample, otherwise the settings for “Start” and “End” will not work. Is it possible to fix that?