[Help & Bug]: problem CTRL+Z and a function about insert patterns

It is the first time that I see this window of “fatal error”…

I am experimenting with a new function that I finished writing. I think it is well written and consistent. In fact, it works as I wish. Automatically includes a new pattern meeting 4 conditions, and takes the number of lines in the current pattern.

--AutoPattern Live
function autopattern( song )
  song = renoise.song()
  local function autopattern_enable( no_lines )
    if song.transport.edit_mode == true and --(5)
       song.transport.follow_player == true and --(4)
       song.transport.playing == true --(3)
      then
      if song.selected_sequence_index == #song.sequencer.pattern_sequence then --(2)
        no_lines = song.patterns[song.sequencer.pattern_sequence[song.selected_sequence_index] ].number_of_lines --number of lines selected pattern (1)
        print ('no_lines: ', no_lines)
        song.sequencer:insert_new_pattern_at( song.selected_sequence_index + 1 ) --insert new patterns automatically
        song.patterns[song.sequencer.pattern_sequence[ song.selected_sequence_index + 1] ].number_of_lines = no_lines --copy number_of_lines next pattern (1)
        song.sequencer:sort() --sort sequence automatically
      end
    end
  end
  song.transport.edit_mode_observable:add_notifier( autopattern_enable ) --(5)
  song.transport.follow_player_observable:add_notifier( autopattern_enable ) --(4)
  song.transport.playing_observable:add_notifier( autopattern_enable ) --(3)
  song.selected_sequence_index_observable:add_notifier( autopattern_enable ) --(2)
  song.patterns[song.sequencer.pattern_sequence[song.selected_sequence_index] ].number_of_lines_observable:add_notifier( autopattern_enable ) --(1)
end
renoise.tool().app_new_document_observable:add_notifier( autopattern )

The function works fine but I doubt if it is 100% good. The problem is with the undo native function (CTRL + Z).I can not locate the error.If I use the function repeatedly when live recording, this window of fatal error appears randomly when I try to eliminate all the composed, pressing repeatedly CTRL+Z (undo):

7252 fatal_error_insert_patterns_automatically.png

After it appears in the window, renoise is automatically closed with a countdown. Is this a strange Renoise bug, or do I have something wrong with my function “autopattern”?

Are these two lines adequates?

  • if song.selected_sequence_index == #song.sequencer.pattern_sequence then --(2)
  • song.selected_sequence_index_observable:add_notifier( autopattern_enable ) --(2)

Maybe this has to do?

  • song.sequencer:sort() --sort sequence automatically

I suspect that Renoise is not able to remove some pattern at some point with CTRL + Z, after repeatedly using this function.But I do not know.

I do not find the error, because it happens randomly, apparently.I like this function. I really want it to work perfectly.

Should I inform bug@renoise.com or is not necessary?

Danoise, could you take a deep look at this?

Thanks!

EDIT:I forgot it… I use R3.1 x64 with Win10

7253 Untitled_1_26_2017__23_2_crash.xrns

More data here:

I use the function “autopattern()” inside my GT16-Colors tool.I still need a checkbox to enable / disable and a limiter to not exceed 1000 patterns.But they are not required for function testing, and I have no problem adding them to the function.

I made another test to discard (although reading the function, it is clear, I describe the steps):

  1. Run Renoise (and a tool with thes function autopattern() )
  2. Enable follow player button
  3. Enable edit mode button
  4. Play song for live recording.The function acts each time a pattern is played. Meanwhile, I am recording notes. A new pattern is added automatically.
  5. Stop song.
  6. Disable the tool (in my case GT16-Colors).So rule out that the tool influences.So far, everything has worked perfectly, and the function autopattern() has not returned any bug, works fine.But I suspect that something is wrongly written by the function, which prevents it from being undone. However, I have doubts if Renoise has some little bug here.
  7. Press CTRL+Z (undo)repeatedly, or use the menu of Renoise for undo.
  8. The problem --> A serious error appear with a floating window.Accept floating window a countdown is activated and Renoise automatically closes.

I do not detect the error because it appears randomly.It looks like CTRL + Z is able to undo all written notes, but it seems to fail to erase some patterns.I am aware that some poorly written function, can work properly, and cause Renoise to fail at some point.But I’m not able to make sure the feature is 100% good or if there is a little bug hidden under Renoise’s bonnet when the feature is not very common.

