Old 02-11-2014, 10:29 PM   #441
Argitoth
Human being with feelings
 
Argitoth's Avatar
 
Join Date: Feb 2008
Location: Phoenix, AZ
Posts: 2,055
Default

I am the one and only Argitoth.

Ok, so you want to SORT ITEMS... BY... THEIR REGION...

But if you sort items, the items shall change position and no longer be in the same region.

Esentially you want to move regions around like you would with mouse+click+drag, but move them around by name with the click of a button?

Edit: There, I updated my avatar on both forums.
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template

Last edited by Argitoth; 02-11-2014 at 10:49 PM.
Argitoth is offline   Reply With Quote
Old 02-12-2014, 09:28 AM   #442
Tod
Human being with feelings
 
Tod's Avatar
 
Join Date: Jan 2010
Location: Just outside of Glacier National Park
Posts: 12,679
Default

Quote:
Originally Posted by Argitoth View Post
I am the one and only Argitoth.
Okay, I thought you might be, I saw one of your posts in the Kontakt thread yesterday and kind of figured you were.

Quote:
Ok, so you want to SORT ITEMS... BY... THEIR REGION...

But if you sort items, the items shall change position and no longer be in the same region.

Esentially you want to move regions around like you would with mouse+click+drag, but move them around by name with the click of a button?
Yes that sounds about right.

Thanks Argitoth.
__________________
Kontakt Vid Tutorials->Create Outputs / Create Templates -|- SMDrums Free drums -|- Elk Video Productions -|- Tod's Music
Tod is offline   Reply With Quote
Old 02-12-2014, 10:49 AM   #443
Argitoth
Human being with feelings
 
Argitoth's Avatar
 
Join Date: Feb 2008
Location: Phoenix, AZ
Posts: 2,055
Default

Tod, don't thank me. I just want to understand what you want to do. I'm pretty sure that's reaaaallllyy difficult to script. I would have to see your project to give you ideas. As a matter of fact, just post your project without media items source files, let me get an idea of how complex the problem is.
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template
Argitoth is offline   Reply With Quote
Old 02-12-2014, 10:59 AM   #444
Tod
Human being with feelings
 
Tod's Avatar
 
Join Date: Jan 2010
Location: Just outside of Glacier National Park
Posts: 12,679
Default

Quote:
Originally Posted by Argitoth View Post
Tod, don't thank me. I just want to understand what you want to do. I'm pretty sure that's reaaaallllyy difficult to script. I would have to see your project to give you ideas. As a matter of fact, just post your project without media items source files, let me get an idea of how complex the problem is.
Okay, I've got an old client in the studio right now but I'll get to it as soon as I can.

In regards to a script for this, there is already an action SWS: Organize items by peak so there's obviously some kind of sorting algorithm using the peak values info. It doesn't seem to be moving things around while it's sorting (all the items stay in place) but it does show a progress window. However it's hard for me to glean anything from that. It's like it's sort of putting the peak values in an array, sorting the array, and then very swiftly moves the items according to the array.

I'm just wondering if a script could be made to do the same thing but instead of just moving the items, it would move the associated region along with all the other items that are visible and in that region. By visible I mean the track isn't hidden.
__________________
Kontakt Vid Tutorials->Create Outputs / Create Templates -|- SMDrums Free drums -|- Elk Video Productions -|- Tod's Music
Tod is offline   Reply With Quote
Old 02-12-2014, 11:48 AM   #445
Tod
Human being with feelings
 
Tod's Avatar
 
Join Date: Jan 2010
Location: Just outside of Glacier National Park
Posts: 12,679
Default

Quote:
Originally Posted by Argitoth View Post
As a matter of fact, just post your project without media items source files, let me get an idea of how complex the problem is.
Okay, I found a free moment here.

I saved this with the regions in their original positions before being aligned. Also the regions names are the peak value of the Snare Top samples.

The Snare Top is duplicated because that's the track I used for Dynamic Splitting as well as getting all the info such as Peak Value.

You'll be asked for a file but just say Ignore all files. I left the one file so you can see the associated item names.

For the rest of the items I just use empty midi items.

Let me know if you have any questions.

