Old 06-25-2017, 02:22 AM   #1481
Chris Hurst Music
Human being with feelings
 
Chris Hurst Music's Avatar
 
Join Date: Mar 2017
Location: Wales, UK
Posts: 24
Default

Quote:
Originally Posted by mpl View Post
lua
Code:
  me =  reaper.MIDIEditor_GetActive()
  if me then take = reaper.MIDIEditor_GetTake( me ) end
  if take then 
    for i = 1, ({reaper.MIDI_CountEvts( take )})[2] do
      _, _, m, s, e, c, p, v = reaper.MIDI_GetNote( take, i-1 )
      if v > 28 and v < 41 then
        reaper.MIDI_SetNote( take, i-1, true, m, s, e, c, p, v, true )
      end
    end
  end
  reaper.MIDI_Sort( take )
Fantastic! Many thanks!
__________________
http://www.chrishurstmusic.com
Chris Hurst Music is online now   Reply With Quote
Old 06-25-2017, 12:39 PM   #1482
Chris Hurst Music
Human being with feelings
 
Chris Hurst Music's Avatar
 
Join Date: Mar 2017
Location: Wales, UK
Posts: 24
Default

New to Reaper and this forum is a goldmine of information on getting the most out of it!

Couple of things I have not been able to find out though, is if it is possible to have a script that deletes all of one type of CC (so a script to delete all CC1 or CC11) on a track?

Also, is there a script that could copy CC1 to CC11 do you know?

Many thanks.

(yes, I have been watching the Junkie XL video where he details his Cubase touch screen!)
__________________
http://www.chrishurstmusic.com
Chris Hurst Music is online now   Reply With Quote
Old 06-25-2017, 02:09 PM   #1483
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 1,208
Default

SWS/BR: Delete all events in last clicked lane
cfillion is offline   Reply With Quote
Old 06-25-2017, 02:28 PM   #1484
Chris Hurst Music
Human being with feelings
 
Chris Hurst Music's Avatar
 
Join Date: Mar 2017
Location: Wales, UK
Posts: 24
Default

Quote:
Originally Posted by cfillion View Post
SWS/BR: Delete all events in last clicked lane
Great, thank you.
__________________
http://www.chrishurstmusic.com
Chris Hurst Music is online now   Reply With Quote
Old 06-25-2017, 02:42 PM   #1485
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 1,390
Default

Copy/Paste CC should be somewhere in ReaPack also.
__________________
SoundCloud | MPL Scripts discussion | ReaPack | Donate
mpl is online now   Reply With Quote
Old 06-25-2017, 02:49 PM   #1486
Chris Hurst Music
Human being with feelings
 
Chris Hurst Music's Avatar
 
Join Date: Mar 2017
Location: Wales, UK
Posts: 24
Default

Quote:
Originally Posted by mpl View Post
Copy/Paste CC should be somewhere in ReaPack also.

Thanks, I'll do some digging!
__________________
http://www.chrishurstmusic.com
Chris Hurst Music is online now   Reply With Quote
Old 07-10-2017, 09:00 AM   #1487
reddiesel41264
Human being with feelings
 
reddiesel41264's Avatar
 
Join Date: Jan 2012
Location: North East UK
Posts: 409
Default

A plugin to crop videos?
__________________
David Healey
Purveyor of fine sample libraries (and Kontakt scripting tutorials) - http://xtant-audio.com/
reddiesel41264 is offline   Reply With Quote
Old 07-11-2017, 11:46 AM   #1488
kawa_
Human being with feelings
 
kawa_'s Avatar
 
Join Date: Mar 2016
Posts: 87
Default

Hi, I have just wrote video processor script.
though this may be get unexpected result , this script could to crop video.

[screen shot]
https://stash.reaper.fm/31122/VideoP...rop_test01.gif
https://stash.reaper.fm/31123/VideoP...rop_test02.PNG

Code:
//Video Crop Test

