Vader (Need Help)

Help me. Please.

Some time ago I mentioned I was working on a mysterious tool that would be a ‘cool little toy’ when it would be finished. Well, it’s NOT finished, but I’m running into problems that I cannot solve, so I’m forced to post the current version here, and hope that someone from the dev team explains what is going wrong. I’m really sorry about the state of the code, it’s messy and confusing with loose bits hanging out, and more TODOs than you can count. But whatever is going on there seems to bring renoise down burning. It does not happen regularly, but in an erratic manner. Also this posting might help to find out if it’s just me and my setup that causes the crashing. I’m kinda hoping that it WILL crash on someone that can explain why this happens. I’ve tried some fixes, but nothing I’ve done seems to make it stable.

Anyway. My tool’s called vader. It’s an acronym for Very ADvanced Editing in Renoise. And it sounded cool enough so…, yeah. It’s vader. It’s basically a command line for advanced editing. The background here is that I wanted a way to humanize my drums without going to the ‘checkbox avenue’ that is advanced edit panel. And… it kinda took flight. The result… not yet finished, but I think I’ll be able to humanize my drums with this too. :) This became more of a ‘multitool’, really. A swiss knife for doing advanced pattern editing, and doing them without the mouse. The main point here is the repeating part. I fully understand that it’s not feasible to do advanced editing by writing command line commands. That’s too geeky, even for me. I’m going for repeating stuff, macros, stored vader-scripts with dedicated keybinds and such. They’re not yet here, but I’ve planned them out in my mind. Too bad this crashing thing got me ‘releasing’ this way too early. (not really even an alpha version!) It’s not finished. Not. Finished.

If you manage to install this (I think it shouldn’t give any trouble there), you’ll notice some new menu items in Tools-menu, and new keybindings under Global:Tools. The working ones are for now the ‘open command line’ and ‘repeat last’ -items.

I won’t go into the very details of the command line syntax just yet, because it’s probably going to change. But i just need to get this thing stable first… For now, i suggest you try out some basic commands in current syntax such as: (you can copy-paste from here if you like)
t4
(will change selected track to track 4)
t"l6
(will change selected track to the last track, and line to number 6 (in lua-indices that is. 05 in renoise))
c"
(jump to the last note column (visible), aww shoot. this does not work yet. sorry. just tested it. use c[number] instead)
e_
(jump to the first effect column (visible), the min value seems to work right.)
v:20
(will change current note column’s volume entry into 20 (decimal). you need to be on a note column)
d:60
(will change current note column’s delay entry into 60 (decimal). need to be on a note column)
f:05
(current effect column fx number set to 05. be on an effect column)
x:11
(current effect column fx amount set to 11 (decimals). be on an effect column)
v:o
(current note column volume set to empty. be on a note column)

These are simple commands that are not likely to crash-boom, but I’ve seen that happen too.
For something that will most probably crash: try
t(t+1)…(t)l_…(l+5)a:16
(this will make the panning value 16 for a range of this track plus the next one, lines from the first line to this line plus 5)

Commands like these won’t crash always. They’re just way more likely to do it. And the seemingly random unstability is just what’s troubling about it, at least for me.

There’s more, but I think this would suffice for now… You can fool around with the tool of course, and I can break the syntax down for you if you want, and if it helps to track down the weirdo-bug, but you should remember that this is not the final version…

While you try these commands, on some point renoise will throw you an error dialog.

There’s two kinds of errors here, the safer type brings up an error dialog about notifiers. You’ll get that most probably because I haven’t yet set some basic safeguards for checking the maximum values of say tracks. If you notice that vader becomes unresponsive, (e.g the prompt won’t react when you hit enter) hit ‘reload all tools’ from the tools-menu and it should be fine and dandy again. This is the type of error i can iron out with my humble skills.

The second type of ‘error’ is a notice about a fatal error in GUI thread (or something). This will KILL YOUR RENOISE. So whatever you do, don’t use this tool on a critical project. And this is the kind of error I haven’t been able to work out. I have some suspects, but I haven’t been able to verify these. Seems everything I try does nothing to the crashing.

My guesses so far:

  1. It could be the way I’m detaching and attaching the prompt textfield notifier in prompt_trigger() function for clearing the prompt up. I haven’t been able to crash with the ‘repeat last’ -command, in which the prompt is not accessed at all.
  2. It could be that renoise’s lua api is somehow ‘ahead of its time’ or ‘behind its time’ compared to the internal song structure, so that when I’m iterating over tracks, lines, columns et cetera, the api gives me false status of the actual data structure. This would be weird, though, because the iteration ALWAYS FINISHES, after which there is a crash.
  3. It’s got something to do with the iteration in process(). The most times I crash it’s when I use the ranged scoping (e.g. t_…"l_…"d:o ,(set all tracks, all lines this column delay value to empty))
  4. ???