https://stash.reaper.fm/19765/01%20Sn...20edit%201.zip
__________________
Kontakt Vid Tutorials->Create Outputs / Create Templates -|- SMDrums Free drums -|- Elk Video Productions -|- Tod's Music
Tod is offline   Reply With Quote
Old 02-12-2014, 03:40 PM   #446
Argitoth
Human being with feelings
 
Argitoth's Avatar
 
Join Date: Feb 2008
Location: Phoenix, AZ
Posts: 2,055
Default

You essentially are using regions because you need to keep your samples of different mics in the same place, correct? So you want to move around regions so the other mics of the sample will move with it?

And you want to sort by volume? Is this already sorted?

I cannot begin to conceive of a script that sorts regions. Maybe Spk77 could, but there are better ways of doing things.

When working with multimic samples I suggest it is ESSENTIAL that you keep them as multichannel wave files until you are ready to render and implement into a sampler.

I am no stranger to working with multi mic drum samples. I have an unreleased multimic drumkit 100% cut and I did not use regions. I kept the samples as a monolithic multichannel wav. 0% tediousness was involved.

So Tod, what are the reasons you are not using multichannel wav?

Edit: That being said, you can change your workflow RIGHT NOW and you won't lose any time spent on the samples. I can help you with that.
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template
Argitoth is offline   Reply With Quote
Old 02-12-2014, 04:32 PM   #447
Tod
Human being with feelings
 
Tod's Avatar
 
Join Date: Jan 2010
Location: Just outside of Glacier National Park
Posts: 12,679
Default

Quote:
Originally Posted by Argitoth View Post
You essentially are using regions because you need to keep your samples of different mics in the same place, correct? So you want to move around regions so the other mics of the sample will move with it?
Yes exactly, the different mic position samples need to move together and also keep their respective postions to each other.

Quote:
And you want to sort by volume? Is this already sorted?
Yes by their volume or peaks, I think Peak might be better in this situation than RMS although I could be wrong. The project I posted had not been sorted yet.

Quote:
I cannot begin to conceive of a script that sorts regions. Maybe Spk77 could, but there are better ways of doing things.

When working with multimic samples I suggest it is ESSENTIAL that you keep them as multichannel wave files until you are ready to render and implement into a sampler.

I am no stranger to working with multi mic drum samples. I have an unreleased multimic drumkit 100% cut and I did not use regions. I kept the samples as a monolithic multichannel wav. 0% tediousness was involved.
Actually I intend to keep them in their separate mic positons. Later they will be loaded into Kontakt and be scripted so that all the various parameters can be adjusted or mixed to taste in the GUI.

Quote:
So Tod, what are the reasons you are not using multichannel wav?
I'm not sure what you mean by multi channel, are you talking about audio channels or midi channels?

What I'm trying to get geared up for is big project coming up for a complete drum set. The whole kit will be multi miced and some of the parts like Snare, Hat, Ride, Toms will have 32 velocity layers/levels. The rest of the kit will likley have 24 layers. All parts will probably have 4 or more round robins.

Quote:
Edit: That being said, you can change your workflow RIGHT NOW and you won't lose any time spent on the samples. I can help you with that.
Okay, heh heh, maybe you can explain, however I don't think this thread is the proper place to do this. PM me and maybe we can exchange emails or something. I'd really like to converse with you and see what you have in mind.
__________________
Kontakt Vid Tutorials->Create Outputs / Create Templates -|- SMDrums Free drums -|- Elk Video Productions -|- Tod's Music
Tod is offline   Reply With Quote
Old 02-13-2014, 05:44 AM   #448
mim
Human being with feelings
 
Join Date: Mar 2009
Posts: 346
Default Script to transfert volume envelope post fx to volume env pre fx

I guess I have to do it myself, but I'd ask anyway ...

Does anyone have some scripts to transfert volume envelope post fx to volume envelope pre fx ?

Or does anyone know if there would be some problems to try to do this ?
mim is offline   Reply With Quote
Old 02-14-2014, 02:35 PM   #449
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,575
Default

