Notes Being Able To Call Lua Scripts ;)

notes being able to call lua scripts ;)

Are we talking about a note which is being played from

A: an external keyboard or the PC keyboard, or
B: a note which has already been recorded into the song?

If it’s A, then you have the option to write a script which recognize keypresses and MIDI events, and do whatever you want with it. You can’t trigger an instrument directly, but you can write something into the pattern (been working on a sequencer which does exactly that)

If it’s B, then you can monitor the song as it’s playing, but you’ll have to figure out which notes to look for, and how to look for them. Unfortunately, there’s no “this instrument just played something” notifier we can use, so the script is limited to idle-time notifications (the GUI-rate runs at about 10-20 times per second)

I’ll try and explain without resorting to drawing it out…
There’s multiple functionalities in this - as one would expect.

Let’s go with one aspect of it.

–Pattern note modulation by pckeyboard/midikeyboard input into lua gui script

You have a pattern with notes on a melodic instrument - to keep things simple. The data on the pattern contains both note-data and rhythmic-placement-data (where and when and for how long a note is, in the grid, so to speak) now, you select this pattern and copy it to clipboard - and paste it into the gui script. This now shows that a bunch of notedata for an instrument has been placed into the gui, and now you press a key, Q. As long as you hold the Q-key down, this pattern of notes (which is similarly imported into the gui script as it is in the renoise song you are working on) will play. Because playing C4 is the equivalent of playing this collection of midinotes - just as it would be if you were to render the midinotes and play c4 from your laptop keyboard. This is as expected. However. You do two things - and I’ll try to describe the one after the other.

First - when you have a simple run of notes in the gui, notes of C-C-C-D - for instance, playing them at C4 plays them as that. However, let’s press W on the keyboard, in the gui. This C-C-C-D changed into, D-D-D-E. I’m now able to use the pc keyboard, to non-destructively modulate, a pattern of notes, and to thusly be able to play things that I might not know how to play but accidentally hit on them by means of this midi-transposition.
But you actually ended up pasting a pattern of notes known as chords - of the major kind. Now when you press down Q - the chords play in their own rhythm, as has been set-in by you, after which you pasted it into the gui. But now you decide to hold down a minor chord with your midikeyboard or laptop keyboard. The pattern of notes in the gui - of major chords, gets modulated to the minor chords you are setting down by you basically defining “how” to play your midinotes by the gui script.

And then you press “imprint” and it is in your actual renoise pattern.

now, what if you just wanted to “play a different chord yourself and ditch the pattern of notes in the script - yet retain the rhythmic placement data of a note?” - you’d just use the gui script to dump the notes (and, if you like, the instrument numbers - for, obviously you could import a drumkit pattern into the script and trigger it and toggle it on and off with the keyboard on the gui but that’s a different story for later) out of what is on the gui script clipboard. then you’d just basically have note delays, note off commands, and rhythmic triggers left. Now, this allows for a template-like building of materials - especially for those who can’t just play it in easily live (fighting with latency and poor keyboard playing skills). Surely if you are able to get a rhythm into a renoise pattern editor pattern (ta-taa-ta-ta-taa-taa-taa), this qualifies you to play this rhythm out through the gui with a different note - thus providing an on-the-fly method of playing in ideas - already with the correct rhythmic phrasing.

(ta-taa-ta-ta-taa-taa-taa) becomes  
``` when you but hold down those keys as a chord, or just press T instead of Q on the pckeyboard. -- or, during playback, holding down those notes relaxedly while the rhythmic pattern plays it according to your specs) - thus modulating the clipboard pattern on-the-go.  
ok, there's nothing here yet about notes in the regular renoise pattern being able to call instances of the script-gui so that out come arpeggiated transposed modulated harmonies according to pattern-editor-note->script-note. but that'd be the next. this is in concordance with the concept of having clips of notes/noteruns in a track-specific stash (or a renoise clip library of your own) and then being able to transpose them and reharmonize them on-the-fly. and of having either "meant for melody" rhythmic patterns or "meant for drums" rhythmic patterns for insta-arpeggiation according to your own specified and wanted style. ]]] but if we're to keep to how renoise would probably call it - we'd have an instrument box and a note box/pattern box for said instrument(s). This would allow for for instance writing a melodic line and playing it through multiple instruments with one key Q - would allow for quite the polyphonic immersion - especially since if we were to go where the api doesn't let us go (and.. well, might never be advanced enough to do) -- defining the instrument routings would also define how quickly the notes are passed from the script to the instruments, per-instrument, so that you could try a bass at halfspeed and melodies at a regular speed and maybe those chords would be playing at a really low tempo, allowing you to have chords which have originally only been a length of 8 rows, take the span of 512 rows - == [b]non-destructive auto-expand/auto-shrink[/b] with transposition/modulation capabilities.

Could this be done with Notifiers on a Track?

Record Enabled so you are writing to the track.

LUA script monitors specific tracks for certain notes, so a C4 in Track Rhythms would paste a certain drum pattern to a selection of other tracks.

E5 in your Bass track would change a different set of patterns/tracks.

The if you want to play something live you move into a track with no Notifiers and play it normally.

Or can you not put notifiers on specific tracks only? Or would this still be a little too restrictive for you?


you almost lost me at “thusly”…

anyhow this shouldn’t be too difficult to do within renoise using CTRLR as a vst instance. You can build panels that do whatever the hell you want in Lua as long as your host speaks and understand Lua. . .

now if only we could convince the renoise devs to allow VST instrument types to speak and understand MIDI. that would be wonderful.

actually the above (about VST instrument types not being able to speak MIDI) is a roadblock to my suggestion of using CTRLR within a renoise VST instrument to get you from here to there… maybe someone else can help.