--AutoPattern Live
function autopattern_two( song )
  song = renoise.song()
  local function autopattern_enable( no_lines )
    if song.transport.edit_mode == true and --(5)
       song.transport.follow_player == true and --(4)
       song.transport.playing == true --(3)
      then
      if song.selected_pattern_index == #song.sequencer.pattern_sequence then --(2)
        no_lines = song.patterns[song.sequencer.pattern_sequence[song.selected_pattern_index] ].number_of_lines --number of lines selected pattern (1)
        print ('no_lines: ', no_lines)
        song.sequencer:insert_new_pattern_at( song.selected_pattern_index + 1 ) --insert new patterns automatically
        song.patterns[song.sequencer.pattern_sequence[ song.selected_pattern_index + 1] ].number_of_lines = no_lines --copy number_of_lines next pattern (1)
        song.sequencer:sort() --sort sequence automatically
      end
    end
  end
  song.transport.edit_mode_observable:add_notifier( autopattern_enable ) --(5)
  song.transport.follow_player_observable:add_notifier( autopattern_enable ) --(4)
  song.transport.playing_observable:add_notifier( autopattern_enable ) --(3)
  song.selected_pattern_index_observable:add_notifier( autopattern_enable ) --(2)
  song.patterns[song.sequencer.pattern_sequence[song.selected_pattern_index] ].number_of_lines_observable:add_notifier( autopattern_enable ) --(1)
end
renoise.tool().app_new_document_observable:add_notifier( autopattern_two )

I have used this other function, and the same thing happens.Basically I have replaced "selected_sequence_index"for “selected_pattern_index”.

Any suggestion?

Hey Raul, thanks for reporting. Will try and see if I can recreate the problem.

I am aware that some poorly written function, can work properly, and cause Renoise to fail at some point.

Good or bad code - it doesn’t really matter as the API should never be able to bring down Renoise this way.

But here & now, my experience is that API related crashes are relatively rare. This is mostly because of improvements to the Renoise core and not because I’ve starting making less mistakes :slight_smile:

Hey Raul, thanks for reporting. Will try and see if I can recreate the problem.

Good or bad code - it doesn’t really matter as the API should never be able to bring down Renoise this way.

But here & now, my experience is that API related crashes are relatively rare. This is mostly because of improvements to the Renoise core and not because I’ve starting making less mistakes :slight_smile:

Thanks you, Danoise!

The truth is that it is a strange thing.I wonder if the function could be written in another way, so that it worked the same, and that Renoise did not crash…I can not locate the error.

I’d try hitting a :bang() with a bool filter in it, making sure that the autopattern function is only triggered once, if that doesn’t disturb the purpose of your tool. My Guess is that something (possibly in the Renoise core) is not being executed sequentially in alignment with the Lua API, and that this messes something up when the function is triggered multiple times by different notifiers. It’s worth a try, I think.

I’d try hitting a :bang() with a bool filter in it, making sure that the autopattern function is only triggered once, if that doesn’t disturb the purpose of your tool. My Guess is that something (possibly in the Renoise core) is not being executed sequentially in alignment with the Lua API, and that this messes something up when the function is triggered multiple times by different notifiers. It’s worth a try, I think.

The function is executed each time the last pattern is played in the ordered sequence, because the button “follow player” is enabled.When you play the last pattern, add another to the sequence, and so on. Never ends (up to 1000 possible patterns).

It’s strange. It’s as if something is spelled wrong and then is not able to go back with undo.In theory the function does nothing strange. Simply add a pattern that meets 4 conditions.Maybe some _observable missing?The function works.

7256 autopattern_01.gif

The final operation is to press CTRL + Z (undo) repeatedly.The notes are erased, and then the error…

I haven’t checked it out yet, but here’s a thought from looking at the code.

You don’t seem to be using thenumber_of_lines_observable?

That value can easily be established when you do the copy, no need to listen for it the whole time.

It’s always complicating tools a lot when you need to observe things that constantly can change. And in this case, the observable seems to be associated with the selected pattern when you start the tool - but that pattern may not be present at the time you’re undoing things.

Could be the reason for the crash, I don’t know. But I would remove that part.

I haven’t checked it out yet, but here’s a thought from looking at the code.

You don’t seem to be using thenumber_of_lines_observable?

That value can easily be established when you do the copy, no need to listen for it the whole time.

It’s always complicating tools a lot when you need to observe things that constantly can change. And in this case, the observable seems to be associated with the selected pattern when you start the tool - but that pattern may not be present at the time you’re undoing things.

Could be the reason for the crash, I don’t know. But I would remove that part.

With this simpler function also occurs the error:

