The Api Wishlist Thread


(danoise) #121

Basically, we have two methods for scheduling a pattern using the API:

  
-- Append the sequence to the scheduled sequence list. Scheduled playback  
-- positions will apply as soon as the currently playing pattern play to end.  
renoise.song().transport:add_scheduled_sequence(sequence_pos)  
  
-- Replace the scheduled sequence list with the given sequence.  
renoise.song().transport:set_scheduled_sequence(sequence_pos)  
  

But, unfortunately there are still important aspects that are missing.
Please correct me if I’m wrong, or some kind of workaround exist :slight_smile:

1.It’s not possible to clear a schedule once it has been set
I imagine this could be implemented simply by calling set_scheduled_sequence with no argument,
or we could have a dedicated clear_scheduled_sequence method?

  1. It’s not possible to read or observe the schedule list
    This is something that has been a showstopper for me on a number of occasions.
    It would be nice if we could at least access/read the list, and act accordingly.

(vV) #122

*Instr. MIDI Control -> parameter[0] = linked_instrument(_observable)
*Instr. Automation -> parameter[0] = linked_plugin(_observable)


(danoise) #123

I am trying to do something seemingly simple here,
Ignore any changes to mute-states in the pattern matrix when tracks are being swapped

But, the thing is that the notifier for tracks is being called after the mute slots notifier!
Not sure that makes sense, so consider it a API request that the calling order is changed:
General principle: if event (foo) can cause a successive event (bar), always put foo before bar

I have found myself come up with a hackaround which works only when tracks are
deleted or inserted: basically, check the number of tracks against a memorized number,
and allow the handler to continue only if the number has changed. However, this will
not work when tracks are swapped, as the number would be the same


(Cas) #124
renoise.song().transport.playback_pos_beats_observable  

(integer)
to make those lights blink every beat.
it’s fine if it’s called metronome_beats_observable or sth instead.

more importantly: a api call for all or many of the sample editors buttons like “process track dsps”


(artfwo) #125

+1 for the canvas.


(Cas) #126
device(...):parameter(...).value_to_string(x)  
device(...):parameter(...).parse_string(x)  

to read how “1%” or arbitrary values would be viewed in renoise, to make accessible in tool windows


(KMaki) #127

I’d like to see a ViewBuilder Valuefield element property “edit_mode”, similar to Textfield element.

The background for this is that right now it seems overly complicated to make a dialog that would have a valuefield that you could focus with a keypress event, in turn making it hard to build keyboard driven tool dialogs.

It’s possible to hack around this using the Textfield element, but the valuefield edit_mode would seem like a more developer friendly solution.


(Cas) #128
  
renoise.song():track(t).available_devices[d].available_presets  
  

(trying to make a proper version out of the “Dancealot” tool that would provide improved ways of adding dsp to a track, e.g. with instant preset handling)


(Cas) #129

setting edit pos (horizontal in this case) more precisely, like cursor movements, as in put edit pos on vol/pan/delay columns…


(vV) #130

What would you like to do on those positions? because the contents of the cell includes handles to the vol/pan/delay columns…


(Cas) #131

as shortcuts for:

  
renoise.song():pattern(renoise.song().sequencer:pattern(renoise.song().transport.edit_pos.sequence))  
renoise.song():pattern(renoise.song().sequencer:pattern(renoise.song().transport.play_pos.sequence))  
  

(kazakore) #132

EDITs (further reading of the code repository and it comes clearer. You’re after the renoise.pattern object.)

Anyway you haven’t actually included your suggested names for the functions ;)

So it would be:
renoise.song():selected_pattern (for at edit position)
and
renoise.song():playing_pattern (for at play position)

Maybe…


(Cas) #133

Yeah something like that. I didn’t delete the post but I was so stupid to make it a new topic. Exqueeze me.
as for the names, yes, only that the : colons will actually be . points, and naming well anything that makes it very clear you can have 2 positions. maybe just a loose function that returns the pattern belonging to a songpos, but that would be probably only used in conjunction with either edit_pos or playing_pos.


(Cas) #134

Glad you ask. I just made a small tool called MiniTab that provides kb shortcuts which make about the same movements as Tab/Shift-Tab normally, with the only difference (now) being they don’t skip effect columns. At first I wanted it to also have shortcuts to move through v/p/d columns, just because it’s always 3 times to the right (cause I never edit instrument number by hand)… it’s a minor glitch/missing thing in my eyes.
Also, please note that I might just scream bullshit out loud sometimes convinced that I got the only truth, it might have sth to do with me moving from normal 104 key keyboard to laptop keyboard with very different layout so I’m setting up to move comfortably. For me this brings new things like making <50 LOC tools just to be able to do things with one keystroke instead of 2. or 3.


(Cas) #135

function to take control of focus (set focus to sequencer etc)


(Cas) #136

more better undirected tree-ish stuff like (the first one was requested before)

  
renoise.song():track(t).track_index  
renoise.song():track(t):device(d).track_index or .track  
  

(mogue) #137

This is a great idea. I’d love to see like this for more abstract document traverse-ing. I have sometimes needed to construct functions that figure out the index or parent of an item which has huge overhead.

To put it in general terms; All objects that appear within a list in renoise.song() could use an .index property (returns a number) and a .parent property (returns an object).


(vV) #138

Yeah this was requested indeed and really necessary because tracks can get swapped (or renamed) and you then no longer know which track your script was working on because you have no unique number where you can rely on in that case.


(mogue) #139

Don’t forget the parent reference! When scripts get deep, with very abstract functions that are highly object oriented the need to traverse upwards from say a NoteColumn or TrackDevice becomes great. Currently you will often find yourself passing both a sample and it’s parent instrument to a function, this doesn’t sound too bad until you start passing these arguments through functions to other functions and returning tables with many objects just to retain your absolute document location.

EDIT: A parent_index would also suffice as suggested by Cas, but I think a direct reference to the object is more computationally effect as then we would skip looking up the object via. renoise.song():instrument(sample.parent_index) and we could directly access the index via. sample.parent.index


(Cas) #140

Yeah me too, well, I had to rip said function from a taktik comment I believe.

I think we should have both functions. It’s just as easy when making it in C, and helps clarity about doc traversing.
In the case of e.g. DeviceParameter a simple parent_index wouldn’t be enough though, so you’re definitely right about need for simple .parent props