//@param2:xPos  'offset X'   0 -1 1
//@param3:yPos  'offset Y'   0 -1 1
//@param5:cropX 'crop X'     0  0 1
//@param6:cropY 'crop Y'     0  0 1
//@param7:cropW 'crop w'     1  0 1
//@param8:cropH 'crop h'     1  0 1
//@param10:isCropType 'Mode' 0  0 1 0.5 1
//====================================================================
img1 = 0;
img2 = input_ismaster() ? -2 : input_track(0);
( img2 > img1 || input_count() == 0 || input_ismaster() )?
(
  img_w = 0;
  img_h = 0;
  gfx_img_info (img1,img_w,img_h);
  //==================================================================
  ( isCropType == 0 )?
  (
    src_x = floor( img_w * cropX);
    src_y = floor( img_h * cropY);
    src_w = floor( img_w * cropW );
    src_h = floor( img_h * cropH );
    
  ):(
    src_x = floor( img_w * cropX *0.5);
    src_y = floor( img_h * cropY *0.5);
    src_w = floor( (img_w -src_x) * cropW -src_x );
    src_h = floor( (img_h -src_y) * cropH -src_y );
  );
  //==================================================================
  dest_x = floor(src_x + project_w *xPos);
  dest_y = floor(src_y + project_h *yPos);
  dest_w = src_w;
  dest_h = src_h;
  
  gfx_blit( img2
          , 0); // aspect
  
  gfx_dest = -1;
  gfx_blit( img1
          , 0 // aspect
          , dest_x , dest_y
          , dest_w , dest_h
          , src_x  , src_y
          , src_w  , src_h
          );           
);
__________________
Web : http://kawa.works
ReaScripts : MIDI-Section || MIDI-CC-Section
Reapack Repository : Reapack Repository

Last edited by kawa_; 07-11-2017 at 11:52 AM.
kawa_ is offline   Reply With Quote
Old 07-20-2017, 06:18 AM   #1489
Audio_Birdi
Human being with feelings
 
Join Date: Dec 2015
Posts: 14
Default

Hi there,

How would I go about creating a script that unselects / deselects only the first note / event of a pre-existing note selection? Below is a script that selects every 2nd event within a note selection, but i am unsure how to modify it so that it only selects the first note/event within a pre-existing note selection.

Thanks in advance!

Quote:
// Unselects every second selected event. Notes and CC are handled separately. (original by Veto, this version by spk77 - thanks a lot, guys)
// Uses "MIDI_Enum" -functions

Undo_BeginBlock2(0);
function unselectEverySecondEvent()
(
(take = MIDIEditor_GetTake(MIDIEditor_GetActive())) ? (
allEvents = MIDI_CountEvts(take, noteCount, ccCount, sysExCount);

index = -1;
k = 1;
while ((index = MIDI_EnumSelNotes(take, index)) != -1) (
MIDI_GetNote(take, index, isSelected, isMuted, startPpqPos, endPpqPos, channel, pitch, velocity) ? (
k % 2 == 0 ? (
MIDI_SetNote(take, index, 0, isMuted, startPpqPos, endPpqPos, channel, pitch, velocity);
);
k += 1;
);
);

index = -1;
n = 1;
while ((index = MIDI_EnumSelCC(take, index)) != -1) (
MIDI_GetCC(take, index, isSelected, isMuted, PpqPos, type, channel, CCnr, value) ? (
n % 2 == 0 ? (
MIDI_SetCC(take, index, 0, isMuted, PpqPos, type, channel, CCnr, value);
);
n += 1;
);
);
);
);

unselectEverySecondEvent();
Undo_EndBlock2(0,"Unselect every second note/CC",-1);
Audio_Birdi is offline   Reply With Quote
Old 07-20-2017, 09:51 AM   #1490
strachupl
Human being with feelings
 
Join Date: Jan 2013
Posts: 116
Default

Is this possible and how to do it to be always enabled in every project:
Midi - Preview inserted notes only when not playing. (When transport playing dont preview when stopped preview).
strachupl is offline   Reply With Quote
Old 07-20-2017, 02:53 PM   #1491
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 1,208
Default

Quote:
Originally Posted by strachupl View Post
Is this possible and how to do it to be always enabled in every project:
Midi - Preview inserted notes only when not playing. (When transport playing dont preview when stopped preview).
I made a script like that on ReaTeam Scripts repository: it's called "Toggle MIDI preview on transport change".

With SWS one can run actions when REAPER starts up or when opening a project.
  1. Create a custom action
  2. Put everything you wish to have running on startup in it
  3. Right click on your new custom action in the Action List and select "Copy selected action command ID"
  4. Extensions > Startup actions > Set global startup action
  5. Paste the command ID – done!