--AutoPattern Live
function autopattern( song )
  song = renoise.song()
  local function autopattern_enable( no_lines )
    if song.transport.edit_mode == true and --(5)
       song.transport.follow_player == true and --(4)
       song.transport.playing == true --(3)
      then
      if song.selected_pattern_index == #song.sequencer.pattern_sequence then --(2)
        
        
        song.sequencer:insert_new_pattern_at( song.selected_pattern_index + 1 ) --insert new patterns automatically
        
        song.sequencer:sort() --sort sequence automatically
      end
    end
  end
  song.transport.edit_mode_observable:add_notifier( autopattern_enable ) --(5)
  song.transport.follow_player_observable:add_notifier( autopattern_enable ) --(4)
  song.transport.playing_observable:add_notifier( autopattern_enable ) --(3)
  song.selected_pattern_index_observable:add_notifier( autopattern_enable ) --(2)
  
end
renoise.tool().app_new_document_observable:add_notifier( autopattern )

There is nothing here about the number_of_lines.It is pressing CTRL-Z and when Renoise wants the error appears.I have also done tests slow and fast, in case it has something to do with time, and it is the same, the error is still there.


About the number_of_lines,I want the new pattern to inherit the number of lines from the pattern being played, which is always the last pattern.Thus, at any time the composer can change the value of number of lines of the last pattern and follow.I mean, that the value of number of lines, does not always have to be the first pattern of the sequence, pattern 00.

Something fails, and it has nothing to do with the number of lines. I suspect it has to do with the insertion of patterns, order or something…It’s a shame. I really like how the function works!

I suspect it has to do with the insertion of patterns, order or something…

Yes, indeed. Most likely, sequence:sort() is the culprit then…

Stripping down code to identify a bug is definitely the way to go :slight_smile:

Edit: I’ve tried running various similar statements from the Renoise console. And I’ve not been able to bring down Renoise so far - it’s definitely something very particular to the order/timing of commands in your script.

In any case, the Renoise log will perhaps be useful for identifying the error.

Could you find the part where it says “CrashLog” (most recent/near the end entries) and post them here?

Yes, indeed. Most likely, sequence:sort() is the culprit then…

Stripping down code to identify a bug is definitely the way to go :slight_smile:

Edit: I’ve tried running various similar statements from the Renoise console. And I’ve not been able to bring down Renoise so far - it’s definitely something very particular to the order/timing of commands in your script.

In any case, the Renoise log will perhaps be useful for identifying the error.

Could you find the part where it says “CrashLog” (most recent/near the end entries) and post them here?

This?

============================================================
Version : Renoise V3.1.0 (Jan 9 2016)
Date : 2017-01-28
Time : 01:31:22
OS : Windows 10 (x86_64)
============================================================

CPU: Found 1 enabled unit(s) with 4 core(s) and 8 logical processor(s) per unit. 4 cores, 8 logical processors are enabled in total.

Application: Showing the splash window...
Application: Initializing the API...

IPP: Detected CPU type: 0x46

MIDI: Initializing DirectMusic...
MIDI: Failed to get the DirectMusicPerformance Interface (error: 80040154). Skipping DirectMusic devices...

Graphport: Initializing Freeimage...

System: Using 'C:\Program Files\Renoise 3.1.0\Resources\' as resource base directory...

GraphPort: Initializing DirectX...
GraphPort: Initializing the Font Engine...

ReWire Slave: ReWire engine link (Local Machine) is already installed and up to date...
ReWire Slave: ReWire engine link (Current User) is already installed and up to date...
ReWire Slave: ReWire Panel was initialized...
ReWire Slave: ReWire Slave mode failed to init (no master is running)...

ReWire Master: Successfully opened

Timer: Seems safe to use the 'QueryPerformance' counters...

Application: Start running...
Application: Loading the preferences...
Application: Init...

ScriptingTools: Initializing Scripting Tool: 'C:\Users\DF-85\AppData\Roaming\Renoise\V3.1.0\Scripts\Tools\ulneiz.GT16-Colors_v1.2b6.xrnx\'...

DspDevices: Registering native DSP effects...

DirectSound: Initializing...
DirectSound: Using SampleRate 48000
DirectSound: Primary Buffer Format: FormatTag=1, Channels=2, SamplesPerSec=48000, BitsPerSample=16, BlockAlign=4
DirectSound: CreateObjects ... OK
DirectSound: Using MaxProcessingBlockSize: 1792
DirectSound: Output Buffer Format: BufferSize=96000, FormatTag=1, Channels=2, SamplesPerSec=48000, BitsPerSample=16, BlockAlign=4
DirectSound: CreateBuffer ... OK
DirectSound: Up and running

