Home Forums General Programming 'custom'?

Tagged: 

This topic contains 11 replies, has 2 voices, and was last updated by  human fly 1 week, 4 days ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #72853

    human fly
    Participant

    newb’ question:
    can i get a quick run-through of the ‘custom’ parameters?
    i know this should be clear enough but i remember something
    not being as i expected last time i tried.

    i am not sure of the hierarchy of these parameters.
    ie: if any take precedence over, and ‘own’ any of the others.

    for example:

    modulatorCustomIndex=”1″
    modulatorCustomName=””
    modulatorCustomIndexGroup=”10″
    modulatorCustomNameGroup=”customPEG1pt1″

    i wanted to use ‘modulatorCustomNameGroup’ to identify a
    group of parameters to give an indexing with, ie: here, all
    the parameters for the Pitch Env, Part1, starting with index1.

    or: give them a customIndexGroup number, which they would list
    under. what would be the distinction between the two?

    then: what would a CustomName be used for? (have not attempted
    to use that yet)

    so far, i have an early thing working, where they all belong to
    a uiTab, using that to ID parameters to include, and i ‘getRange’
    from a single indexing, and that works.
    – but i want to make that more specific now (going back to tidy it
    up and eliminate some little errors)

    i’m going to have a messaround with it again now, see what happens.

    #72856
    Possemo
    Possemo
    Participant

    as far as I know you can freely use these custom fields. I use them for identifying modulators – e.g. do something with a modulator if it belongs to a specific CustomGroup. I guess “name” customs are meant to be strings and the other ones are meant to be numeric. AFAIK these are not used anywhere unless you are using these in scripts.

    #72857

    human fly
    Participant

    i remember seeing them used in the matrix panel you pointed
    me to.

    i have this randomizer that is a bit of a bodge, but works
    if all modulators are on the designated tab. but i want to
    get rid of the tab reference, and make each grouping of
    modulators – here, envelopes – randomize by custom group name,
    or custom modulator index group. i tried it but didn’t get it
    to work for some reason, so i have been using this hack of what
    i found in the matrix panel (which works fine as long as they’re
    on the UItabs) – yes, it was pointed out to me that the iteration
    is nonsensical 🙂 but i’ve been using it in the meantime. time to
    tidy up.(nb: this is now ‘old’, so i might do it differently now)

    randomPitchEG1_pt1=function()
    -- randomize a group by custom index group
    
    	-- This stops issues during panel bootup
    	if panel:getRestoreState() or panel:getProgramState() then return end
    
    	local randomGroup = panel:getModulator("randomPitch1pt1"):getValue()
    
    -- random seeder
    	local t=os.time()
    	local c=os.clock()
    	math.randomseed(t*c)
    	--math.randomseed(Time.getMillisecondCounterHiRes())
    
    	if randomGroup~=nil then
    
    -- custom group items to randomize
    		for k=1,4 do
    
    	modul=panel:getModulatorWithProperty("modulatorCustomIndex",k)
    	tab=modul:getComponent():getProperty("componentTabName")
    
    			if tab =="tabs_Main_pt1" then
    
    			rnd=math.random(0,100) --value range to random
    			modul:setModulatorValue(rnd,false,false,false) end
    		end
    
    		for k=5,9 do
    
    		modul	=panel:getModulatorWithProperty("modulatorCustomIndex",k)
    		tab		=modul:getComponent():getProperty("componentTabName")
    
    			if tab =="tabs_Main_pt1" then
    
    			rnd=math.random(-50,50) --value range to random
    			modul:setModulatorValue(rnd,false,false,false) end
    		end
    	end
    end

    btw: it’s a bipolar pitch envelope and has 2 sets of value ranges,
    hence arguments done twice. level has to be centred -50/+50,
    whereas ‘time’ is 0-100.

    • This reply was modified 2 weeks, 4 days ago by  human fly.
    #72867

    human fly
    Participant

    edit: want to try and rebuild this. can’t get it to
    work if i try to do it by custgroupname or custgroupnumber.

    it works as is if the modulators are on a uitab (or have
    the uitab ownership field with correct name in) and that
    is used to identify the group of modulators.

    but nothing with custgroupname or custgroupnumber yet.

    #72868

    human fly
    Participant

    not having ANY luck editing the original version
    i had, (which was extracts from the matrix panel
    major/minor random) – have to start it again from
    scratch aargh.

    #72880

    human fly
    Participant

    Possemo (if you’re there) : in the Matrix panel, you’ve got the
    major/minor random methods, which have:

    if sliders==1 then
    	for k=1,69 do	
    		modul=panel:getModulatorWithProperty("modulatorCustomIndex",k)
    
    		group=modul:getComponent():getProperty("componentGroupName")

    and then you have your parameter groups.

    i still need modulatorCustomIndex, but i want to select
    parameters by modulatorCustomIndexGroup (ie:”10″) or by
    modulatorCustomNameGroup (ie:”customPEG1pt1″).

    so i’ve tried substituting ‘componentGroupName’, but it
    doesn’t seem to work. it’s essentially the same form, so
    i’m wondering what’s missing. i haven’t needed to declare
    at the beginning with my previous attempt, which works,
    using ‘componentTabName’ as the grouping.

    i’d like to do it with customIndexGroup or customNameGoup
    because it offers better possibilities later if i want to
    randomise without relying on things belonging to a uiTabs.
    any thoughts? (had to leave this alone for a few days)

    #72881

    human fly
    Participant

    back to basics, to figure this out – here is the simplest
    form of random by group, with a simple randomize method
    *not working*
    mini demo panel:
    https://app.box.com/s/8bxem6vh08brm8i1hbgqt3r35u6m91qs

    method: (randomizes only first modulator in customNameGroup)

    randomize=function()
    
    --randomize a group by customNameGroup
    
    	--This stops issues during panel bootup
    	if panel:getRestoreState() or panel:getProgramState() then return end
    
    --custom group items to randomize
    	local modGroup = panel:getModulatorWithProperty("modulatorCustomNameGroup","custGroup1")
    
    --random seeder
    	local t=os.time()
    	local c=os.clock()
    	math.randomseed(t*c)
    
    	rand = math.random(0,127) --value range to random
    	modGroup:setModulatorValue(rand,false,false,false) 
    end

    the ‘format string’ property below is not readable, cannot
    see what is required there – is this the key to this?
    i cannot see why this method would not ‘get’ all modulators
    with same customGroupName. this is a simple method triggered
    by button valuechange, no condition required there – and i
    removed the ‘for…’ iteration, as it should not be needed.
    nb: want to use this to check through all actions for
    ‘custom’ parameters – seems to be a useful thing to do?

    #72885

    human fly
    Participant

    i thought this could work, it doesn’t:
    (same with customNameGroup)
    ie: give each item and index number, and give them a common
    customNameGroup or customIndexGroup. i know this will work
    if all the modulators/components are on a tab, and i call
    componentTabName. would be very convenient to use these other
    groupings, but they do not appear to work in the same way.

    randomize=function()
    
    --randomize group by modulatorCustomIndexGroup
    
    	--This stops issues during panel bootup
    	if panel:getRestoreState() or panel:getProgramState() then return end
    
    --random seeder
    	local t=os.time()
    	local c=os.clock()
    	math.randomseed(t*c)
    
    --custom group items to randomize
    	for k=1,2 do
    
    	mod=panel:getModulatorWithProperty("modulatorCustomIndex",k)
    	grp=mod:getComponent():getProperty("modulatorCustomIndexGroup")
    
    		if grp == 1 then
    
    		rnd=math.random(0,127) --value range to random
    		mod:setModulatorValue(rnd,false,false,false)
    		end
    	end
    end
    #72887

    human fly
    Participant

    awwwlrite, so here’s a version of the panel with
    non-working custom stuff, and working tab multi-random.
    custom index number seems to be the real identifier,
    and uiTabs (and probably uiGroups, but less usefully imo)
    seems to be the only current working way to reGroup
    modulators/components for group actions – * by custom Index # *

    please disprove this 😀

    cheers.
    file >
    https://app.box.com/s/01uxstx8sdnct7kkopgijr41upsskjc8

    #72891

    human fly
    Participant

    better example panel here with different methods to compare

    https://app.box.com/s/9hwlng18ou55pb7apjics1622372vah8

    #72893

    human fly
    Participant

    right well i’m beginning to see that was probably
    a waste of time, as i could have been doing this
    all along with tables … (except i’m not confident
    with that yet. i’m not very good at all this)

    #72900

    human fly
    Participant

    have found a reference to Custom Index in the XP30 panel
    in the method ‘PANEL_modulatorEfx ‘:

    mod_idx = tonumber(modulator:getPropertyString("modulatorCustomIndex"))

    and then:

    if efx_selected == 0 then
    mod_label = stereoeq_name[mod_idx]
    mod_unit = stereoeq_unit[mod_idx]
    mod_value = stereoeq_value[mod_idx]
    etc.

    (doing a bit of research)

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.

Comments are closed.