How to switch phrases using midi-controller in pgm-mode?

Does anyone know how to assign and switch phrases using the midi controller, BUT without using the keymap function. The fact is that when working in keymap mode, phrases switch and sound simultaneously with the sound of the track, while switching phrases in program mode changes the sound of the track itself. It is difficult to explain in words, but the point is that is it possible to simply assign a separate key in the midimap to each phrase on the MIDI controller, as this is done with the mouse when the phrase is turned on in program mode? Or how to make sure that in keymap mode, the inclusion of a certain phrase changes the sound of the playing track at the time of pressing. For example, I want the barrel to play triplets at some point. When you press the phrase in which the triplet rhythmic preset is set, the triplets will play simultaneously on the track and it sounds awful. Or, for example, if I’m playing a track with a synthesizer giving out a certain note, and I want the phrase with an arpeggiated chord to sound at the click of a button, in keymap mode everything will sound at the same time, and you get a terrible horror from the sounds. In program mod its ok, but you cannot assign phrases to specific controller buttons in midimapping in it. Or am I just doing everything wrong?

Have you tried using the Zxx command?

**-Zxx**  - Trigger phrase number xx (01 - 7E, 00 = no phrase, 7F = [keymap mode]

(https://tutorials.renoise.com/wiki/Phrase_Editor#Phrases_in_Keymap_Mode)).

Of course I tried it! But I speak about playing live. Usually I use the Zxx command for triggering phrases! But what should I do if I want to do it in real time?) I wonder, why all (or almost all) the buttons in renoise can be assigned on midi, except phrases buttons?)

2019-12-10|690x388

There are countless Renoise things that are not MIDI assignable, because Renoise has many things.

The selection of phrases through the MIDI input can be solved with a tool. I believe.

Imagine you have a controller with 16 pads (or 32, or 64). It is possible to create a tool that, previously mapped, can select the phrase you want for each pad of the current instrument with live playback. If that phrase does not exist, the pad would do nothing.
So, with a 64 pad controller and two MIDI channels (1 and 2, or two banks), you can control the 126 phrases of each instrument (just select, play (sound) would depend on OSC).

Thank you for your answers! I tried to solve this problem with a tool, but it seems to me, its impossible. Changing behavior of Renoise through writing midi or osc scripts is a very difficult task for me. Writing programm codes its over my head((( I tried to figure out how to assign phrase button via midi and osc scripts and I think, learning of writting midi or osc codes will take me half a year( Maybe it’s better to wait until the developers add these functions in the next version)
Thanx for the answers anyway.

@sawtoothpulse What MIDI controller are you using?

Really creating a window tool with 64 pads to be able to select each phrase through the MIDI input is really simple. It would not be necessary to write many lines.

In the end it all comes down to a button, using “midi_mapping” and a trigger function for selection with a previous check. Multiply that by 64 and voila.

It is also possible to use a wheel with a range of 0 to 127 in absolute (or relative) mode for the selection of instrument phrases.

To start, build a tool with just one button. In the button properties, learn to use “midi_mapping” to be able to fire a function.

Here you have a simple function to select a specific phrase (if the phrase does not exist, it will not do anything, it will not return any errors).

--function for select a phrase
local function phrase_selector(val)
  local song=renoise.song()
  local max=#song.selected_instrument.phrases
  if (max>=val) then
    song.selected_phrase_index=val
  end
end

--bang!
phrase_selector(5)

This function will select the number 5 phrase of the selected instrument.

If you just create a button and get it to work, you can understand it to create more buttons. And with that make the tool you want.

And if you don’t want a window tool, you can also use MIDI links with a windowless tool. You would only have to access the Renoise MIDI Mapping window to find the tool links, and then assign them to your physical controls.

To add a MIDI link, look for:

-- Add a new midi_mapping entry as described above.
renoise.tool():add_midi_mapping(midi_mapping_definition_table)

--[[
midi_mappings: Extend Renoise's default MIDI mapping set, or add custom MIDI
mappings for your tools.

The Lua table passed to 'add_midi_mapping' is defined as:

* Required fields:
  + ["name"] = The group, name of the midi mapping; as visible to the user.
  + ["invoke"] = A function that is called to handle a bound MIDI message.
]]

I use AKAI MPD26.

That sounds great, but first I have to figure out how to make a button. Apparently you underestimated how far I am from such things. In fact, I realized that you can change the renoise function the day before yesterday, from your message. Before that, I did not know that such things were possible at all. Perhaps it’s worth trying to figure out how it works.
The biggest problem is that it’s not clear how to assemble the tool step by step. That is, if you open the Scripting terminal and editor, then there will be many files and all of them contain scripts. You can figure out how to write messages, understand which variables to assign to the parameters, make them similar to other scripts, but it is completely unclear how to make the tool window appear, draw handles and buttons in it, how to bind this script to a specific button, how to make it determined by the controller. For a person far from programming, this is quite complicated. In fact, although in general this would be interesting to understand, but I would prefer that there was a ready-made tool that allows me to simply assign the buttons in it))

:grinning:

If you want, I build a tool with a button. Then you can try to make it work.

Your controller has 16 pads with 4 banks, 64 assignments per channel. It would possible to create a tool for those pads.

It could be a window with 16 square buttons, and then a 4-position switch for the 4 banks; build 16x 4 buttons. I don’t have time to build it. Maybe someone is interested in doing it for you. Do you really need such a tool? Just out of curiosity, would you be willing to support a programmer to build it for you?

Why not?) I’d appreciated if someone made something like this. (Of course for a reasonable price). And not for me personally but for everyone)
I think, it would be nice if someone made a good tool that includes not only this function and also consisting not only of 16 pads, but, possibly, with some other useful things. It seems to me it could be quite usefull tool)
And I really don’t understand, why function of mapping and triggering phrases in pgm mode is still absent in Renoise, because keymap mode doesn’t let play live at all. How this mode can be used? It turns out complete nonsense of sounds. How, for example, to make drum fill or harmonic sequence at the right time so that it does not mix with an already playing track? Why it is so different from using of Zxx command? Or is the keymap mode have to be used in a different way?