I don’t know. But whatever it is, It’s also probably important for the dev team to check this out, because it seems like a bug in renoise. I should not be able to bring the program down with a script, right? (And again… I’m sorry about the state of the code. I’ll be happy to explain the cryptic spaghetti if you need me to. But I warn you that it’s sometimes hard to decipher for me too… And I hope you’re not the easily offended type, there might be some f-words in there. Sorry 'bout that. ;) )

Some basic stuff for anyone interested in fooling around and crashing renoise while at it:
-Bind the keyshortcut for bringing up the prompt. This will bring the prompt up when hit. And refocus the prompt textfield when it’s not focused.
-The prompt has two ‘modes’, if you will. When the textfield is focused, you are in what i refer to as ‘edit mode’. When it’s not focused (press esc when the textfield IS focused), you’ll be in ‘browse mode’. From here you can access the command line history. When in ‘browse mode’, you should be able to enter the commands by selecting them (up and down arrow keys), and hitting enter.
-Bind the repeat last command key. Hitting this will (duh) repeat the last command. (note: I’ve NEVER been able to crash this tool when using this. This is why I’m kinda suspecting the textfield notifier-hacking. If you can crash vader when using repeat, please report.)

I’m running renoise 2.7.2 on OS X 10.6.8.

I’ll post the essential part of my latest crashlog (I think this is the essential part…).

Click to view contents

CrashLog: 0 libSystem.B.dylib 0x9890705b _sigtramp + 43
CrashLog: 1 ??? 0xffffffff 0x0 + 4294967295
CrashLog: 2 Renoise 0x00582b41 0x0 + 5778241
CrashLog: 3 Renoise 0x006b4a8c 0x0 + 7031436
CrashLog: 4 Renoise 0x00582b41 0x0 + 5778241
CrashLog: 5 Renoise 0x00770fe0 0x0 + 7802848
CrashLog: 6 Renoise 0x00775d11 0x0 + 7822609
CrashLog: 7 Renoise 0x00729a15 0x0 + 7510549
CrashLog: 8 Renoise 0x00729bc6 0x0 + 7510982
CrashLog: 9 Renoise 0x0076fb27 0x0 + 7797543
CrashLog: 10 Renoise 0x00771654 0x0 + 7804500
CrashLog: 11 Renoise 0x00777a1f 0x0 + 7830047
CrashLog: 12 Renoise 0x00722ae1 0x0 + 7482081
CrashLog: 13 Renoise 0x00777800 0x0 + 7829504
CrashLog: 14 Renoise 0x00742992 0x0 + 7612818
CrashLog: 15 Renoise 0x0074336a 0x0 + 7615338
CrashLog: 16 Renoise 0x0077db31 0x0 + 7854897
CrashLog: 17 Renoise 0x0063b11c 0x0 + 6533404
CrashLog: 18 Renoise 0x005f8c3e 0x0 + 6261822
CrashLog: 19 Renoise 0x0062936c 0x0 + 6460268
CrashLog: 20 AppKit 0x9419d867 -[NSKeyBindingManager(NSKeyBindingManager_MultiClients) interpretEventAsCommand:forClient:] + 1911
CrashLog: 21 AppKit 0x941a111b -[NSTextInputContext handleEvent:] + 1604
CrashLog: 22 AppKit 0x9419ced1 -[NSView interpretKeyEvents:] + 209
CrashLog: 23 Renoise 0x0062d98b 0x0 + 6478219
CrashLog: 24 Renoise 0x0062df44 0x0 + 6479684
CrashLog: 25 Renoise 0x0061a127 0x0 + 6398247
CrashLog: 26 Renoise 0x00619ff0 0x0 + 6397936
CrashLog: 27 Renoise 0x005e68f0 0x0 + 6187248
CrashLog: 28 Renoise 0x000c5d5f 0x0 + 810335
CrashLog: 29 Renoise 0x00512c73 0x0 + 5319795
CrashLog: 30 Renoise 0x00018522 0x0 + 99618
CrashLog: 31 Renoise 0x00018449 0x0 + 99401

Application: Caught an unhandled exception (Thread: GUI)!
Application: Saving a backup…

Error Message: A fatal error or crash occurred (unhandled exception in thread: GUI).
Error Message: A backup of the current document was saved at
Error Message: ‘/Users/samppahannikainen/Library/Preferences/Renoise/V2.7.2/CrashBackups/Untitled_10_22_2011__17_28_crash.xrns’…
Error Message: This either happened because of a bug in Renoise, or because of a bug in one of its loaded components (plugins). Please contact and report this problem, so that it can be fixed.

Error Message: Note: It’s very important that we know exactly what has happened (what you were doing before this message popped up), or the problem cannot be replicated/analyzed. Please include a description of what you were doing and which components were being used…



Application: Terminating…



CoreAudio: Stopping Device ‘Apple Inc.: Built-in Output’…

CoreAudio: Releasing Device ‘Apple Inc.: Built-in Output’…

CoreAudio: Device is down



MIDI: Shut down: Closing all acquired MIDI devices…




So I guess all I'm asking is: please, pleeeaaase, help me work this thing out.

Happy crashing!

I have been working on a tool which modified automation data. This definitely could cause a crash in the current version (has already been fixed for the next one).
If you are dealing with automation, perhaps you could leave out that part and see if it still works?

Btw: Vader sounds like an amazing tool :slight_smile:

I’m not touching automation data, I’m afraid. But thanks for the reply! (I, also think it will rock when finished… :P )

Well, I can confirm the crash.

Click to view contents

CrashLog: 0 libSystem.B.dylib 0x934c505b _sigtramp + 43
CrashLog: 1 ??? 0xffffffff 0x0 + 4294967295
CrashLog: 2 Renoise 0x0000c530 0x0 + 50480
CrashLog: 3 Renoise 0x0069113c 0x0 + 6885692
CrashLog: 4 Renoise 0x0069ab80 0x0 + 6925184
CrashLog: 5 Renoise 0x00582b41 0x0 + 5778241
CrashLog: 6 Renoise 0x00582b41 0x0 + 5778241
CrashLog: 7 Renoise 0x006b4a8c 0x0 + 7031436
CrashLog: 8 Renoise 0x00582b41 0x0 + 5778241
CrashLog: 9 Renoise 0x00770fe0 0x0 + 7802848
CrashLog: 10 Renoise 0x00775d11 0x0 + 7822609
CrashLog: 11 Renoise 0x00729a15 0x0 + 7510549
CrashLog: 12 Renoise 0x00729bc6 0x0 + 7510982
CrashLog: 13 Renoise 0x0076fb27 0x0 + 7797543
CrashLog: 14 Renoise 0x00771654 0x0 + 7804500
CrashLog: 15 Renoise 0x00777a1f 0x0 + 7830047
CrashLog: 16 Renoise 0x00722ae1 0x0 + 7482081
CrashLog: 17 Renoise 0x00777800 0x0 + 7829504
CrashLog: 18 Renoise 0x00742992 0x0 + 7612818
CrashLog: 19 Renoise 0x0074336a 0x0 + 7615338
CrashLog: 20 Renoise 0x0077db31 0x0 + 7854897
CrashLog: 21 Renoise 0x0063b11c 0x0 + 6533404
CrashLog: 22 Renoise 0x005f8c3e 0x0 + 6261822
CrashLog: 23 Renoise 0x0062936c 0x0 + 6460268
CrashLog: 24 AppKit 0x95562867 -[NSKeyBindingManager(NSKeyBindingManager_MultiClients) interpretEventAsCommand:forClient:] + 1911
CrashLog: 25 AppKit 0x9556611b -[NSTextInputContext handleEvent:] + 1604
CrashLog: 26 AppKit 0x95561ed1 -[NSView interpretKeyEvents:] + 209
CrashLog: 27 Renoise 0x0062d98b 0x0 + 6478219
CrashLog: 28 Renoise 0x0062df44 0x0 + 6479684
CrashLog: 29 Renoise 0x0061a127 0x0 + 6398247
CrashLog: 30 Renoise 0x00619ff0 0x0 + 6397936
CrashLog: 31 Renoise 0x005e68f0 0x0 + 6187248
CrashLog: 32 Renoise 0x000c5d5f 0x0 + 810335
CrashLog: 33 Renoise 0x00512c73 0x0 + 5319795
CrashLog: 34 Renoise 0x00018522 0x0 + 99618
CrashLog: 35 Renoise 0x00018449 0x0 + 99401

The code is a bit daunting for anyone to try to debug this… Anyway, my attempt:

When I comment out line ~3185 e.g.

  
 -- if dialog and dialog.visible then dialog:close() end  
  

I can no longer crash the app. (Or at least, it didn’t crash while testing, where as with this line enabled it would easily crash)

From what I can see, you’ve wrapped a bunch of calls in OneShotCondWatcher() that messes with ‘prompt’ where ‘prompt’ is bound in ‘content’ and content can be destroyed before OneShotCondWatcher() is triggered.

This is not scientific at all. It could be that if I try again, it will crash. I have no proof that it no longer crashes. Just that it didn’t crash on demand.

Cheers.

Non-scientific is good enough, if it works. And this certainly A)makes sense, B)seems to fix it! Wow. Haven’t done extensive testing, but as I said, the reasoning sounds right. And I would’ve not noticed that by myself. It starts to make sense now… I can decipher from the code that the whole ‘close dialog’ thing has been either a hasty add, or completely overlooked… OK. Yeah. I believe you’ve nailed it. :yeah: :yeah:

Or if you haven’t, I’ll be back to haunt this forum.

Thank you for taking your time with this, I really appreciate it!

EDIT:
happy happy joy joy! happy happy joy joy!