Jump to content


Photo

Applying a function to multiple selected samples?

sample properties selections

  • Please log in to reply
4 replies to this topic

#1 muckleby

muckleby

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 151 posts

Posted 28 April 2017 - 01:02

I have a simple function that adusts the finetune property of an instruments samples - 

function sample_finetune_up()
  for i=1,#renoise.song().selected_instrument.samples do        
    renoise.song().selected_instrument.samples[i].fine_tune = renoise.song().selected_instrument.samples[i].fine_tune + 1
  end
end   

What I'd like to do is apply this to only selected samples, much in the same way that adjusting the Sample Properties via the GUI functions.

 

Is this possible via the API?



#2 4Tey

4Tey

    Chief Above Chief Member

  • Normal Members
  • PipPipPipPipPipPip
  • 382 posts
  • Gender:Male

Posted 28 April 2017 - 08:14

Probably along similar lines muckleby (only the thread is applied to the instruments slots rather than sample slots) -> http://forum.renoise...nt-selections/ 


  • muckleby likes this

#3 joule

joule

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1491 posts
  • Gender:Not Telling
  • Location:Sweden
  • Interests:music, philosophy, engineering

Posted 28 April 2017 - 09:34

Like 4Tey says. But it's not terribly difficult making your own GUI (sample list) to allow this.

 

Here is a snippet for VBSandbox showing a principle (it acts on the selected instrument):

 

Spoiler

Edited by joule, 28 April 2017 - 09:51.

  • muckleby likes this

#4 muckleby

muckleby

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 151 posts

Posted 28 April 2017 - 18:54

ahah thanks thats food for thought!
thanks for the code example Joule, admittedly its a bit over my head - not entirely sure how to implement it at the moment but will be handy to come back to when Ive got a bit more scripting experience!

#5 joule

joule

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1491 posts
  • Gender:Not Telling
  • Location:Sweden
  • Interests:music, philosophy, engineering

Posted 29 April 2017 - 08:56

NP. It took me a long time to start using Viewbuilder, because I thought it was too difficult for me. But it's quite simple and consistent once you know the fundamentals. Don't hesitate to ask questions if you get stuck or need some starting points!







Also tagged with one or more of these keywords: sample properties, selections