Jump to content


Photo

Triggering Patterns with OSC following the currently played line

osc lua api tip

  • Please log in to reply
7 replies to this topic

#1 Woodpecking Mantis

Woodpecking Mantis

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 156 posts
  • Gender:Male
  • Location:Montréal, Qc
  • Interests:Plentifull...Renoise, Max/MSP, DSP, Sound design to name related ones...

Posted 24 June 2015 - 06:24

Hi Hard Coders!

 

My goal is to replicate the behavior of the mouse scroll when it is over the Pattern Sequencer: to change the Pattern currently playing while keeping the current line number incrementing (not retriggering from line 1 of the Pattern, but follow from actual line in the next or previous sequence pattern)

 

I've tried to use the /renoise/song/sequence/trigger(number) osc implementation, but its behavior is different: the triggered Pattern restart from line 1 of the said triggered Pattern.

 

Is there any way I could customize or create a new function in the GlobalOSCActions.lua file.  Any tips or suggestion would be very appreciated...

 

-- /song/sequence/trigger

add_global_action {
  pattern = "/song/sequence/trigger",
  description = "Set playback pos to the specified sequence pos",
 
  arguments = { argument("sequence_pos", "number") },
  handler = function(sequence_pos)
    song().transport:trigger_sequence(clamp_value(sequence_pos,
      1, song().transport.song_length.sequence))
  end,
}

 

Thanks in advance,

cheers!



#2 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6248 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 24 June 2015 - 16:16

Instead of a mouse wheel, what do you intend to be controlling this position with? 

 

I'm asking since Duplex has this thing called Navigator that does a lot of behind-the-scenes stuff to keep the rhythm going.

But right now, it can't be controlled from knobs/encoders, only button...and I get the feeling you're looking for something else. 


  • Woodpecking Mantis likes this

Tracking with Stuff. API wishlist | Soundcloud


#3 Neurogami

Neurogami

    Big Masta Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPip
  • 558 posts
  • Gender:Male
  • Location:Scottsdale AZ
  • Interests:Art, music, technology

Posted 25 June 2015 - 03:32

Hi Hard Coders!

 

My goal is to replicate the behavior of the mouse scroll when it is over the Pattern Sequencer: to change the Pattern currently playing while keeping the current line number incrementing (not retriggering from line 1 of the Pattern, but follow from actual line in the next or previous sequence pattern)

 

 

My tool, OSC Jumper, does this.  https://github.com/N....OscJumper.xrnx

 

    

/ng/pattern/into     

Instantly jumps from the current pattern/line to given pattern and relative next line.

If the second arg (stick_to) is greater than -1 it schedules that as the next pattern to play, and turns on block loop for that pattern. 

Args: pattern_index, stick_to 

You can look at the code to see how the custom OSC handler is written.


  • Woodpecking Mantis likes this

#4 Woodpecking Mantis

Woodpecking Mantis

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 156 posts
  • Gender:Male
  • Location:Montréal, Qc
  • Interests:Plentifull...Renoise, Max/MSP, DSP, Sound design to name related ones...

Posted 25 June 2015 - 16:52

NEUROGAMI!!!! Amazing!!!  :w00t:

 

I was to post my reply to Danoise. 

I will do so, just to complete the topic. But it looks like I will able to do what I wanted with your magic.  Thanks a lot guys!

 

 

---- My reply would have been:

To explain the context:

I love the mangling results of quickly changing the currently played pattern using the mouse wheel (when over the pattern sequencer).
The pattern currently playing change while the line number continue incrementing where it were. I sometime record the audio result of these live jam.

The problem is that I can't record the playhead moves of my mouse gesture in events/data/MIDI means..

To solve that, I figured out that I could try to use the OSC trigger command, but Renoise can't send himself OSC.
So I've set up a Master Renoise that send a MIDI clock to the Renoise slaved along with a Max 7 that map the master MIDI to OSC commands to the slaved renoise.
See picture...