cfillion is offline   Reply With Quote
Old 07-22-2017, 08:12 PM   #1492
kawa_
Human being with feelings
 
kawa_'s Avatar
 
Join Date: Mar 2016
Posts: 87
Default

Quote:
Originally Posted by Audio_Birdi View Post
Hi there,

How would I go about creating a script that unselects / deselects only the first note / event of a pre-existing note selection? Below is a script that selects every 2nd event within a note selection, but i am unsure how to modify it so that it only selects the first note/event within a pre-existing note selection.
Hi! I watched up that code.
and I wrote(modify) EEL scripts of "unselect only First Note/Event " and "unselect Even/Odd number Note/Event". ( I attached script )

My English skills are not enough, so I am worrying in as slightly.
If this script was useful it was a good.
Attached Files
File Type: zip UnSelectOnlyFirstNote_eel.zip (2.4 KB, 10 views)
__________________
Web : http://kawa.works
ReaScripts : MIDI-Section || MIDI-CC-Section
Reapack Repository : Reapack Repository
kawa_ is offline   Reply With Quote
Old 07-23-2017, 04:09 AM   #1493
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 3,489
Default

Script Request:

"Toggle show Master Volume Envelope"

Is this maybe simple to script ?
Many thanks in advance !
vanhaze is offline   Reply With Quote
Old 07-23-2017, 01:41 PM   #1494
kawa_
Human being with feelings
 
kawa_'s Avatar
 
Join Date: Mar 2016
Posts: 87
Default

Hi,vanhaze!

I wrote "Toggle show Master Volume Envelope" script. reaper has "Toggle track volume envelope visible" native command, but this is available only selected tracks. ??
below script will select Master track and execute "Toggle track volume envelope visible" native command.


Code:
local proj = 0;

local isMasterTrackVisible = reaper.GetMasterTrackVisibility();
if ( isMasterTrackVisible ==0) --if not visible master track
then 
  reaper.SetMasterTrackVisibility(1) -- to show master track
end

local masterTrack = reaper.GetMasterTrack ( proj);
reaper.SetOnlyTrackSelected(masterTrack)
reaper.Main_OnCommandEx(40914, 0,proj); --( Track: Set first selected track as last touched track)
reaper.Main_OnCommandEx(40406, 0,proj); --( Track: Toggle track volume envelope visible)
Attached Files
File Type: lua kawa_ToggleMasterTrackEnvelope.lua (494 Bytes, 8 views)
__________________
Web : http://kawa.works
ReaScripts : MIDI-Section || MIDI-CC-Section
Reapack Repository : Reapack Repository
kawa_ is offline   Reply With Quote
Old 07-23-2017, 01:42 PM   #1495
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 3,489
Default

You are my Hero, many thanks kawa, works great !!
vanhaze is offline   Reply With Quote
Old 07-23-2017, 02:12 PM   #1496
kawa_
Human being with feelings
 
kawa_'s Avatar
 
Join Date: Mar 2016
Posts: 87
Default

Thank you so much Vanhaze! you are hero too.
in this summer, very hot. so I will be round like a cat good music for you.
__________________
Web : http://kawa.works
ReaScripts : MIDI-Section || MIDI-CC-Section
Reapack Repository : Reapack Repository
kawa_ is offline   Reply With Quote
Old 07-24-2017, 04:49 AM   #1497
Chris Hurst Music
Human being with feelings
 
Chris Hurst Music's Avatar
 
Join Date: Mar 2017
Location: Wales, UK
Posts: 24
Default

Hi there.

I know that there is an Action script that selects all tracks with MIDI data on (or hides those that have no data on), but does anyone know if it is possible to do the same thing but only starting from Bar 3 for example?

The reason I ask, is that I run a large Orchestral template where I use Bars 1 and 2 to hold MIDI CC information to balance the template/different orchestral sections against one another.

If I was to run the Action to only show tracks with MIDI data on, it would select them all, since they all do. If I was able to draw a selection line which started from bar 3 and went to the end of the track (bar 30 for example) and then run the action which would only focus on bars 3 to 30, then it would work.