MIDI: Enumerating Windows MME MIDI devices...
MIDI: Adding MME out-device 'Microsoft GS Wavetable Synth'
MIDI: Finished device enumeration
MIDI: Creating MIDI server...

Application: Creating a new document...

MIDI: Loading MIDI actions from file 'C:\Program Files\Renoise 3.1.0\Resources\Scripts\GlobalMidiActions.lua'...

Osc: Loading OSC actions from file 'C:\Program Files\Renoise 3.1.0\Resources\Scripts\GlobalOscActions.lua'...

Player: Constructing...
Player: Creating slave threads...
Player: 8 threads enabled. 8 CPUs are available.
Player: Start running...

GUI: Creating the Document GUI...
GUI: Successfully constructed

Application: A new document was created.

GraphPort: Initializing in WindowedMode
GraphPort: Successfully initialized

Application: Init OK
Application: Enter MainLoop...

GraphPort: Trying to load Fallbackfont: 'Arial Unicode MS' (PS-Name: '')...
GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: Trying to load Fallbackfont: 'MS PGothic' (PS-Name: '')...
GraphPort: Fallbackfont was successfully loaded.
GraphPort: Trying to load Fallbackfont: 'Arial Unicode MS' (PS-Name: '')...
GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: Trying to load Fallbackfont: 'MS Gothic' (PS-Name: '')...
GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping...
GraphPort: Trying to load Fallbackfont: 'Arial Unicode MS' (PS-Name: '')...
GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: Trying to load Fallbackfont: 'MS Gothic' (PS-Name: '')...
GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping...
GraphPort: Trying to load Fallbackfont: 'Arial Unicode MS' (PS-Name: '')...
GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: Trying to load Fallbackfont: 'MS Gothic' (PS-Name: '')...
GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping...
GraphPort: Trying to load Fallbackfont: 'Arial Unicode MS' (PS-Name: '')...
GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: Trying to load Fallbackfont: 'MS Gothic' (PS-Name: '')...
GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping...
GraphPort: Trying to load Fallbackfont: 'Arial Unicode MS' (PS-Name: '')...
GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: Trying to load Fallbackfont: 'MS Gothic' (PS-Name: '')...
GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping...
GraphPort: Trying to load Fallbackfont: 'Arial Unicode MS' (PS-Name: '')...
GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: Trying to load Fallbackfont: 'MS Gothic' (PS-Name: '')...
GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping...
GraphPort: Trying to load Fallbackfont: 'Arial Unicode MS' (PS-Name: '')...
GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: Trying to load Fallbackfont: 'MS Gothic' (PS-Name: '')...
GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping...
GraphPort: Trying to load Fallbackfont: 'Arial Unicode MS' (PS-Name: '')...
GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: Trying to load Fallbackfont: 'MS Gothic' (PS-Name: '')...
GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping...
GraphPort: Trying to load Fallbackfont: 'Arial Unicode MS' (PS-Name: '')...
GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: Trying to load Fallbackfont: 'MS Gothic' (PS-Name: '')...
GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping...
GraphPort: Trying to load Fallbackfont: 'Arial Unicode MS' (PS-Name: '')...
GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: Trying to load Fallbackfont: 'MS Gothic' (PS-Name: '')...
GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping...
GraphPort: Trying to load Fallbackfont: 'Arial Unicode MS' (PS-Name: '')...
GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: Trying to load Fallbackfont: 'MS Gothic' (PS-Name: '')...
GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping...
GraphPort: Trying to load Fallbackfont: 'Arial Unicode MS' (PS-Name: '')...
GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: Trying to load Fallbackfont: 'MS Gothic' (PS-Name: '')...
GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping...
GraphPort: Trying to load Fallbackfont: 'Arial Unicode MS' (PS-Name: '')...
GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: Trying to load Fallbackfont: 'MS Gothic' (PS-Name: '')...
GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping...
GraphPort: Trying to load Fallbackfont: 'Arial Unicode MS' (PS-Name: '')...
GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: Trying to load Fallbackfont: 'MS Gothic' (PS-Name: '')...
GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping...
GraphPort: Trying to load Fallbackfont: 'Arial Unicode MS' (PS-Name: '')...
GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: Trying to load Fallbackfont: 'MS Gothic' (PS-Name: '')...
GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping...
GraphPort: Trying to load Fallbackfont: 'Arial Unicode MS' (PS-Name: '')...
GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: Trying to load Fallbackfont: 'MS Gothic' (PS-Name: '')...
GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping...
GraphPort: Trying to load Fallbackfont: 'Arial Unicode MS' (PS-Name: '')...
GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: Trying to load Fallbackfont: 'MS Gothic' (PS-Name: '')...
GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping...
GraphPort: Trying to load Fallbackfont: 'Arial Unicode MS' (PS-Name: '')...
GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: Trying to load Fallbackfont: 'MS Gothic' (PS-Name: '')...
GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping...
GraphPort: Trying to load Fallbackfont: 'Arial Unicode MS' (PS-Name: '')...
GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: Trying to load Fallbackfont: 'MS Gothic' (PS-Name: '')...
GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping...
GraphPort: Trying to load Fallbackfont: 'Arial Unicode MS' (PS-Name: '')...
GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: Trying to load Fallbackfont: 'MS Gothic' (PS-Name: '')...
GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping...
GraphPort: Trying to load Fallbackfont: 'Arial Unicode MS' (PS-Name: '')...
GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: EnumFontFamilies for font family 'Arial Unicode MS' failed

