New Tool (3.1): PhraseMate

I don’t know if this is a bug, but it’s certainly behavior that could be changed to make it way more useful to me :slight_smile:

Scenario: I’ve got the instrument on program mode, and play G-4 0Z01 to transpose pattern 01 up 7 semitones. Then I run PhraseMate’s “write pattern to selection”

Expected: it writes the pattern to the selection, transposed

Actual: it writes the exact pattern

So if I have all C-4 notes in my pattern, I would expect “write pattern” to result in all G-4 notes (because I played a G-4 in the pattern editor). Instead it writes all C-4 notes.

There might be a special case too (I don’t know) with ghost phrases: where I initially play C-4 01 0Z01 and follow it with G-4 __ 0Z01 – which continues the pattern, but transposes it.

If PhraseMate could write out the transposed pattern, it would become even more insanely useful to me :slight_smile:


I will put together a short XRNS that shows exactly what I want it to output, I think that’ll be more helpful.

Edit: I think I’ve misunderstood how writing phrases is supposed to work. I thought I could put the phrases in the pattern editor, and then writing phrases would “explode” them and replace each phrase with the corresponding notes. But it looks like it just replaces them with the currently selected phrase.


I think there’s definitely a bug writing phrases to a track when using keymap mode.

Setup: I have two phrases each assigned to a key in keymap mode. I have a 20 line (hex) pattern. On line 0 I play C-0 and on line 10 I play D-0. I select the whole pattern and choose “write phrase to selection in pattern”

Expected: PhraseMate writes out the phrases exactly

Actual: PhraseMate skips the first line of the second pattern. More specifically, it fails to write the note of the first line. It enters the instrument number on line 10 but not a note number.

Yup, PM is currently just ‘dumping’ the phrase into the pattern. It’s definitely planned to make this part more sophisticated!
A lot of the groundwork is already done, but also fraught with edge cases. So realistically it will eventually be able to what you ask, but limited to a single ‘source’ note column.

I’m currently refactoring some of my tools, PM included - so much shared code going around… will take a look at the issue you reported, after this is done

Yeah, once I understood how output worked, I was able to get some good stuff going with it.

In a nutshell, here’s the workflow I’m looking for:

  1. Write patterns

  2. Select all patterns and extract to phrases

  3. Wriite new patterns using phrases

  4. Select all patterns and expand phrases to patterns

1-3 are a reality and super quick today. 4 is the missing piece right now.

Anyway, the more I use PM, the more I love it, so thanks for all your hard work! Renoise + PM is helping me compose in a way I’ve dreamed of for a long time.

Just a little teaser - almost done with a bunch of new features for PhraseMate.

Property tab : (batch-) apply properties to all phrases in instrument.
Supports all phrase properties, including LPB, number of lines, looping etc.
This is cool, e.g. when you want to double the tempo of all phrases.

props_tab.png?raw=1

Preset tab - batch import and export of phrase presets (.xrnz files)
Much easier than having to save/import a single preset at a time…

presets_tab.png?raw=1

The (MIDI-mappable. keyboard shortcut-able) phrase navigation in the top also have gotten “remove” and “insert” buttons. Perhaps it should have duplicate too?
New phrases are created according to settings specified in the “New” tab.

I’m also going to take a good look at the Zxx implementation. My ideas:

  • Allow “any” instrument to have Zxx command added (not just the selected one)
  • Optionally: prefer the local effect-column (the one associated with the note-column)

As always, ideas and suggestions are welcome!

As always, ideas and suggestions are welcome!

https://forum.renoise.com/t/idea-macros/32135

You would launch the tool with a hotkey combo, a prompt shows up, you enter something and the script will import the data from the textfile with the same filename as something.That way we could build complex sets of data for e.g. chord progressions or whatever.

So for example if you wrote “Fsus4” at the prompt, the script would look for a textfile called “Fsus4.txt” (or just “Fsus4” without the .txt extension) and insert whatever is in that file into the pattern editor (at the cursor).

Very cool, I like it. Pretty sure I’d never have thought about such a streamlined option. And indeed, this tool already provides much of the necessary “wiring” (assuming, of course, that you can limit yourself to phrases - the language that this tool speaks).

The way you describe it, it’s more or less a question of specifying an “import folder” and then doing some on-the-fly matching against the contents of this folder as you’re typing…

But I would also like to do the same thing for phrases within instruments that are already loaded into Renoise (i.e. not having to save presets to disk first).

Here is a preview of the next PhraseMate, v1.7
Attachment 6998 not found.
Edit: the stable release is now up at the tool page

It contains the largest set of new features yet, and a number of stability improvements

FEATURE Anchor to selection more refined, now works both vertically and horizontally
FEATURE Continuous paste now able to recreate looped phrases
FEATURE ‘Smart write’ dialog (text-based phrase browser, supports saved .xrnz files)
FEATURE Ability to batch-apply properties to phrases (set or transform values)
FEATURE Import and Export of individual presets and entire preset banks
FEATURE “Insert” and “Remove” phrase buttons + more MIDI mappings
FEATURE Output: include Z00 command to ignore/disable phrase playback
FIXME Write to pattern: “expand columns” was broken in some scenarios
FIXME Continuous paste: last line is skipped
FIXME Auto-assign to keymap do not supports keymappings with gaps
FIXME When applying to selection, always output at the track containing the selection
CORE Refactored code to make more use of classes (xLib,vLib+cLib)

https://forum.renoise.com/t/idea-macros/32135