Any thoughts? I hope that makes sense!
__________________
http://www.chrishurstmusic.com
Chris Hurst Music is online now   Reply With Quote
Old 07-24-2017, 02:48 PM   #1498
Audio_Birdi
Human being with feelings
 
Join Date: Dec 2015
Posts: 14
Default Script to input text when "enter value" box appears

Hello all,

I was wondering if there is a way to add some code to the following script, so that it enters a number inside the text box?

The following script brings up a dialog box, the user must enter a number inside the box so that it changes value of selected automation points.

Is there a way of making it so that it would enter a pre-given number that is embedded inside the script instead?

The original script is from X-Raym.

Thanks in advance!

Code:
-- ------ USER AREA =====>
mod1 = "absolute" -- Set the primary mod that will be defined if no prefix character. Values are "absolute" or "relative".
mod2_prefix = "+" -- Prefix to enter the secondary mod
input_default = "" -- "" means no character aka relative per default.
popup = true -- true/false
-- <===== USER AREA ------

function set_point_value()

  reaper.Undo_BeginBlock() -- Begining of the undo block. Leave it at the top of your main function.

  already_set = false

  envelope = reaper.GetSelectedEnvelope(0)

  if envelope ~= nil then

    env_point_count = reaper.CountEnvelopePoints(envelope)

    if popup then
      retval, user_input_str = reaper.GetUserInputs("Set or Offset point value", 1, "Value ?", input_default) -- We suppose that the user know the scale he want
    else
      user_input_str = input_default
    end

    if retval or not popup then

    x, y = string.find(user_input_str, mod2_prefix)
    --reaper.ShowConsoleMsg(user_input_str)

    if mod1 == "absolute" then
      if x ~= nil then -- set
        set = false
      else -- offset
        set = true
      end
    end

    if mod1 == "relative" then
      if x ~= nil then -- set
        set = true
      else -- offset
        set = false
      end
    end

    user_input_str = user_input_str:gsub(mod2_prefix, "")
    --reaper.ShowConsoleMsg(user_input_str)
    user_input_num = tonumber(user_input_str)

    -- IF VALID INPUT
    if user_input_num ~= nil then

      -- GET ENVELOPE RANGE -- HERE IT IS
      envelopeName = ""
      retval, envelopeName = reaper.GetEnvelopeName(envelope, envelopeName)
      --msg_stl("Envelope name", envelopeName, 1)
      --reaper.ShowConsoleMsg(envelopeName)

      if envelopeName == "Volume" or envelopeName == "Volume (Pre-FX)" or envelopeName == "Send Volume" then
        already_set = true

        env_scale = reaper.GetEnvelopeScalingMode(envelope)

        for i = 0, env_point_count - 1 do

        -- IDX 0 doesnt seem to work
        retval, time, valueOut, shape, tension, selectedOut = reaper.GetEnvelopePoint(envelope,i)

        if env_scale == 1 then valueOut = reaper.ScaleFromEnvelopeMode(1, valueOut) end

        if set == true then
          valueOut = math.exp(0*0.115129254)
        end

        if selectedOut == true then

          -- CALC
          OldVol = valueOut
          OldVolDB = 20*(math.log(OldVol, 10)) -- thanks to spk77!

          --msg_ftl("Old vol db:", OldVolDB, 1)

          calc = OldVolDB + user_input_num
          --msg_ftl("Calc", calc, 1)
          --reaper.ShowConsoleMsg(tostring(calc))

          if calc <= -146 then
          valueIn = 0
          --msg_s("Volume <= -146")
          end
          if calc >= 6 then
          valueIn = 2
          --msg_s("+12 <= Volume")
          end
          if calc < 6 and calc > -146 then
          valueIn = math.exp(calc*0.115129254)
          --msg_s("-146 < Volume < +12")
          end
          ----msg_ftl("Value ouput", valueIn, 1)
          -- SET POINT VALUE

          if env_scale == 1 then valueIn = reaper.ScaleToEnvelopeMode(1, valueIn) end

          reaper.SetEnvelopePoint(envelope, i, time, valueIn, shape, tension, 1, noSortInOptional)

        end -- ENDIF point is selected
        end -- END Loop
      end -- ENDIF Volume

      if envelopeName == "Mute" or envelopeName == "Send Mute" then
        already_set = true

        for i = 0, env_point_count - 1 do

        -- IDX 0 doesnt seem to work
        retval, time, valueOut, shape, tension, selectedOut = reaper.GetEnvelopePoint(envelope,i)
        if set == true then
          valueOut = 0
        end

        if selectedOut == true then

          -- CALC
          calc = valueOut + user_input_num

          if calc < 0 then
          valueIn = 0
          --msg_s("Mute = 0")
          end
          if calc >= 1 then
          valueIn = 1
          --msg_s("Mute = 1")
          end
          if calc < 0.5 then
          valueIn = 0
          --msg_s("Mute Floor < 0.5")
          end
          if calc >= 0.5 then
          valueIn = 1
          --msg_s("0.5 <= Mute Floor")
          end

          -- SET POINT VALUE
          reaper.SetEnvelopePoint(envelope, i, time, valueIn, shape, tension, 1, noSortInOptional)
        end -- ENDIF point is selected
        end -- END Loop
      end -- ENDIF Mute

      if envelopeName == "Width" or envelopeName == "Width (Pre-FX)" or envelopeName == "Pan" or envelopeName == "Pan (Pre-FX)" or envelopeName == "Pan (Left)" or envelopeName == "Pan (Right)" or envelopeName == "Pan (Left, Pre-FX)" or envelopeName == "Pan (Right, Pre-FX)" or envelopeName == "Send Pan" then
        already_set = true

        for i = 0, env_point_count - 1 do

        -- IDX 0 doesnt seem to work
        retval, time, valueOut, shape, tension, selectedOut = reaper.GetEnvelopePoint(envelope,i)
        if set == true then
          valueOut = 0

        end

        if selectedOut == true then

          -- CALC
          calc = valueOut*100 - user_input_num

          if calc <= -100 then
          valueIn = - 1.0
          --msg_s("Pan/Width <= -100")
          end
          if calc >= 100 then
          valueIn = 1.0
          --msg_s("Pan/Width >= 100")
          end
          if calc < 100 and calc > -100 then
          valueIn = calc / 100
          --msg_s("-100 < Pan/Width < 100")
          end

          -- SET POINT VALUE
          reaper.SetEnvelopePoint(envelope, i, time, valueIn, shape, tension, 1, noSortInOptional)
        end -- ENDIF point is selected
        end -- END Loop
      end -- ENDIF Pan or Width

      if envelopeName == "Pitch" then
        already_set = true


        for i = 0, env_point_count - 1 do

        -- IDX 0 doesnt seem to work
        retval, time, valueOut, shape, tension, selectedOut = reaper.GetEnvelopePoint(envelope,i)
        if set == true then
          valueOut = 0
        end

        if selectedOut == true then

          -- CALC
          calc = valueOut + user_input_num
          --msg_ftl("Old pitch:", valueOut, 1)
          --msg_ftl("New pitch (before floor):", calc, 1)

          if calc <= -3 then
          valueIn = -3
          --msg_s("Pitch <= -3")
          end
          if calc >= 3 then
          valueIn = 3
          --msg_s("Pitch <= +3")
          end
          if calc > -3 and calc < 3 then
          valueIn = floor((calc)*20+0.5)/20
          --msg_s("-3 < Pitch < 3")
          end
          -- SET POINT VALUE
          reaper.SetEnvelopePoint(envelope, i, time, valueIn, shape, tension, 1, noSortInOptional)
        end -- ENDIF point is selected
        end -- END Loop
      end -- ENDIF Pan or Width

      if already_set == false then -- IF ENVELOPE HAS NO NAME PAS ICI LA BOUCL !!

        for i = 0, env_point_count - 1 do

        -- IDX 0 doesnt seem to work
        retval, time, valueOut, shape, tension, selectedOut = reaper.GetEnvelopePoint(envelope,i)

        if set == true then
          valueOut = 0
        end

        if selectedOut == true then

          -- CALC
          calc = valueOut*100 + user_input_num

          if calc <= 0 then
          valueIn = 0
          --msg_s("FX <= 0")
          end
          if calc >= 100 then
          valueIn = 1.0
          --msg_s("100 <= FX")
          end
          if calc < 100 and calc > -100 then
          valueIn = calc / 100
          --msg_s("0 < FX < 100")
          end
          -- SET POINT VALUE
          reaper.SetEnvelopePoint(envelope, i, time, valueIn, shape, tension, 1, noSortInOptional)
        end -- ENDIF point is selected
        end -- END Loop
      end -- ENDIF Fx
    end
  end

  end --if envelope is selected
  reaper.Undo_EndBlock("Set or Offset selected envelope point value", -1) -- End of the undo block. Leave it at the bottom of your main function.