Exception: Failed to resolve the font file for font 'Arial Unicode MS'.

GraphPort: Trying to load Fallbackfont: 'MS Gothic' (PS-Name: '')...
GraphPort: Fallbackfont was successfully loaded, but can not handle the requested character(s). Skipping...

CrashLog: Handling Exception! Code : C0000005
CrashLog: 0000000140957EE8: l9_ippsSin_64f_A50 +779618
CrashLog: 0000000140A5BF2E: l9_ippsSin_64f_A50 +87D65E
CrashLog: 0000000140A2355B: l9_ippsSin_64f_A50 +844C8B
CrashLog: 000000014045E46D: l9_ippsSin_64f_A50 +27FB9D
CrashLog: 00000001404701CB: l9_ippsSin_64f_A50 +2918FB
CrashLog: 0000000140471062: l9_ippsSin_64f_A50 +292792
CrashLog: 00000001404A6684: l9_ippsSin_64f_A50 +2C7DB4
CrashLog: 00000001404A4020: l9_ippsSin_64f_A50 +2C5750
CrashLog: 00000001404A40E6: l9_ippsSin_64f_A50 +2C5816
CrashLog: 000000014046B78D: l9_ippsSin_64f_A50 +28CEBD
CrashLog: 00000001405922E3: l9_ippsSin_64f_A50 +3B3A13
CrashLog: 000000014057973E: l9_ippsSin_64f_A50 +39AE6E
CrashLog: 00000001402A8EDA: l9_ippsSin_64f_A50 +CA60A
CrashLog: 00000001402A8E15: l9_ippsSin_64f_A50 +CA545
CrashLog: 00000001403CA20A: l9_ippsSin_64f_A50 +1EB93A
CrashLog: 00000001405DD7F0: l9_ippsSin_64f_A50 +3FEF20
CrashLog: 00000001406AA268: l9_ippsSin_64f_A50 +4CB998
CrashLog: 00000001406AA3E6: l9_ippsSin_64f_A50 +4CBB16
CrashLog: 00000001405DF9CA: l9_ippsSin_64f_A50 +4010FA
CrashLog: 0000000140555082: l9_ippsSin_64f_A50 +3767B2
CrashLog: 0000000140572B22: l9_ippsSin_64f_A50 +394252
CrashLog: 00000001406A9B03: l9_ippsSin_64f_A50 +4CB233
CrashLog: 00000001406A9BB3: l9_ippsSin_64f_A50 +4CB2E3
CrashLog: 0000000140572B22: l9_ippsSin_64f_A50 +394252
CrashLog: 000000014056654C: l9_ippsSin_64f_A50 +387C7C
CrashLog: 00000001405A2AE8: l9_ippsSin_64f_A50 +3C4218
CrashLog: 00000001405612A5: l9_ippsSin_64f_A50 +3829D5
CrashLog: 0000000140566376: l9_ippsSin_64f_A50 +387AA6
CrashLog: 0000000140269493: l9_ippsSin_64f_A50 +8ABC3
CrashLog: 0000000140268FED: l9_ippsSin_64f_A50 +8A71D
CrashLog: 0000000140269506: l9_ippsSin_64f_A50 +8AC36
CrashLog: 0000000140BBC8DE: l9_ippsSin_64f_A50 +9DE00E
CrashLog: 00007FF923A48364: BaseThreadInitThunk +00014

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\DF-85\AppData\Roaming\Renoise\V3.1.0\CrashBackups\Untitled_1_28_2017__1_33_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...

