Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Q&A, Tips, Tricks and Howto

Reply
 
Thread Tools Display Modes
Old 02-21-2023, 02:43 PM   #161
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

Quote:
Originally Posted by cecilecolin View Post
..I'm currently using the ReaTrak sonic visualiser import bars or beats.lua script which is working great with the export txt file from Sonic Visualiser...
you can comment the MB and GetUserInputs line out and set the value to "txt"
Code:
-- reaper.MB(Info, "Get Tempo Map", 0)

-- retval_split,input_choose  = reaper.GetUserInputs("Choose File Type", 1, "txt or csv", "csv")
input_choose = "txt"
try changing current function use \\ or / in path:
Code:
function read_lines(filepath)

  lines = {}

  --local f = io.input(filepath)
  f = "C:\\Temp\\Files\\mysong.txt"
  repeat

    s = f:read ("*l") -- read one line

    if s then  -- if not end of file (EOF)
      table.insert(lines, ParseCSVLine (s,sep))
    end

  until not s  -- until end of file
         

  f:close()

end
Comment out the lines/actions -- you don't need at the bottom of the script after
set_bar_one_start()


You have the self contained script
here https://forum.cockos.com/showthread....81#post2294081
that will get the tempo from a media item in the track.
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 02-22-2023, 09:19 AM   #162
cecilecolin
Human being with feelings
 
cecilecolin's Avatar
 
Join Date: Feb 2023
Location: Paris
Posts: 13
Default

Hello!

I'm currently using the ReaTrak sonic visualiser import bars or beats.lua script which is working great with the export txt file from Sonic Visualiser.

Now, I would like to skip a few in the script steps such as:
- the selection between csv or txt file extension (I will only use txt extension)
- remember the last directory of the imported file or choose a specific directory instead of the default Reaper directory each time the import txt file window appears.
- end the script after the markers have been imported to the timeline/ruler(I don't need the rest of the actions)

As I'm not familiar with coding, are these requests easy to do so maybe I can do them?

Anyway, you did a good job with this helpful script
__________________
Loving & Making Music!

Last edited by cecilecolin; 02-22-2023 at 02:42 PM.
cecilecolin is offline   Reply With Quote
Old 02-22-2023, 11:52 AM   #163
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

Quote:
Originally Posted by cecilecolin View Post
Hi Musobob,

I'm currently using the ReaTrak sonic visualiser import bars or beats.lua script which is working great with the export txt file from Sonic Visualiser.

Now, I would like to skip a few in the script steps such as:
- the selection between csv or txt file extension (I will only use txt extension)
- remember the last directory of the imported file or choose a specific directory instead of the default Reaper directory each time the import txt file window appears.
- end the script after the markers have been imported to the timeline/ruler(I don't need the rest of the actions)

As I'm not familiar with coding, are these requests easy to do so maybe I can do them?

Anyway, you did a good job with this helpful script
Read this:
Quote:
Originally Posted by MusoBob View Post
you can comment the MB and GetUserInputs line out and set the value to "txt"
Code:
-- reaper.MB(Info, "Get Tempo Map", 0)

-- retval_split,input_choose  = reaper.GetUserInputs("Choose File Type", 1, "txt or csv", "csv")
input_choose = "txt"
try changing current function use \\ or / in path:
Code:
function read_lines(filepath)

  lines = {}

  --local f = io.input(filepath)
  f = "C:\\Temp\\Files\\mysong.txt"
  repeat

    s = f:read ("*l") -- read one line

    if s then  -- if not end of file (EOF)
      table.insert(lines, ParseCSVLine (s,sep))
    end

  until not s  -- until end of file
         

  f:close()

end
Comment out the lines/actions -- you don't need at the bottom of the script after
set_bar_one_start()


You have the self contained script
here https://forum.cockos.com/showthread....81#post2294081
that will get the tempo from a media item in the track.
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 02-22-2023, 03:11 PM   #164
cecilecolin
Human being with feelings
 
cecilecolin's Avatar
 
Join Date: Feb 2023
Location: Paris
Posts: 13
Default

Quote:
Originally Posted by MusoBob View Post
Read this:
Hi Musobob, sorry for the double posting.
I did the modifications and test it:

I also removed this line
if not retval_split then goto finish end

with this:
--if not retval_split then goto finish end

and I have an error on the line 163 which is :

s = f:read ("*l") -- read one line


The custom directory doesn't work (it keeps showing the Reaper folder by default).


The following error
...ReaTrak sonic visualiser import bars or beats - Copy.lua:280: bad argument #5 to 'AddProjectMarker2' (string expected, got nil)


is displayed but the markers are imported from the txt.

I mean it's almost working despite the final error box and the customised directory issue
__________________
Loving & Making Music!

Last edited by cecilecolin; 02-22-2023 at 04:06 PM.
cecilecolin is offline   Reply With Quote
Old 02-22-2023, 04:36 PM   #165
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

Change to your file:
filetxt = "C:\\Temp\\tempo-map.txt"

ReaTrak sonic visualiser import bars or beats - mod.lua
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak

Last edited by MusoBob; 02-23-2023 at 04:18 AM.
MusoBob is offline   Reply With Quote
Old 02-23-2023, 01:53 AM   #166
cecilecolin
Human being with feelings
 
cecilecolin's Avatar
 
Join Date: Feb 2023
Location: Paris
Posts: 13
Default

Quote:
Originally Posted by MusoBob View Post
Change to your file:
filetxt = "C:\\Temp\\tempo-map.txt"

ReaTrak sonic visualiser import bars or beats - mod.lua
I've edit the line and the issue still occur.

this is what I have for the moment

Code:
function read_lines(filepath)

  lines = {}

  local f = io.input(filepath)
  --f = "c:\\bpm.txt"
  filetxt = "c:\\bpm.txt"
  repeat

  s = f:read ("*l") -- read one line

    if s then  -- if not end of file (EOF)
      table.insert(lines, ParseCSVLine (s,sep))
    end

  until not s  -- until end of file
         

  f:close()

end

Sorry but I can't download your lua file. your link must be broken.

Oh, I forgot to mention that I use the portable version of Reaper if it helps.
__________________
Loving & Making Music!

Last edited by cecilecolin; 02-23-2023 at 02:07 AM.
cecilecolin is offline   Reply With Quote
Old 02-23-2023, 04:19 AM   #167
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

Try that
ReaTrak sonic visualiser import bars or beats - mod.lua

https://reatrak.com/downloads/ReaTrak/
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 02-23-2023, 06:10 AM   #168
cecilecolin
Human being with feelings
 
cecilecolin's Avatar
 
Join Date: Feb 2023
Location: Paris
Posts: 13
Default That works !!

The link is working, thank you!

Wow thanks MusoBob, it works marvellously !

Thank you so much, this script is gonna help me saving time!

Let's make some music now!
__________________
Loving & Making Music!
cecilecolin is offline   Reply With Quote
Old 03-10-2023, 03:42 PM   #169
rapidpng
Human being with feelings
 
Join Date: Feb 2023
Posts: 2
Default

Thanks guys, this is really useful.

Added bonus - no stems coming down from the tempo markers!
__________________
RapidPNG
rapidpng is offline   Reply With Quote
Old 04-17-2023, 12:35 PM   #170
salsaman
Human being with feelings
 
Join Date: Apr 2023
Posts: 75
Default Quantise MIDI -> stem

Hi there, maybe this has been answered already, but is there a way to map MIDI notes to markers in audio, so that when the MIDI notes are quantised, the audio will shrink and stretch accordingly keeping the markesrs aligned with the notes ?
salsaman is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:33 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.