end -- END OF FUNCTION

set_point_value() -- Execute your main function

reaper.UpdateArrange() -- Update the arrangement (often needed)
Audio_Birdi is offline   Reply With Quote
Old 07-24-2017, 03:09 PM   #1499
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 1,208
Default

@Audio_Birdi Edit these two line: input_default = "put whatever here" and popup = false.
cfillion is offline   Reply With Quote
Old 07-25-2017, 03:10 AM   #1500
chumbo
Human being with feelings
 
Join Date: Apr 2015
Location: Brussels, Belgium
Posts: 406
Default REQ: slightly modified mpl script?

Hi,
I love the idea behind this script: "Script: mpl_Zoom horizontally, change grid relatively (mousewheel).lua" but I find the way it's implemented a bit strange.

I really just wanted the script to do EXACTLY what the title suggests but as it is now, it also enables/disables both the the Snap & Grid on/off!

Obviously, mpl had a very specific application in mind when he created it and it must have been the way he needed it to be.

I really was just hoping to replicate +- the way Ableton implements the zooming and grid view. In Ableton, it's adaptive to the zoom level: if you're zoomed out far, you obviously don't want to be seeing a mess of tons of very thin grid lines so it removes them gradually as you zoom out.
The same when you zoom in...as you get closer, smaller grid lines start appearing (from 1/4, to 1/8, 1/16, etc...).