Excerpt from file:C:\Users\DF-85\AppData\Roaming\Renoise\V3.1.0\Log.txt

It is the last record of this particular error.

GraphPort: EnumFontFamilies for font family ‘Arial Unicode MS’ failed

Exception: Failed to resolve the font file for font ‘Arial Unicode MS’.??? This lines is repeated a lot. :huh:Maybe it has something to do?

I think I can contribute a bit more data here.I have detected that I have a small problem with some Unicode icons, which is easy to solve. In fact, I plan to replace all unicode icons with images and not use unicode. So this will not be a problem.

It seems that Renoise does not return any problems if any Unicode icon is rendered wrong, it simply does not look good.So, we can ignore what happened with Arial Unicode. There is the problem of this topic.

To avoid confusion, I have followed the advice of Danoise, isolating the function “autopattern()” as much as possible.I created a clean xrnx, which only charges this function. I attach a ZIP with the files for the tests:

7257 LOGS-CRASHBACKUPS.zip

The container include:

  • ulneiz.AutoPattern_v1.0.xrnx ( the isolated tool with the function autopattern() )
  • Log_1_Start_Renoise.txt (clean, only the charge of Renoise and the tool “ulneiz.AutoPattern_v1.0.xrnx” )
  • Log_2_With_Crash_Undo.txt (incluye the crash, probably caused by “song.sequencer:insert_new_pattern_at( song.selected_pattern_index + 1 )” ???)
  • Untitled_1_28_2017__15_9_crash.xrns ( the crash xrns )

The complete Log_2.txt (original Log.txt --> “C:\Users\DF-85\AppData\Roaming\Renoise\V3.1.0\Log.txt”):

============================================================
Version : Renoise V3.1.0 (Jan 9 2016)
Date : 2017-01-28
Time : 15:07:11
OS : Windows 10 (x86_64)
============================================================

CPU: Found 1 enabled unit(s) with 4 core(s) and 8 logical processor(s) per unit. 4 cores, 8 logical processors are enabled in total.

Application: Showing the splash window...
Application: Initializing the API...

IPP: Detected CPU type: 0x46

MIDI: Initializing DirectMusic...
MIDI: Failed to get the DirectMusicPerformance Interface (error: 80040154). Skipping DirectMusic devices...

Graphport: Initializing Freeimage...

System: Using 'C:\Program Files\Renoise 3.1.0\Resources\' as resource base directory...

GraphPort: Initializing DirectX...
GraphPort: Initializing the Font Engine...

ReWire Slave: ReWire engine link (Local Machine) is already installed and up to date...
ReWire Slave: ReWire engine link (Current User) is already installed and up to date...
ReWire Slave: ReWire Panel was initialized...
ReWire Slave: ReWire Slave mode failed to init (no master is running)...

ReWire Master: Successfully opened

Timer: Seems safe to use the 'QueryPerformance' counters...

Application: Start running...
Application: Loading the preferences...
Application: Init...

ScriptingTools: Initializing Scripting Tool: 'C:\Users\DF-85\AppData\Roaming\Renoise\V3.1.0\Scripts\Tools\ulneiz.AutoPattern_v1.0.xrnx\'...

DspDevices: Registering native DSP effects...

DirectSound: Initializing...
DirectSound: Using SampleRate 48000
DirectSound: Primary Buffer Format: FormatTag=1, Channels=2, SamplesPerSec=48000, BitsPerSample=16, BlockAlign=4
DirectSound: CreateObjects ... OK
DirectSound: Using MaxProcessingBlockSize: 1792
DirectSound: Output Buffer Format: BufferSize=96000, FormatTag=1, Channels=2, SamplesPerSec=48000, BitsPerSample=16, BlockAlign=4
DirectSound: CreateBuffer ... OK
DirectSound: Up and running

MIDI: Enumerating Windows MME MIDI devices...
MIDI: Adding MME out-device 'Microsoft GS Wavetable Synth'
MIDI: Finished device enumeration
MIDI: Creating MIDI server...

Application: Creating a new document...

MIDI: Loading MIDI actions from file 'C:\Program Files\Renoise 3.1.0\Resources\Scripts\GlobalMidiActions.lua'...

Osc: Loading OSC actions from file 'C:\Program Files\Renoise 3.1.0\Resources\Scripts\GlobalOscActions.lua'...

Player: Constructing...
Player: Creating slave threads...
Player: 8 threads enabled. 8 CPUs are available.
Player: Start running...

GUI: Creating the Document GUI...
GUI: Successfully constructed

Application: A new document was created.

