Bug Or Not? Sample Mappings Observable

The sample_mappings_observable doesn’t seem to fire?

I’ve tried moving, deleting, transposing samples…
Maybe I’m looking for the wrong kind of observable.

I want to monitor changes to the keyzone. Am I doing this the right way?

instr.sample_mappings_observable[1]:add_notifier(  
 function(notifier)  
 print("sample_mappings_observable fired...")  
 end  
)  
  

If you add a new mapping for the sample it seems to trigger the notifier twice. as does deleting an existing one.

Changing an existing keyzone for the sample doesn’t appear to trigger it at all though.

So it seems to Observe the index table of mappings, rather than the properties of any of the mappings for the sample.

Can you attach a notifier to a Zone?

Main 3 Observables would be these for Zone properties.

– Mappings base note. Final pitch of the palyed sample is:
– played_note - mapping.base_note + sample.transpose + sample.finetune
renoise.song().instruments[].sample_mappings[].base_note, _observable
-> [number (0-119, c-4=48)]

– Note range the mapping is triggered for.
renoise.song().instruments[].sample_mappings[].note_range, _observable
-> [table with two numbers (0-119, c-4=48)]

– Velocity range the mapping is triggered for.
renoise.song().instruments[].sample_mappings[].velocity_range, _observable
-> [table with two numbers (0-127)]

I assigned the notifier for the selected instrument, sample mappings layer 1 and 2 (on/off), but never managed to get it to fire, no matter what I did.
You say you were adding and removing mappings, as in right-click keyzone, select “add new” (or remove)?

Yes, I want to avoid observing individual properties as much as possible. Although note-range might be necessary - as I understand you, you are saying that changes to a sample mapping does not trigger the sample_mappings observable, which makes perfect sense.

Exactly.

Strangely layer[1] (Note On) fired my Print command twice for each one added/removed, layer[2] (Note Off) fired it only once.

So it seems. It’s checking for a change in the Mappings Table (or similar.) Now if there was a Zone Object, which contained all the information such as Note and Velocity Ranges, then an observable on this I think would be what you were expecting, although maybe you would have to attach to individual Zones… As far as my quick search of the documentation went the parameters only seem observable separately via the methods mentioned in my previous post.

Although I’ve just tried and I must be doing something wrong as I can only get Nil for any of those entries…