Everything works fine, but the trigger OSC command don't behave like I would like.
It does not just change the currently played pattern to another.
It actualy change the pattern AND trigger it from line 1
I'm looking for a function that would just do like the mouse wheel do: change the currently played pattern without restarting to line 1.

I know its maybe a weird project, but I like complex setup... It's so editable!

2zei5on.jpg

 


Edited by Woodpecking Mantis, 26 June 2015 - 05:51.


#5 Woodpecking Mantis

Woodpecking Mantis

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 156 posts
  • Gender:Male
  • Location:Montréal, Qc
  • Interests:Plentifull...Renoise, Max/MSP, DSP, Sound design to name related ones...

Posted 26 June 2015 - 05:50

Feedback on the topic:

 

I just added theses lines to "GlobalOscActions.lua" and everything worked as expected!

Thanks a lot for sharing knowledge! Very appreciated.

-- /transport/jump/

add_global_action {
  pattern = "/transport/jump/",
  description = "Instantly jumps to given pattern number and relative next line.",
 
  arguments = { argument("pattern_index", "number")},
  handler = function(pattern_index)
    --print("pattern jump to ", pattern_index)
    local song = renoise.song  
    local pos = renoise.song().transport.playback_pos
    pos.sequence = pattern_index
    song().transport.playback_pos = pos
  end
}


#6 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6248 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 26 June 2015 - 12:05

Cool. 

A more sophisticated approach would eliminate glitches when navigating between differently-sized patterns. 

But I guess a bit of potential glitchyness is actually desirable here   ^_^


  • Woodpecking Mantis likes this

Tracking with Stuff. API wishlist | Soundcloud


#7 Woodpecking Mantis

Woodpecking Mantis

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 156 posts
  • Gender:Male
  • Location:Montréal, Qc
  • Interests:Plentifull...Renoise, Max/MSP, DSP, Sound design to name related ones...

Posted 29 June 2015 - 16:32

Cool. 

A more sophisticated approach would eliminate glitches when navigating between differently-sized patterns. 

But I guess a bit of potential glitchyness is actually desirable here   ^_^

 

True, when skipping right in the middle of a sequence, you can get nice staccato articulations on played instruments coming along new textures with the automation suddenly changing... Only Renoise offer that unexpected work path. : )


Edited by Woodpecking Mantis, 29 June 2015 - 16:33.

  • danoise likes this

#8 Woodpecking Mantis

Woodpecking Mantis

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 156 posts
  • Gender:Male
  • Location:Montréal, Qc
  • Interests:Plentifull...Renoise, Max/MSP, DSP, Sound design to name related ones...

Posted 01 July 2015 - 02:53

I've added these 2 functions to just skip to the next and previous while keeping actual line...  updating thread just to share if any other beginner need it...

 

In GlobalOscActions.lua:

 

-- /transport/jumpToNext/

add_global_action {
  pattern = "/transport/jumpToNext/",
  description = "Instantly jumps to the next pattern number and relative next line.",
 
  arguments = nil,
  handler = function()
    --print("pattern jump to next", pattern_index)
    local song = renoise.song  
    local pos = renoise.song().transport.playback_pos
    --print("pos.sequence= ", pos.sequence)
    pos.sequence = pos.sequence + 1
   -- print("pos.sequence + 1= ", pos.sequence)
    song().transport.playback_pos = pos
  end
}

-- /transport/jumpToPrevious/

add_global_action {
  pattern = "/transport/jumpToPrevious/",
  description = "Instantly jumps to the previous pattern number and relative next line.",
 
  arguments = nil,
  handler = function()
    --print("pattern jump to previous", pattern_index)
    local song = renoise.song  
    local pos = renoise.song().transport.playback_pos
   --print("pos.sequence= ", pos.sequence)
    pos.sequence = pos.sequence - 1
    --print("pos.sequence - 1= ", pos.sequence)
    song().transport.playback_pos = pos
  end
}







Also tagged with one or more of these keywords: osc, lua, api, tip