GraphPort: Initializing in WindowedMode
GraphPort: Successfully initialized

Application: Init OK
Application: Enter MainLoop...

CrashLog: Handling Exception! Code : C0000005
CrashLog: 0000000140957EE8: l9_ippsSin_64f_A50 +779618
CrashLog: 0000000140A5BF2E: l9_ippsSin_64f_A50 +87D65E
CrashLog: 0000000140A2355B: l9_ippsSin_64f_A50 +844C8B
CrashLog: 000000014045E46D: l9_ippsSin_64f_A50 +27FB9D
CrashLog: 00000001404701CB: l9_ippsSin_64f_A50 +2918FB
CrashLog: 0000000140471062: l9_ippsSin_64f_A50 +292792
CrashLog: 00000001404A6684: l9_ippsSin_64f_A50 +2C7DB4
CrashLog: 00000001404A4020: l9_ippsSin_64f_A50 +2C5750
CrashLog: 00000001404A40E6: l9_ippsSin_64f_A50 +2C5816
CrashLog: 000000014046B78D: l9_ippsSin_64f_A50 +28CEBD
CrashLog: 00000001405922E3: l9_ippsSin_64f_A50 +3B3A13
CrashLog: 000000014057973E: l9_ippsSin_64f_A50 +39AE6E
CrashLog: 00000001402A8EDA: l9_ippsSin_64f_A50 +CA60A
CrashLog: 00000001402A8E15: l9_ippsSin_64f_A50 +CA545
CrashLog: 00000001403CA20A: l9_ippsSin_64f_A50 +1EB93A
CrashLog: 00000001405DD7F0: l9_ippsSin_64f_A50 +3FEF20
CrashLog: 00000001406AA268: l9_ippsSin_64f_A50 +4CB998
CrashLog: 00000001406AA3E6: l9_ippsSin_64f_A50 +4CBB16
CrashLog: 00000001405DF9CA: l9_ippsSin_64f_A50 +4010FA
CrashLog: 0000000140555082: l9_ippsSin_64f_A50 +3767B2
CrashLog: 0000000140572B22: l9_ippsSin_64f_A50 +394252
CrashLog: 00000001406A9B03: l9_ippsSin_64f_A50 +4CB233
CrashLog: 00000001406A9BB3: l9_ippsSin_64f_A50 +4CB2E3
CrashLog: 0000000140572B22: l9_ippsSin_64f_A50 +394252
CrashLog: 000000014056654C: l9_ippsSin_64f_A50 +387C7C
CrashLog: 00000001405A2AE8: l9_ippsSin_64f_A50 +3C4218
CrashLog: 00000001405612A5: l9_ippsSin_64f_A50 +3829D5
CrashLog: 0000000140566376: l9_ippsSin_64f_A50 +387AA6
CrashLog: 0000000140269493: l9_ippsSin_64f_A50 +8ABC3
CrashLog: 0000000140268FED: l9_ippsSin_64f_A50 +8A71D
CrashLog: 0000000140269506: l9_ippsSin_64f_A50 +8AC36
CrashLog: 0000000140BBC8DE: l9_ippsSin_64f_A50 +9DE00E
CrashLog: 00007FF923A48364: BaseThreadInitThunk +00014

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\DF-85\AppData\Roaming\Renoise\V3.1.0\CrashBackups\Untitled_1_28_2017__15_9_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...

l9_ippsSin_64f_A50???

Another detail:I did the test by removing the line:song.sequencer:sort(), and the error continues.It seems to cause this function:

function autopattern( song )
  song = renoise.song()
  local function autopattern_enable( no_lines )
    if song.transport.edit_mode == true and --(5)
       song.transport.follow_player == true and --(4)
       song.transport.playing == true --(3)
      then
      if song.selected_pattern_index == #song.sequencer.pattern_sequence then --(2)
        song.sequencer:insert_new_pattern_at( song.selected_pattern_index + 1 ) --insert new patterns automatically
      end
    end
  end
  song.transport.edit_mode_observable:add_notifier( autopattern_enable ) --(5)
  song.transport.follow_player_observable:add_notifier( autopattern_enable ) --(4)
  song.transport.playing_observable:add_notifier( autopattern_enable ) --(3)
  song.selected_pattern_index_observable:add_notifier( autopattern_enable ) --(2)
end
renoise.tool().app_new_document_observable:add_notifier( autopattern )

Is there a problem with this?

if song.selected_pattern_index == #song.sequencer.pattern_sequence then --(2)
  song.sequencer:insert_new_pattern_at( song.selected_pattern_index + 1 ) --insert new patterns automatically