Done! It’s called the Smart Write dialog, and can be launched via keyboard shortcut or found in the ‘Write’ tab

smart_write.png?raw=1

Basically, it’s an auto-completing text dialog which searches through either (a) the instrument phrases or (b )phrases that are located in the ‘export path’ (export of phrases is another new feature)

It’s designed to be completely keyboard driven. In the picture above, I’ve entered “m”, and the dialog responds by showing the two saved entries matching this letter.
Pressing Return will select the first entry. You can also use the popup to select between all matching entries.

Once selected, pressing return again will apply the phrase, using the settings specified settings in the ‘Write’ tab
Also, while the dialog is focused, pressing TAB will bring focus to the text input and allow another search.
ESC closes the dialog.

‘C:\Users\MIKEHAM\AppData\Roaming\Renoise\V3.1.0\Scripts\Tools\com.renoise.PhraseMate.xrnx’ failed to execute in one of its menu entry functions.

Please contact the author (danoise [bjorn.nesby@gmail.com]) for assistance…

main.lua:426: attempt to index global ‘phrasemate’ (a nil value)

stack traceback:

main.lua:426: in function ‘show’

main.lua:85: in function main.lua:84

@Akiz: Good catch. This should be easy to fix.

Only, I wonder how you made it happen… Did you double-click the xrnx to launch/install it in Renoise?

Did some smaller tweaks and released v1.7 (see changelog)

A new feature is that you can choose to launch the tool at startup, but without showing the GUI.

This is pretty handy if you like the automatic insertion of Zxx commands, but can’t be bothered to see a dialog pop up every time you start Renoise.

Grab it from the tools page

Another release, v1.71.

As usual, grab it from thetools page(or add it to the tool updater).

Fixed a bug that would cause exports to be saved into an illegal location when export path not set.
Instead of complaining it would happily export to a folder called “:warning: Please select a path!” :blush:

Also, I added a feature to strip the prefixes that can (optionally) be set on export.
Should make presets survive a trip through the whole export/import/etc cycle without getting their names screwed up.

Finally, the keyboard shortcuts and MIDI mappings also had some trouble. Fixed that as well.

Excellent work being done here. What a fantastic tool!

In particular, the PhraseMate Smart Write update is very… well, smart. :wink: Lots of potential there.

To speed things up even further, the following two functions would be lovely:

(1) In the “Enter name of phrase field”: Allow the auto-complete/search to be optionally checkboxed for becoming hidden and disabled, only allowing for the precise manual text input + Return.

(2) In the “Mode” pull-down menu: Allow for a new option - Insert at pattern editor cursor. Meaning a one shot (1X times) writing at the current editor cursor position in the pattern editor. Would speed up things in the workflow quite a lot.

I’ll continue to test drive this tool further this next week when I have more time to explore it in depth.

Hey, thanks. I take it as a nice ‘you read my mind’ type complement.
Because, like I mentioned, I probably wouldn’t have come up with this idea myself.

(1) In the “Enter name of phrase field”: Allow the auto-complete/search to be optionally checkboxed for becoming hidden and disabled, only allowing for the precise manual text input + Return.

Not sure I get the advantage of having to type the entire name. I mean, you can do that anyway, usually it’s just not required?

(2) In the “Mode” pull-down menu: Allow for a new option - Insert at pattern editor cursor. Meaning a one shot (1X times) writing at the current editor cursor position in the pattern editor. Would speed up things in the workflow quite a lot.

Yes, absolutely - this was on the TODO list, just didn’t make it.
Actually I intended it as a switch, “relative to cursor position” or something like that. But now I can see that it might be better to have it as a separate mode. Because, then it can be accessed with keyboard shortcuts and via the smart-write dialog.

Another way to speed up the workflow would be if the dialog has a checkbox which, when enabled, would let you apply the phrase as soon as you make a match by typing and hitting return.

1.7 and 1.7.1 break phrase reading for me.

If I select part of a pattern and choose “Create phrase from selection” I get: “main.lua:148: variable ‘INPUT_SCOPE’ is not declared” and no phrase is created.

If I open the settings window and choose “Selection in pattern” and then click “Collect phrases” it shows the error: “./source/PhraseMateUI.lua:658: attempt to call method ‘invoke_task’ (a nil value)” and successfully creates the phrase.

1.7 and 1.7.1 break phrase reading for me.

I will put out a new version over the weekend to fix this.Thanks!

Hi Danoise!

Just wanted to report a script error message that I get.:

When I select content in the pattern and select “create phrase from selection” in the context menu to collect the content, I get this following error script message (input scope not declared) on the version 1.71

main.lua:148: variable ‘INPUT_SCOPE’ is not declared
stack traceback:
[C]: in function ‘_error’
[string “local mt = getmetatable(_G)…”]:29: in function <[string “local mt = getmetatable(_G)…”]:24>
main.lua:148: in function main.lua:146

Picture:https://postimg.org/image/tpxy5ni0j/

thanks for your hard work…

cheers!

I will put out a new version over the weekend to fix this

Ehe, yes, caught in a backlog of sorts. But it’s not forgotten.

khmmm :slight_smile:

Bugfix release v1.72. Get it from the tool page

FIXME [Read] Fixed error when using custom source/target instrument 
FIXME [Read] When using custom source + same instrument (target), it picked the wrong instrument as target (the next instrument in the list)
FIXME [Read] “Selection in pattern” : when cursor is parked in a different track than the one containing the selection, that track was used as the source
FIXME [Read] Using context menu to collect content accidentally got broken