mpl's script already does that beautifully BUT, it adds a very odd enable/disable of the grid and snap buttons to the mix which I don't understand and which were absent.

Could it be possible for some kind soul to just remove those from the script so that the Grid on/off and Snap on/off are unaffected by the zooming in or out?

Thanks! :-)
chumbo

(just to illustrate what I mean, here's a post where I explained the problem, before I knew it was because of the script...https://forum.cockos.com/showpost.ph...35&postcount=1
chumbo is offline   Reply With Quote
Old 07-26-2017, 03:14 PM   #1501
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 6,959
Default

A modified version of this script with no automatic Grid/Snap en-/disabling is now available via my ReaPack repo (link in sig).

mpl_nofishMod_Zoom horizontally, change grid relatively (mousewheel) (no Grid Snap auto-toggle).lua

edit:
I just noticed now, mpl also added a modified version to ReaPack that works as requested here.

"Zoom horizontally, change grid relatively, preserve grid visibility and snap state (mousewheel)"

As he's the original author, I'll remove my mod from ReaPack.



Quote:
Originally Posted by chumbo View Post
Hi,
I love the idea behind this script: "Script: mpl_Zoom horizontally, change grid relatively (mousewheel).lua" but I find the way it's implemented a bit strange.

I really just wanted the script to do EXACTLY what the title suggests but as it is now, it also enables/disables both the the Snap & Grid on/off!

Obviously, mpl had a very specific application in mind when he created it and it must have been the way he needed it to be.

I really was just hoping to replicate +- the way Ableton implements the zooming and grid view. In Ableton, it's adaptive to the zoom level: if you're zoomed out far, you obviously don't want to be seeing a mess of tons of very thin grid lines so it removes them gradually as you zoom out.
The same when you zoom in...as you get closer, smaller grid lines start appearing (from 1/4, to 1/8, 1/16, etc...).

mpl's script already does that beautifully BUT, it adds a very odd enable/disable of the grid and snap buttons to the mix which I don't understand and which were absent.

Could it be possible for some kind soul to just remove those from the script so that the Grid on/off and Snap on/off are unaffected by the zooming in or out?

Thanks! :-)
chumbo

(just to illustrate what I mean, here's a post where I explained the problem, before I knew it was because of the script...https://forum.cockos.com/showpost.ph...35&postcount=1

Last edited by nofish; 07-26-2017 at 04:49 PM.
nofish is offline   Reply With Quote
Old 07-26-2017, 03:24 PM   #1502
chumbo
Human being with feelings
 
Join Date: Apr 2015
Location: Brussels, Belgium
Posts: 406
Default

Awesome, thanks! :-)
For those interested in seeing it in action, it basically now works pretty much exactly like Ableton's Adaptive Grid. See here: https://www.youtube.com/watch?v=eLDkQ7WAtB0
chumbo is offline   Reply With Quote
Old 08-01-2017, 05:42 PM   #1503
Display
Human being with feelings
 
