Skip to content

Commit 30e635a

Browse files
committed
Fixed weird track creation for generated MIDI.
1 parent 26d54f6 commit 30e635a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

MIDI/Items_To_MIDI/Zly_Items_To_MIDI.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ function main()
1111
local track = reaper.GetMediaItemTrack(first_item)
1212
local _, track_name = reaper.GetTrackName(track)
1313
local track_index = reaper.GetMediaTrackInfo_Value(track, "IP_TRACKNUMBER")
14-
reaper.InsertTrackAtIndex(track_index+1, true)
15-
local new_midi_track = reaper.GetTrack(0, track_index+1)
14+
reaper.InsertTrackAtIndex(track_index, true)
15+
local new_midi_track = reaper.GetTrack(0, track_index)
1616
reaper.GetSetMediaTrackInfo_String(new_midi_track, "P_NAME", track_name..(track_name ~= "" and "_" or "").."MIDI", true)
1717

1818
-- Create MIDI item

MIDI/meta_Items_To_MIDI.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
@metapackage
33
@description Items -> MIDI
44
@author Zly
5-
@version 1.0.1
5+
@version 1.0.2
66
@provides
77
[main] .\Items_To_MIDI\Zly_Items_To_MIDI.lua
88
@about
99
# MIDI Based On Items
1010
1111
- Creates MIDI based on selected items pitches.
1212
@changelog
13-
- Fixed the script sometimes providing non integer values to note creation functions.
13+
- Fixed weird track creation for generated MIDI.
1414
--]]

0 commit comments

Comments
 (0)