No one requested this, but I thought this might be useful for those who make sample libraries. (I don't know anything about that process.)

Normalize selected items (active take) to given linear range



Code:
# Normalize selected items to given linear range
# ("take volumes" are adjusted)

from reaper_python import *
from contextlib import contextmanager
import math

@contextmanager
def undoable(message):
    RPR_Undo_BeginBlock2(0)
    try:
        yield
    finally:
        RPR_Undo_EndBlock2(0, message, -1)

def msg(m):
    RPR_ShowConsoleMsg(str(m) + "\n")

def dialog():
    default = "-20.0,-3.0"
    d = RPR_GetUserInputs("Normalize active takes to range", 2, "From (dB):,To (dB):", default, 20)
    return d

def normalize():
    selItemCount = RPR_CountSelectedMediaItems(0)
    if selItemCount < 2:
        msg("Select at least two items")
        return

    d = dialog()
    if not d[0]:
        return

    RPR_Main_OnCommand(40108, 0)    # normalize items (take volume)
    dL = d[4].split(",")
    fromDB = float(dL[0])
    toDB = float(dL[1])
    dBStep = (toDB - fromDB) / (selItemCount - 1)

    for i in range(selItemCount):
        item = RPR_GetSelectedMediaItem(0, i)
        take = RPR_GetActiveTake(item)

        normalizedDB = 20 * math.log10(float(RPR_GetMediaItemTakeInfo_Value(take, "D_VOL")))
##        newDB = normalizedDB + fromDB + dBStep * i
        newDB = normalizedDB + fromDB + (i * ((toDB - fromDB) / (selItemCount - 1)))
        newVol = math.pow(10, newDB / 20)
        RPR_SetMediaItemTakeInfo_Value(take, "D_VOL", newVol)

    RPR_UpdateArrange()

with undoable("Normalize (linear range)"):
    normalize()

Last edited by spk77; 02-15-2014 at 01:43 AM. Reason: "Normalize active take's to range" to "Normalize active takes to range"
spk77 is offline   Reply With Quote
Old 02-14-2014, 02:45 PM   #450
Tod
Human being with feelings
 
Tod's Avatar
 
Join Date: Jan 2010
Location: Just outside of Glacier National Park
Posts: 12,679
Default

Quote:
Originally Posted by spk77 View Post
No one requested this, but I thought this might be useful for those who make sample libraries. (I don't know anything about that process.)

Normalize selected items (active take) to given linear range
Hey spk77, is this what I think it is? If it is I love yah, love yah, love yah.

I think this is one of the things I was asking for up above a few posts.

I'll check this out right away.
__________________
Kontakt Vid Tutorials->Create Outputs / Create Templates -|- SMDrums Free drums -|- Elk Video Productions -|- Tod's Music
Tod is offline   Reply With Quote
Old 02-14-2014, 03:09 PM   #451
Tod
Human being with feelings
 
Tod's Avatar
 
Join Date: Jan 2010
Location: Just outside of Glacier National Park
Posts: 12,679
Default

Okay, I ran 3 different tests with different values on 32 monolith (4 channels) samples and the results were right on perfect every time. You can't get any better than that.

Not only that but as soon as I hit "OK" it was immediate. Heh heh, I didn't even see it blink and at first I thought it didn't work. But it does, and as usual spk77, you've done it again.

I realy do love you.
__________________
Kontakt Vid Tutorials->Create Outputs / Create Templates -|- SMDrums Free drums -|- Elk Video Productions -|- Tod's Music
Tod is offline   Reply With Quote
Old 02-14-2014, 03:17 PM   #452
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,575
Default

Quote:
Originally Posted by Tod View Post
Okay, I ran 3 different tests with different values on 32 monolith (4 channels) samples and the results were right on perfect every time. You can't get any better than that.

Not only that but as soon as I hit "OK" it was immediate. Heh heh, I didn't even see it blink and at first I thought it didn't work. But it does, and as usual spk77, you've done it again.

I realy do love you.
Thanks, Tod. I'm happy that it worked!
spk77 is offline   Reply With Quote
Old 02-18-2014, 04:38 AM   #453
Ozymandias
Human being with feelings
 
Join Date: Apr 2011
Posts: 144
Default

Hey all,

I could really use a script which generates MIDI velocity ramps up/down where the new values are proportional to the selected notes' original velocity values.

To illustrate, let's say you have a set of values like this:



What I want to end up with is something that looks like this (hand drawn, but you get the idea):



I imagine you would need two user inputs: up/down and a percentage. If the ramp is up then the percentage governs the start of the ramp, and vice versa.


Thanks!
Ozymandias is offline   Reply With Quote
Old 02-19-2014, 06:44 PM   #454
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 550
Default

Hi there

Two requests in a row!
I've just got python working and a script that does the following would be amazing:

Select items under cursor in folder of selected track or if there's no folder select just the item under mouse

Here's the back story: I've been working with group editing using the following macro tied a mouse modifier:
SWS: Select only parent(s) of selected folder track(s)
SWS: Select children of selected folder track(s)
Xenakios/SWS: Select items under edit cursor on selected tracks
This allows a group editing workflow to the contents of a folder without having to group any items at all. I have a similar macro for adding to the selection.

It would be absolutely fantastic if this behaviour worked without having to use a modifier at all. At the moment if I click on an item that isn't in a folder using the macro above nothing is selected. If it's possible to make a script that knows if there is no folder (to then just select the item under the mouse) but when the items are on tracks in a folder (to select all the items above and below in the folder) then this could be mapped to the plain left click anywhere in a project.
__________________
Brush and Beater Drums Online: www.outoftheboxdrums.co.uk
Triode is offline   Reply With Quote
Old 02-19-2014, 07:16 PM   #455
Argitoth
Human being with feelings
 
Argitoth's Avatar
 
Join Date: Feb 2008
Location: Phoenix, AZ
Posts: 2,055
Default

Quote:
Originally Posted by Triode View Post
Select items under cursor in folder of selected track or if there's no folder select just the item under mouse
Which folder? The first folder? Will you ever have multiple folders?
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template
Argitoth is offline   Reply With Quote
Old 02-19-2014, 07:40 PM   #456
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 550
Default

Hi Argitoth cheers for the reply. It's the folder that contains the tracks who's item I am selecting. So that when I select an item on a track in a folder all items above and below it that are in the same folder are automatically selected. If there are nested folders they won't need including. Does this make sense?
__________________
Brush and Beater Drums Online: www.outoftheboxdrums.co.uk
Triode is offline   Reply With Quote
Old 02-19-2014, 08:18 PM   #457
Argitoth
Human being with feelings
 
Argitoth's Avatar
 
Join Date: Feb 2008
Location: Phoenix, AZ
Posts: 2,055
Default

yep makes sense... ill see if I can tackle it.
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template
Argitoth is offline   Reply With Quote
Old 02-20-2014, 08:53 AM   #458
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 550
Default

Quote:
Originally Posted by Argitoth View Post
yep makes sense... ill see if I can tackle it.
That would be grand! Thank you
__________________
Brush and Beater Drums Online: www.outoftheboxdrums.co.uk
Triode is offline   Reply With Quote
Old 02-21-2014, 03:40 PM   #459
planetnine
Human being with feelings
 
planetnine's Avatar
 
Join Date: Oct 2007
Location: Lincoln, UK
Posts: 7,585
Default

Hello Scripters, does anyone know how a script can acquire the current project name please?

I need to save a data file with a name based on the project name, ie having the ability to save a config per project, for a set of ReaScript actions idea that I'm chewing through.

Also, is there an easy way to save to and read from an XML or INI-type human-readable data file structure, rather than the easier binary files..?


Many thanks in advance



>
planetnine is offline   Reply With Quote
Old 02-21-2014, 03:58 PM   #460
Argitoth
Human being with feelings
 
Argitoth's Avatar
 
Join Date: Feb 2008
Location: Phoenix, AZ
Posts: 2,055
Default

EnumProjects(0, #proj)
ShowConsoleMsg(#proj)

you should probably use Python because this returns PATH and FILENAME.RPP so you have to do a regex for \\(.*?).RPP and use group 1.
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template

Last edited by Argitoth; 02-24-2014 at 10:13 AM.
Argitoth is offline   Reply With Quote
Old 02-23-2014, 01:58 AM   #461
planetnine
Human being with feelings
 
planetnine's Avatar
 
Join Date: Oct 2007
Location: Lincoln, UK
Posts: 7,585
Default

Thanks, Argitoth, I'll take a look at that later.

Any thoughts on data file saving? Any libraries for saving to/reading from human-readable formats?

Many thanks.


>
planetnine is offline   Reply With Quote
Old 02-23-2014, 02:04 PM   #462
Argitoth
Human being with feelings
 
Argitoth's Avatar
 
Join Date: Feb 2008
Location: Phoenix, AZ
Posts: 2,055
Default

planetnine, I don't understand the question... but maybe I don't know what you're referring to.
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template
Argitoth is offline   Reply With Quote
Old 02-23-2014, 03:03 PM   #463
timlloyd
Human being with feelings
 
Join Date: Mar 2010
Posts: 4,713
Default

Quote:
Originally Posted by planetnine View Post
Thanks, Argitoth, I'll take a look at that later.

Any thoughts on data file saving? Any libraries for saving to/reading from human-readable formats?

Many thanks.


>
If what you're saving is really simple, you don't need any special libraries. Just write each 'item' to a file as a string, separated by newlines. Easy to write, parse and read. For how to do that, places like wiki.python.org or StackOverflow are useful Or here:

http://www.pythonforbeginners.com/fi...iles-in-python

For example, here's how to create a config.txt file in a project folder and write some stuff to it:

Code:
import os

maxlen = 1024
proj = RPR_EnumProjects(-1, "", maxlen)[2]
proj_path, proj_fn = os.path.split(proj)

data = "stuff\nseparated\nby\nnewlines"

config_path = os.path.join(proj_path, "config.txt")

file = open(config_path, "w")
file.write(data)
file.close()
Or, you could use xml, for which there are various Python libraries such as ElementTree, which is part of the standard library.

Last edited by timlloyd; 02-23-2014 at 03:27 PM.
timlloyd is offline   Reply With Quote
Old 02-24-2014, 06:38 AM   #464
planetnine
Human being with feelings
 
planetnine's Avatar
 
Join Date: Oct 2007
Location: Lincoln, UK
Posts: 7,585
Default

Thanks Tim.

I want to be able to write and read a structured array of variables to a data file to store item, take, source file and marker "associations" that can be stored alongside a project file. This data file my be used by up to half a dozen actions, reading, replacing and appending records. Not that difficult in binary, but I'd like it to be human readable.

I'd hoped to use a similar format to the project file, and ideally, eventually save to a parllel project file (I figure there is no way to add "user data" to the project file itself; there is no accommodation in the project file structure allows for that -the data is per project in a function extension kind of way and this would solve a lot of problems if the project was moved, copied, incrementally saved, etc).

I have coded before, but not for a long time, and I'm only just getting my feet wet with Python. I can read nearly all of the information I need from REAPER and I can make all the edit window changes I need for these tools in theory, but I need to store the data now for my scripts to use in the project. Just wondered if there were any existing structured "ini file" type modules or tools before I start building from the ground up

I figure that some of the SWS actions must store config settings somewhere per project? Is there a convention or commonly-used way to add data to a parallel file to the REAPER project? Am I trying to bite off more than I can chew?

If it was flat data I figure you just overwrite the whole file each time, and reading is as simple as looking for the location of a bracketed header and reading one or two whole lines in their entirety. Ideally I'd like to just rewrite lines or append/ remove records as it will make my scripts much tighter. Don't know, got some thinking to do.


Edit: Can we persuade Justin to add a user data field or two to the Project markers edit dialogue? It would make this much easier




>

Last edited by planetnine; 02-24-2014 at 06:58 AM.
planetnine is offline   Reply With Quote
Old 02-24-2014, 06:54 AM   #465
timlloyd
Human being with feelings
 
Join Date: Mar 2010
Posts: 4,713
Default

For ini files, try this:

http://docs.python.org/2/library/configparser.html

Quote:
Originally Posted by planetnine View Post
I figure that some of the SWS actions must store config settings somewhere per project? Is there a convention or commonly-used way to add data to a parallel file to the REAPER project?
The ReaScript functions SetExtState, HasExtState, GetExtState etc. can be used to write to the reaper-extstate.ini file in the Reaper resource path. But I don't think it's possible to use these functions to write to a file that's stored in the project path.

You could use those functions to store your data in a [section] whose name is the project name or path. But that doesn't allow the saved data to be portable with projects.

Quote:
Am I trying to bite off more than I can chew?
I doubt it I might have time to post an example using configparser this evening (lunch break is over!)
timlloyd is offline   Reply With Quote
Old 02-24-2014, 07:03 AM   #466
planetnine
Human being with feelings
 
planetnine's Avatar
 
Join Date: Oct 2007
Location: Lincoln, UK
Posts: 7,585
Default

I'd already looked at SetExtState, HasExtState, GetExtState and realised it was global. A per project version would make life much easier

Well thanks very much for your help once again, Tim (and you Argitoth!) -I think I have some reading to do...

Cheers fellas...



>
planetnine is offline   Reply With Quote
Old 02-24-2014, 07:21 AM   #467
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,575
Default

Quote:
Originally Posted by planetnine View Post

I figure that some of the SWS actions must store config settings somewhere per project?
>
There's a section named "EXTENSIONS" at the end of a project file. I don't know what happens if you add your own section there.

Code:
  >
  <EXTENSIONS
    <S&M_PROJNOTES
      |sdfsfdsafdsafas
    >
  >
>
edit: "USERDATA" section would be nice (and an easy way to manipulate its contents)

Last edited by spk77; 02-24-2014 at 07:43 AM.
spk77 is offline   Reply With Quote
Old 02-24-2014, 08:50 AM   #468
planetnine
Human being with feelings
 
planetnine's Avatar
 
Join Date: Oct 2007
Location: Lincoln, UK
Posts: 7,585
Default

I might have a play with that with some scratch projects. Thanks for that spk77.


Edit: I don't suppose writing directly will work unless REAPER re-reads its project before writing it...

Edit2: Tim, been looking at configparser for 3.3 and I think that's just what I'm looking for.



>

Last edited by planetnine; 02-24-2014 at 09:08 AM.
planetnine is offline   Reply With Quote
Old 03-14-2014, 12:20 PM   #469
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,575
Default

Quote:
Originally Posted by Ozymandias View Post
Hey all,

I could really use a script which generates MIDI velocity ramps up/down where the new values are proportional to the selected notes' original velocity values.

To illustrate, let's say you have a set of values like this:



What I want to end up with is something that looks like this (hand drawn, but you get the idea):



I imagine you would need two user inputs: up/down and a percentage. If the ramp is up then the percentage governs the start of the ramp, and vice versa.


Thanks!

Finally :

http://forum.cockos.com/showthread.php?t=136929

spk77 is offline   Reply With Quote
Old 03-14-2014, 12:43 PM   #470
Argitoth
Human being with feelings
 
Argitoth's Avatar
 
Join Date: Feb 2008
Location: Phoenix, AZ
Posts: 2,055
Default

wow spk77... that is some f***ing brilliant innovative !@#$!
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template
Argitoth is offline   Reply With Quote
Old 03-14-2014, 01:18 PM   #471
Ozymandias
Human being with feelings
 
Join Date: Apr 2011
Posts: 144
Default

That is outstanding!

Thanks, Spk77! I can't wait to use it.
Ozymandias is offline   Reply With Quote
Old 04-03-2014, 06:04 PM   #472
James HE
Human being with feelings
 
James HE's Avatar
 
Join Date: Mar 2007
Location: I'm in a barn
Posts: 4,415
Default

This might be simple.

I'[d take a stab at it but I need to personally keep away from coding / scripting for a bit as it is habit forming for me and it really gets in the way of my self-destructive behavior.

Need a script to renumber markers...

Number all NAMED markers in the time line order 1-x.

then number all un-named markers in timeline order 1+x - y.


So this way, if I names a marker "verse" "chorus" or whatever, those get renumbered first, then the rest.
James HE is offline   Reply With Quote
Old 04-04-2014, 04:31 AM   #473
josematou
Human being with feelings
 
Join Date: Apr 2014
Posts: 6
Default preset in JS

Hi,

I have a simple script request.

i need to perform an action each time i change a preset in My js plug.

I searchedin JS SDK nothing is related to preset...

Thanks.
josematou is offline   Reply With Quote
Old 04-07-2014, 04:35 AM   #474
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 2,173
Default

Quote:
Originally Posted by James HE View Post
This might be simple.
Simple like a moon mission? There's the moon. Let's go there. You drive. Hehe. Seriously, tho, interested in knowing how to do this kind of stuff, but can't figure out how to get the names. Can get color. Should be simple. Probably don't have the syntax right.
FnA is offline   Reply With Quote
Old 04-07-2014, 05:10 AM   #475
timlloyd
Human being with feelings
 
Join Date: Mar 2010
Posts: 4,713
Default

Quote:
Originally Posted by FnA View Post
Simple like a moon mission? There's the moon. Let's go there. You drive. Hehe. Seriously, tho, interested in knowing how to do this kind of stuff, but can't figure out how to get the names. Can get color. Should be simple. Probably don't have the syntax right.
From the API:

Quote:
Parameters that return information are effectively passed by reference, not value. If an API returns a string value, it will usually be as the first parameter.
Code:
// Needs to be modified to ignore regions

function demo()
(
	i = 0;
	loop(CountProjectMarkers(0, 0, 0),
		EnumProjectMarkers3(0, i, 0, 0, 0, #nameOut, 0, 0);
		ShowConsoleMsg(strcat(#nameOut, "\n"));
		i += 1;
	);
);

demo();
timlloyd is offline   Reply With Quote
Old 04-07-2014, 05:16 AM   #476
James HE
Human being with feelings
 
James HE's Avatar
 
Join Date: Mar 2007
Location: I'm in a barn
Posts: 4,415
Default

Quote:
Originally Posted by FnA View Post
Simple like a moon mission? There's the moon. Let's go there. You drive. Hehe.

hey you got further than I did! LOL

Color could work, actually. Set a certain color to be the first ordered markers...
James HE is offline   Reply With Quote
Old 04-07-2014, 05:30 AM   #477
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 2,173
Default

Thanks timlloyd, sorry but I'm a total noob at EEL. Could you translate that to python?

James, dunno about SETTING colors. Uses 8 digit code. I just don't know what to put in EnumProjectMarkers3 to get the name returned. I know how to SET the name.

There's also this-SNM_GetProjectMarkerName. I don't know how to do the fast string thing.

Last edited by FnA; 04-07-2014 at 05:38 AM.
FnA is offline   Reply With Quote
Old 04-07-2014, 05:57 AM   #478
timlloyd
Human being with feelings
 
Join Date: Mar 2010
Posts: 4,713
Default

Sorry, I'm seeing EELs everywhere now - thought this was a different thread!

Quote:
Originally Posted by FnA View Post
Thanks timlloyd, sorry but I'm a total noob at EEL. Could you translate that to python?

James, dunno about SETTING colors. Uses 8 digit code. I just don't know what to put in EnumProjectMarkers3 to get the name returned. I know how to SET the name.

There's also this-SNM_GetProjectMarkerName. I don't know how to do the fast string thing.
Yes, you need to use the SNM functions to get marker names with Python:

Code:
from reaper_python import *
from sws_python import *


def get_marker_name(i):
    fs = SNM_CreateFastString("")
    SNM_GetProjectMarkerName(0, i + 1, 0, fs)
    name = SNM_GetFastString(fs)
    SNM_DeleteFastString(fs)
    if name:
        return name


num_markers = RPR_CountProjectMarkers(0, 0, 0)[2]

for i in range(0, num_markers):
    marker_name = get_marker_name(i)
    RPR_ShowConsoleMsg(marker_name + "\n")
(SWS reaper stuff needs to be installed etc and the script itself (on Mac at least) must be in the same folder as the sws_python files)

I might have time to do this script for you after work tonight James -- lunch break is over now though ...

Last edited by timlloyd; 04-07-2014 at 06:15 AM. Reason: got tabs and spaces intermingled somehow
timlloyd is offline   Reply With Quote
Old 04-07-2014, 06:16 AM   #479
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 2,173
Default

Thanks for the lesson timlloyd.
FnA is offline   Reply With Quote
Old 04-10-2014, 03:34 PM   #480
adastra
Human being with feelings
 
Join Date: Mar 2014
Posts: 9
Default expanded marker actions

Hey guys,
Hope I'm not breaking protocol here, and I don't know if Scripting is the best method to achieve this, but I need an expansion on some existing actions.

"Markers: Go To Marker X" Currently goes through 30 markers, and I need up to 150

and

"Markers: Add/move marker X to play/edit cursor" Currently goes to 10 and I need up to 150

This is for live tracking and virtual soundchecks, working with bands with large catalogs and I need a way to insert markers that I've pre-named in the SWS Marker list by having my console send midi messages to reaper for the relevant song marker.
The current actions work perfectly for me, they just are nowhere near enough.

Anyway, if anyone can help me out I'm happy to trade scotch, concert tickets or anything else you'd like. Thanks very much.
adastra 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 10:04 PM.


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