Display's Avatar
 
Join Date: Jun 2017
Posts: 2
Default MIDI Velocity Filter

Hello,
I'm trying to find a way to filter out (or gate) ghost MIDI notes which appear when softly and/or accidentally triggered by a Velocity of 1-10.
My AKAI MPD pads are pretty much useless at the moment as they're hyper sensitive!

Tried many scripts but I can't get them to work correctly because they're filtering out Velocity 0, so the [Note Off] signal never gets sent and the note remains perpetually on!
The parameters I imagine this script could have are simply,

Channel: All, 1-16
Velocity Threshold: 0-127 (anything below the threshold is ignored)



I did have a go at making one... but I really don't have a clue what I'm doing .'/
Thank you for any help or suggestions!
Display is offline   Reply With Quote
Old 08-02-2017, 03:26 AM   #1504
chumbo
Human being with feelings
 
Join Date: Apr 2015
Location: Brussels, Belgium
Posts: 406
Default

it's not a Reaper script but this very small (420kb?!) MIDI VST plugin suite will do the job...and more! ;-) (see the last plugin, bottom of the page): http://www.niallmoody.com/ndcplugs/ndcmidi.htm
Note: I haven't tested it but from the description it certainly seems to fit the bill

Last edited by chumbo; 08-02-2017 at 03:33 AM.
chumbo is offline   Reply With Quote
Old 08-02-2017, 10:46 PM   #1505
Display
Human being with feelings
 
Display's Avatar
 
Join Date: Jun 2017
Posts: 2
Default MIDI Velocity Filter

Thank you for the suggestion chumbo! I did try those (and one did filter out the velocity but not channel specific). I'm avoiding using them as they're 32-bit and require bridging.
Ideally I'd like to use as small as possible optimal/efficient script .'D

After more searching I managed to find a someone with similar problem, so I decided to go ahead and butcher someone else's script.
I used juliansader's pitch & velocity filter
Code:
Obsolete script. See Edit!
No idea if it's correct... but it does seems to work.
No clue how to integrate "Channel Input", but this will have to do for now as I'm beyond perplexed by scripting ,'/

EDIT:
Spent more time butchering more peoples scripts and managed to get it to filter out only the specified MIDI channel!! .'D
Hope this can help someone else suffering with super sensitive AKAI MPD pads!



Code:
//Original script from juliansader: https://forum.cockos.com/showpost.php?p=1744511&postcount=12
desc: MIDI Velocity Filter
	
slider1:0<0,16,1{All,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}>Channel Input
slider2:11<0,127,1>Velocity Threshold

in_pin:none
out_pin:none

////////////////////////////////////////////////////////////////////////////////////////////
@init

////////////////////////////////////////////////////////////////////////////////////////////
@slider

inChannel = slider1 -1;
velocityThreshold = slider2;

////////////////////////////////////////////////////////////////////////////////////////////
@block
while
(
	midirecv(offset, msg1, msg23) ?
	(
	channel = msg1 & $x0F;
	// Is it on the selected channel
	(channel == inChannel || inChannel == -1) ? 
		(
		// Extract MIDI data
		// Note that in JS's msg23, the lower 8 bits is msg2, and the higher 8 bits is msg3.
		eventType = msg1 >> 4;
		velocity = msg23 >> 8;
		// Is it a note-on or note-off event?
		(eventType == 9 || eventType == 8) ?
			(
				// If note-on, check velocity
				(eventType == 9 && velocity != 0) ?
				(      
					(velocity >= velocityThreshold) ?
					(
						midisend(offset, msg1, msg23); // Not filtered, pass through
					);
				);
				// Is note-off? (Remember that note-on with velocity = 0 is actually a note-off.)
				(eventType == 8 || (eventType == 9 && velocity == 0)) ?
				(
					midisend(offset, msg1, msg23); // Otherwise, pass through note-off event.
				);
			) : 
			// If not note event, just pass through
			(
				midisend(offset, msg1, msg23);
			);
		) :
		// Pass message on
		midisend(offset, msg1, msg23);
		// JS 'while' loops will loop until last statement in block is equal to zero.
		1; // Force loop to continue until all messages have been processed
	);
);
Attached Files
File Type: zip MIDI_Velocity_Fillter.zip (1.4 KB, 3 views)

