Skip to content

Commit

Permalink
Fixed weird track creation for generated MIDI.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zly-u committed May 25, 2024
1 parent 26d54f6 commit 30e635a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions MIDI/Items_To_MIDI/Zly_Items_To_MIDI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ function main()
local track = reaper.GetMediaItemTrack(first_item)
local _, track_name = reaper.GetTrackName(track)
local track_index = reaper.GetMediaTrackInfo_Value(track, "IP_TRACKNUMBER")
reaper.InsertTrackAtIndex(track_index+1, true)
local new_midi_track = reaper.GetTrack(0, track_index+1)
reaper.InsertTrackAtIndex(track_index, true)
local new_midi_track = reaper.GetTrack(0, track_index)
reaper.GetSetMediaTrackInfo_String(new_midi_track, "P_NAME", track_name..(track_name ~= "" and "_" or "").."MIDI", true)

-- Create MIDI item
Expand Down
4 changes: 2 additions & 2 deletions MIDI/meta_Items_To_MIDI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
@metapackage
@description Items -> MIDI
@author Zly
@version 1.0.1
@version 1.0.2
@provides
[main] .\Items_To_MIDI\Zly_Items_To_MIDI.lua
@about
# MIDI Based On Items
- Creates MIDI based on selected items pitches.
@changelog
- Fixed the script sometimes providing non integer values to note creation functions.
- Fixed weird track creation for generated MIDI.
--]]

0 comments on commit 30e635a

Please sign in to comment.