end

I hope this information helps you better to find the error…Remember that the error is caused by using CTRL + Z (undo, or menu/undo) repeatedly after recording live using the autopattern() function.

Note : from now on I will keep the log.txt file in mind to avoid possible problems with my GT16-Colors tool.

Discarding more things:

--AutoPattern Live
function autopattern( song )
  song = renoise.song()
  local function autopattern_enable( no_lines )
    if --song.transport.edit_mode == true and --(4)
       --song.transport.follow_player == true and --(3)
       song.transport.playing == true and --(2)
       song.selected_pattern_index == #song.sequencer.pattern_sequence then --(1)
         song.sequencer:insert_new_pattern_at( song.selected_pattern_index + 1 ) --insert new patterns automatically
    end
  end
  --song.transport.edit_mode_observable:add_notifier( autopattern_enable ) --(4)
  --song.transport.follow_player_observable:add_notifier( autopattern_enable ) --(3)
  song.transport.playing_observable:add_notifier( autopattern_enable ) --(2)
  song.selected_pattern_index_observable:add_notifier( autopattern_enable ) --(1)
end
renoise.tool().app_new_document_observable:add_notifier( autopattern )

With this function continues the error, and this also:

--AutoPattern Live
function autopattern( song )
  song = renoise.song()
  local function autopattern_enable( no_lines )
    if --song.transport.edit_mode == true and --(4)
       --song.transport.follow_player == true and --(3)
       song.transport.playing == true and --(2)
       song.selected_sequence_index == #song.sequencer.pattern_sequence then --(1)
         song.sequencer:insert_new_pattern_at( song.selected_sequence_index + 1 ) --insert new patterns automatically
    end
  end
  --song.transport.edit_mode_observable:add_notifier( autopattern_enable ) --(4)
  --song.transport.follow_player_observable:add_notifier( autopattern_enable ) --(3)
  song.transport.playing_observable:add_notifier( autopattern_enable ) --(2)
  song.selected_sequence_index_observable:add_notifier( autopattern_enable ) --(1)
end
renoise.tool().app_new_document_observable:add_notifier( autopattern )

In the first function, I use the “selected_pattern_index”. Continue the error.

In the last function, I use the “selected_sequence_index”. Continue the error.

This is correct to indicate the last pattern: #song.sequencer.pattern_sequence ???

I can not think what else to try…

I can not think what else to try…

Just to add my 2 cents here (not that anybody is really all that interested in what I have to say…but still…)

I find that you can simplify the whole mess into just this:

function indexobser()
  local song = renoise.song()
  song.sequencer:insert_new_pattern_at( song.selected_pattern_index + 1 )
end

function autopattern( song )
  song = renoise.song()
  song.selected_pattern_index_observable:add_notifier( indexobser )
end

renoise.tool().app_new_document_observable:add_notifier( autopattern )

Just install this tool (I’ve attached a modified Raul tool below for convenience), press the ‘+’ in the sequencer section to add a pattern (probably a number of patterns will be added. Press it at least twice.) Then simply press the ‘-’ in the sequencer to delete any one of those patterns. Should crash. Inserting patterns and then deleting with the above notifier confuses Renoise a lot :slight_smile:

Edit: BTW this won’t generate a 100% crash rate. Sometimes the scripting engine will catch it. However it is possible to crash Renoise with the above.

Just to add my 2 cents here (not that anybody is really all that interested in what I have to say…but still…)

I find that you can simplify the whole mess into just this:

function indexobser()
local song = renoise.song()
song.sequencer:insert_new_pattern_at( song.selected_pattern_index + 1 )
end

function autopattern( song )
song = renoise.song()
song.selected_pattern_index_observable:add_notifier( indexobser )
end

renoise.tool().app_new_document_observable:add_notifier( autopattern )

Just install this tool (I’ve attached a modified Raul tool below for convenience), press the ‘+’ in the sequencer section to add a pattern (probably a number of patterns will be added.) Then simply press the ‘-’ in the sequencer to delete any one of those patterns. Should crash. Inserting patterns and then deleting with the above notifier confuses Renoise a lot :slight_smile:

Edit: BTW this won’t generate a 100% crash rate. Sometimes the scripting engine will catch it. However it is possible to crash Renoise with the above.

Thanks! Maybe this helps to find the error more quickly?In the end I have more curiosity to know what causes the error, than the fact of solving it ^_^.It makes me angry that I can not use the function autopattern() in all its splendor.I hope this has a solution…

Any progress with this topic and “the bug”???