Last edited by Display; 08-09-2017 at 07:34 AM. Reason: working script!
Display is offline   Reply With Quote
Old 08-12-2017, 12:14 PM   #1506
weblordpepe
Human being with feelings
 
Join Date: Jul 2016
Posts: 22
Default Request: Comb filter

Hi guys.

Is there some kind of way that I can make a low latency comb filter? For example I could enter in the number 10, and it would kill every 10th frequency. 10hz, 20hz, 30hz..

I've been looking at FFT approaches and it seems like they incur a latency. I'm uncertain how anyone even plays realtime through an FFT.

Does anyone know a way of doing this? I would accept FFT based or time domain based.

I offer picture of bunny.


Last edited by weblordpepe; 08-12-2017 at 12:19 PM. Reason: bunny
weblordpepe is offline   Reply With Quote
Old 08-13-2017, 12:37 AM   #1507
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 1,390
Default

Quote:
Originally Posted by weblordpepe View Post
low latency comb filter
Well, if you want low latency, then I guess FFT is not good for this kind of things. So maybe best way is to setup some bell filters.

Not really related, but funny:
__________________
SoundCloud | MPL Scripts discussion | ReaPack | Donate
mpl is online now   Reply With Quote
Old 08-14-2017, 09:05 PM   #1508
weblordpepe
Human being with feelings
 
Join Date: Jul 2016
Posts: 22
Default

Quote:
Originally Posted by mpl View Post
Well, if you want low latency, then I guess FFT is not good for this kind of things. So maybe best way is to setup some bell filters.

Not really related, but funny:
wow thats fantastic. 'bell' is actually something i needed to know. what you described in operation is in essence what im after.
weblordpepe is offline   Reply With Quote
Old 08-14-2017, 09:07 PM   #1509
weblordpepe
Human being with feelings
 
Join Date: Jul 2016
Posts: 22
Default

how did you set that up there? i'm unsure what the window is on the right.
i kinda need to do it in JSXFX. i can imagine it must be some insane amount of filter coefficients to pull that off, yeah?


i'm okay with having some kinda FIR filter that takes in a list of coefficience, or making one that takes coefficients - is there a good way to create a bell filter like that? like a formula i could use?

i want to have literally a few thousand notches. maybe 2000 or so notches with extreme Q.
weblordpepe is offline   Reply With Quote
Old 08-15-2017, 10:24 PM   #1510
Ivannn Bennnettt
Human being with feelings
 
Join Date: Feb 2017
Posts: 57
Default

Hey There)

I'd like to have script: "new subproject via copy".

And another thing but a bit more difficult it's "playback item".
Project bay has it one. Does api allow it to pull out that?

Cheers!

Last edited by Ivannn Bennnettt; 08-16-2017 at 04:52 PM.
Ivannn Bennnettt is online now   Reply With Quote
Old 08-17-2017, 01:24 AM   #1511
Ivannn Bennnettt
Human being with feelings
 
Join Date: Feb 2017
Posts: 57
Default

Quote:
Originally Posted by Ivannn Bennnettt View Post
And another thing but a bit more difficult it's "playback item".
Project bay has it one. Does api allow it to pull out that?
Found:
Xenakios/SWS: Preview selected media item through track (toggle)
Ivannn Bennnettt is online now   Reply With Quote
Old Yesterday, 06:22 AM   #1512
Lib
Human being with feelings
 
Join Date: Jul 2017
Posts: 1
Default Amplitude to MIDI CC

Hi all!
I'm looking for a JSFX to send amplitude values as MIDI CCs to my Lemur. The goal is to get a visual representation of the amplitude on the iPad, without having to check the computer screen. I'm guessing something like that already exists, but I couldn't find it. There is the Audio to MIDI Drum Trigger JS, but it sends as well 0s when the trigger closes. A JS plugin would be great, as I'm planning to use it on both Reaper and Cantabile.
Thanks!
Lib 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 12:54 AM.


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