Lua, create phrases, double clicking phrase may crash

Using Afta’s render & slice tool (https://forum.renoise.com/t/new-tool-3-0-render-and-slice/43102 ) I’ve rendered a 512 length pattern with a bpm of 348, lpb of 48 to a new instrument.

Double clicking the phrase icons above the keyboard, Renoise crashes;

CrashLog: Handling Exception! Code : C0000005

CrashLog: 00D51991: h9_ippsCos_64f_A50 +4BC251

CrashLog: 00A08E04: h9_ippsCos_64f_A50 +1736C4

CrashLog: 00E6CA9A: h9_ippsCos_64f_A50 +5D735A

CrashLog: 00E6CD06: h9_ippsCos_64f_A50 +5D75C6

CrashLog: 00E94628: h9_ippsCos_64f_A50 +5FEEE8

CrashLog: 00E57881: h9_ippsCos_64f_A50 +5C2141

CrashLog: 00E1A9F1: h9_ippsCos_64f_A50 +5852B1

CrashLog: 00E1AFC1: h9_ippsCos_64f_A50 +585881

CrashLog: 00E85CAC: h9_ippsCos_64f_A50 +5F056C

CrashLog: 00EE49A0: h9_ippsCos_64f_A50 +64F260

CrashLog: 00EBC741: h9_ippsCos_64f_A50 +627001

CrashLog: 00EEAC91: h9_ippsCos_64f_A50 +655551

CrashLog: 00EEB599: h9_ippsCos_64f_A50 +655E59

CrashLog: 76B5FD72: GetWindowLongW +004B3

CrashLog: 00EB2E3A: h9_ippsCos_64f_A50 +61D6FA

CrashLog: 00ED1FD8: h9_ippsCos_64f_A50 +63C898

CrashLog: 00EE038E: h9_ippsCos_64f_A50 +64AC4E

CrashLog: 00EE33C1: h9_ippsCos_64f_A50 +64DC81

CrashLog: 010700A6: h9_ippsCos_64f_A50 +7DA966

CrashLog: 0107056B: h9_ippsCos_64f_A50 +7DAE2B

CrashLog: 01071789: h9_ippsCos_64f_A50 +7DC049

CrashLog: 01071895: h9_ippsCos_64f_A50 +7DC155

CrashLog: 7797D3C9: BaseThreadInitThunk +00012

CrashLog: 777F1603: RtlInitializeExceptionChain +00063

CrashLog: 777F15D6: RtlInitializeExceptionChain +00036

Application: Caught an unhandled fatal 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: ‘C:\Users\plugexpert\AppData\Roaming\Renoise\V3.0.1\CrashBackups(348 bpm) ame_4_25_2015__13_58_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 bug@renoise.com 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…

DirectSound: Stop Polling…

DirectSound: Releasing Luidsprekers (E-MU 0202 | USB)…

MIDI: Shut down: Closing all acquired MIDI devices…

MIDI: Closing MME Midi-In device ‘LPD8’

MIDI: Closing MME Midi-In device ‘LPK25’

MIDI: Shutting down DirectMusic…

Trying to replicate the bug, now Afta’s tool also crashed, but still made a new render & sliced instrument, double clicking the phrase icon on this instrument also results in a crash;

ScriptingEngine: std::logic_error: ‘can not insert a new phrase at the given index. check with ‘can_insert_phrase’ first and/or adjust mapping ranges.’

stack traceback:

[C]: in function ‘insert_phrase_at’

main.lua:205: in function ‘notes_to_slices’

main.lua:334: in function main.lua:292

Error Message: ‘C:\Users\plugexpert\AppData\Roaming\Renoise\V3.0.1\Scripts\Tools\com.afta8.RenderAndSlice.xrnx\main.lua’ failed in one of its notifiers.

Error Message: Please contact the author (afta8 | fathand@gmail.com ) for assistance…

Error Message: std::logic_error: ‘can not insert a new phrase at the given index. check with ‘can_insert_phrase’ first and/or adjust mapping ranges.’

Error Message: stack traceback:

Error Message: [C]: in function ‘insert_phrase_at’

Error Message: main.lua:205: in function ‘notes_to_slices’

Error Message: main.lua:334: in function main.lua:292

GraphPort: Trying to load Fallbackfont: ‘Arial Unicode MS’ (PS-Name: ‘’)…

GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping…

GraphPort: Trying to load Fallbackfont: ‘MS PGothic’ (PS-Name: ‘’)…

GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping…

GraphPort: Trying to load Fallbackfont: ‘MS Gothic’ (PS-Name: ‘’)…

GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping…

RenderToDisk: Rendering finished…

CrashLog: Handling Exception! Code : C0000005

CrashLog: 00D51991: h9_ippsCos_64f_A50 +4BC251

CrashLog: 00A08E04: h9_ippsCos_64f_A50 +1736C4

CrashLog: 00E6CA9A: h9_ippsCos_64f_A50 +5D735A

CrashLog: 00E6CD06: h9_ippsCos_64f_A50 +5D75C6

CrashLog: 00E94628: h9_ippsCos_64f_A50 +5FEEE8

CrashLog: 00E57881: h9_ippsCos_64f_A50 +5C2141

CrashLog: 00E1A9F1: h9_ippsCos_64f_A50 +5852B1

CrashLog: 00E1AFC1: h9_ippsCos_64f_A50 +585881

CrashLog: 00E85CAC: h9_ippsCos_64f_A50 +5F056C

CrashLog: 00EE49A0: h9_ippsCos_64f_A50 +64F260

CrashLog: 00EBC741: h9_ippsCos_64f_A50 +627001

CrashLog: 00EEAC91: h9_ippsCos_64f_A50 +655551

CrashLog: 00EEB599: h9_ippsCos_64f_A50 +655E59

CrashLog: 76B5FD72: GetWindowLongW +004B3

CrashLog: 00EB2E3A: h9_ippsCos_64f_A50 +61D6FA

CrashLog: 00ED1FD8: h9_ippsCos_64f_A50 +63C898

CrashLog: 00EE038E: h9_ippsCos_64f_A50 +64AC4E

CrashLog: 00EE33C1: h9_ippsCos_64f_A50 +64DC81

CrashLog: 010700A6: h9_ippsCos_64f_A50 +7DA966

CrashLog: 0107056B: h9_ippsCos_64f_A50 +7DAE2B

CrashLog: 01071789: h9_ippsCos_64f_A50 +7DC049

CrashLog: 01071895: h9_ippsCos_64f_A50 +7DC155

CrashLog: 7797D3C9: BaseThreadInitThunk +00012

CrashLog: 777F1603: RtlInitializeExceptionChain +00063

CrashLog: 777F15D6: RtlInitializeExceptionChain +00036

Application: Caught an unhandled fatal 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: ‘C:\Users\plugexpert\AppData\Roaming\Renoise\V3.0.1\CrashBackups(348 bpm) ame_4_25_2015__14_5_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 bug@renoise.com 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…

DirectSound: Stop Polling…

DirectSound: Releasing Luidsprekers (E-MU 0202 | USB)…

MIDI: Shut down: Closing all acquired MIDI devices…

MIDI: Closing MME Midi-In device ‘LPD8’

MIDI: Closing MME Midi-In device ‘LPK25’

MIDI: Shutting down DirectMusic…

I’ve saved buggy instruments here;https://www.mediafire.com/?hcs4ubl6v420s8f

Both instruments are created from the same pattern.

(windows vista, 32 bit, renoise 3.01)

Hello. This is quite likely the same problem as this one:http://forum.renoise.com/index.php/topic/43632-fixed-lua-api-insert-phrases-then-double-clicking-crashes/

If you single click a phrase first it should work for now - as a workaround.

Yes! Single clicking does open the phrase without crashing Renoise.