With the Keymap mode you can use each note to trigger the assigned phrase. You can assign the 120 notes, each note to a different phrase of the current instrument. Is this not what you want?
The Program mode allows you to play the selected phrase with all piano notes.

If you assign each pad of your midi controller to a note, you can shoot the assigned phrase with the Keymap mode.

For example:

  • Pad 1 --> C-4 --> Phrase 01
  • Pad 2 --> C#4 --> Phrase 02
  • Pad 3 --> D-4 --> Phrase 03
  • Pad 4 --> D#4 --> Phrase 04
  • Pad 5 --> E-4 --> Phrase 05
  • Etc.

Surely your MIDI controller already has some assigned notes, and that you can change the 4 banks to change octaves. With the Akai software you can even change the note assignments for each pad.
Try all this before.

Anyway, a tool would facilitate the use enormously. That’s what they are for.

If the Keymap mode confuses you, it’s as if you converted a phrase into a sample. Is “the same”.

Probably, I’m still explaining very poorly what I need) But let me try again once we have taken up this discussion) I’m saying that the keymap mode logic seems wrong to me, it is not suitable for my purposes. I’ve tried to assign phrases to notes as you describe before. Everything is ok with this, but that is not the point. Look. Suppose you create a drum rhythm on track 1. For example, kick and snare, playing 4th notes. Let’s say you have created rhythmic phrases (for example, 8th notes, triplets, 16th or may be some kind of breaks). Assign these phrases to notes in keymap mode). Then you start the track with the created rhythm and want to vary it with these phrases, from time to time launching them at the right time. For example, to create drum fillings when moving from one meadure to another. In this case, the phrases and the rhythm playing at this time will play simultaneously. But this is wrong. Can you imagine how the 4th notes in rhythm and triplets will sound at the same time? This breaks the whole structure and idea of ​​the track. The use of the Zxx command is a completely different matter. If you put, for example, Z02, for example, with the triplet template, then the phrase will sound not adding to the rhythm, but by itself and last until the next note. This is the right approach, and I always use it, but prescribing commands is not suitable for varying the rhythm in real time. However, if you trigger phrases with the mouse in pgm mode, they sound like when you executed the Zxx command. That is, it is necessary that, either in keymap mode, the sound of phrases is not added to the sounding track, but changes it or that it is possible to assign phrases to pads of the controller in pgm mode. It is very difficult to explain, but it is a completely useful and clever thing. Of course, I admit that I may simply incorrectly configure and use keymap mode, but nowhere is it written how to do as I need. In my opinion, how this function is implemented now makes keymap useless. May be this topic should be moved in Ideas & Suggestion…

I’m not sure if this what you want for your exact situation, but the Instr. MIDI Control device can use Program Change messages to switch phrases (though this is best for instruments that only use samples, since this will still change the program for Plugin and MIDI components).

@Achenar. Yes, with Prg-Change you can change the phrases with the fader. The physical control would be a range knob (0 to 127), only using 1 to 126.

But he wants to be able to jump directly to the corresponding phrase. AFAIK the Prg-Change fader does not allow the MIDI assignment of multiple physical pads, each for a given phrase, which is what it seems he is looking for.

It seems that he needs to somehow automate in live the jump of the phrases in the Program mode. That information must be reflected in some way in the automation (parameters in the pattern editor or points in the automation editor).

I do not know exactly the situation, but it seems that you want to use the same notes so that they sound normal and so that from time to time you can shoot phrases without the notes written on the track will sound and the phrases do not overlap (do not sound at the same time).

With a window tool it is easy to change the selection of the phrase directly (a window with 16 buttons). But it’s just that, change the selection on the fly. I would need something else to be able to record it and to keep the changes preserved. One thing is to play live, and another thing is to play live recording.

That is what I have understood. We can keep commenting things until we find a direct solution. Selecting the phrase on the fly with a tool is very easy. But I have doubts about the recording “somewhere” so that each change is permanent.

Apparently, using Prg-Change with the mouse could change the jump of the phrase you want with the right button one by one.
A well-made tool could detect if the first device “* MIDI Control Instruction” exists within the DSP chain of the current track, detect if the Prg-Change parameter exists, if it is activated or not (if not activate it) and be able to change the Prg value on the fly directly from each virtual button in the tool window.

It is a bit fuzzy, but by doing this, I think the automation parameter would be saved in the effects column of the selected track. This would allow live recording with automation, directly.

Ok. with several Hydras added to the chain and linked to the Instr device. MIDI Control (Prg-Change parameter) it is possible to assign a physical pad of a MIDI controller one by one. Each Hydra is 9 outputs. It is a bit convoluted and laborious, but it is possible.

However, this would only work on the current track. You change track and you will have to repeat all those assignment steps.

A well-made tool would work on all tracks, but it would need the Instr device. MIDI Control to automate.

Any other alternatives? The problem is not the selection, but the automation.

Thank you, guys!!! Raul, you was right! I managed to configure mpd26! Don’t know why I didn’t succeed earlier!( Now I am ashamed that I am such a moron and could not figure it out earlier. Anyway I wouldn’t handled it without your help.
I really appreciate your efforts and the time you spent on me.

Idea with Hydra-control of midi-control I also tried, but its a bit complicated thing)))

1 Like

Oh, I’m glad it already works for you. To enjoy! :grinning:

Sometimes things cost to configure them…