Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 02-25-2020, 04:53 PM   #441
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,032
Default

Dear mespotine, today I played a bit with parmlearn functions, it seems the counting of learned parms is not working correctly. Even I had a few learned parameters this function was returning 0, in this project. In another project it was returning something, meaning for some fx 1.
PHP Code:
function ultraschall.CountParmLearn_FXStateChunk(FXStateChunkfxid
Easy and quick test references can be created simply rgrep'ing the to be tested .rpp file for 'parmlearn', so many results above function should deliver at least.

If you want I can create a test.rpp?

Last edited by TonE; 02-26-2020 at 05:51 AM.
TonE is offline   Reply With Quote
Old 02-26-2020, 11:32 AM   #442
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Yes, testprojects are always useful.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 02-26-2020, 12:55 PM   #443
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,032
Default

Quote:
Originally Posted by mespotine View Post
Yes, testprojects are always useful.
I called the testproject* 'mespotine ep' It is only an empty project, but with 6 mappings which should be recognized, 1 mapping per track. Let us start small. In the past I had projects with 1440 mappings per project, I used autohotkey for mapping them, the code is still in this forum somewhere, I mentioned it multiple times in various related topics. Actually this whole story is just doing kind of same, but in a more elegant way, first without needing AutoHotkey anymore, plus projects can be mapped while being open in Reaper, plus mapping files could be shared, thus saving/loading of midi_mappings.txt for a given hardware definition, for example reason mode which is my favourite, because it exists prebuilt in the hardware bitstream 3x, you can never lose this mapping, switch on the hardware, start! No time wasting with mappings on the hardware side, on the software side, this solution will it be in future, hopefully.

* https://github.com/michaelsjackson/r...orums/issues/4
TonE is offline   Reply With Quote
Old 02-26-2020, 03:50 PM   #444
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Thanks. Can you also give me a testscript, which reflects the behavior with the testproject?
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 02-26-2020, 11:43 PM   #445
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,032
Default

Thanks for caring, here we go.

export_track_names.lua
PHP Code:
-- export track numbertrack namefx nameparameter name as text fileTonE greets you :)

dofile(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua")  -- required for ultraschall

local reaper 
reaper

-- construct an array
track_names_array = {}
function 
Main( )
   -- 
construct a string
   result 
"" 
   
   
for i=1,reaper.CountTracks() do
      
track_names_array[i] = {}

      -- 
i is track numberstarting counting with 1
      trackname 
ultraschall.GetTrackName(i)
      
track_names_array[i].trackname trackname

      
-- fxname ultraschall.GetTrackName(i)
      
local fromTrack reaper.GetTrack(0,i-1)
      if 
fromTrack ~= nil 
      then
         local fxcount 
reaper.TrackFX_GetCount(fromTrack)

         -- 
first of triple command
         B0
TrackStateChunk reaper.GetTrackStateChunk(fromTrack,"",false)

         -- 
second of triple command
         
-- Returns an FXStateChunk from a TrackStateChunk or a MediaItemStateChunk.
         -- 
An FXStateChunk holds all FX-plugin-settings for a specific MediaTrack or MediaItem.
         
FXStateChunk        ultraschall.GetFXStateChunk(TrackStateChunk1)

         
         if 
fxcount == 0 then
           result 
result .. .. "," .. trackname .. "," .. "fx count:0" .. "\n"
         
else    
           for 
j=1,fxcount do
              --
local retfxname reaper.TrackFX_GetFXName(fromTrack0"")
             
local retfxname reaper.TrackFX_GetFXName(fromTrackj-1"")
                        -- if 
fxname == "" then fxname "fxname will be here" end
             track_names_array
[i].fxname fxname       -- fxname using 0 it should show first fx at least
             
             
-- get parameter names from fxname
             numparams 
reaper.TrackFX_GetNumParams(fromTrackj-1)

             -- 
third of triple command
             
-- integer count ultraschall.CountParmLearn_FXStateChunk(string FXStateChunkinteger fxid)
             -- 
Description:
             -- 
Counts already existing Parm-Learn-entries of an FX-plugin from an FXStateChunk.
             
paramslearned ultraschall.CountParmLearn_FXStateChunk(FXStateChunkj-1)

             
             for 
k=1,numparams do
                --
boolean retvalstring buf reaper.TrackFX_GetParamName(MediaTrack trackinteger fxinteger paramstring buf)
                
retparamname reaper.TrackFX_GetParamName(fromTrackj-1k-1"")            
                
             
                --
track_names_array[i].paramname "paramname will be here"     -- paramname is the goal here
             
                result 
result .. .. "," .. trackname .. "," .. fxname .. "," .."fx count:" .. .. "," .. paramname .. "," .. "param count:" .. .. "," .. "paramslearned:" .. paramslearned .. "\n"
                
-- "parm learn:" .. .. .. .. .. .. "\n"
                
--1


      
--ultraschall.GetParmLearn_MediaTrack(MediaTrackfxidid)
      --
A,B,C,D,E,F,G=ultraschall.GetParmLearn_MediaTrack(reaper.GetTrack(0,0), 11)


                
             
end
             
           end
         end  
      end
      
  end

end


function export()
  -- 
OS BASED SEPARATOR
  
if reaper.GetOS() == "Win32" or reaper.GetOS() == "Win64" then
    slash 
"\\"
  
else
    
slash "/"
  
end

  resource 
reaper.GetResourcePath()

  -- 
file_name reaper.GetTakeNametake )
  -- 
dir_name resource .. slash .. "Data" .. slash .. "MIDI Sequences"
  
dir_name reaper.GetProjectPath("")
  
reaper.RecursiveCreateDirectory(dir_name0)

  -- 
file dir_name .. slash .. file_name .. ".txt"
  
file dir_name .. slash .. "midi_mappings" .. ".txt"

  
-- CREATE THE FILE
--  io.open(file"w")
--  
io.output(f)
  --
Msg(file)

--  for 
iline in ipairs(track_names_array) do
--     
f:writetostring.. "," .. track_names_array[i].trackname .. "," .. track_names_array[i].fxname .. "," .. track_names_array[i].paramname ) )
--    if 
== #track_names_array then break end
--    f:write("\n")
--  
end

--  f:close() -- never forget to close the file

--  Msg("File exported: " .. file)


file2 dir_name .. slash .. "midi_mappings_result" .. ".txt"
io.open(file2"w")
    
io.output(f)
f:writeresult )
f:close()
Msg("File exported: " .. file2)
  
end

function Msg(g)
  
reaper.ShowConsoleMsg(tostring(g).."\n")
end



-------------------------------
-- 
INIT
-------------------------------

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

  
Main( ) -- Execute your main function
  
export()

  
reaper.Undo_EndBlock("Export track based midi mapping information as CSV"0) -- End of the undo blockLeave it at the bottom of your main function.

  
reaper.UpdateArrange() -- Update the arrangement (often needed)

-- 
end -- 
TonE is offline   Reply With Quote
Old 03-16-2020, 07:31 AM   #446
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 813
Default

Quote:
Originally Posted by mespotine View Post
It'll start probably in April, as I need some time to rest. Only bugfixes until then.
May I come with an additional suggestion?

It would be nice to have a function that check if a time selection is done -
boolean IsTimeSelectionDone.

Have looked in ReaperAPI and UltrashallAPI but couldn't find it....
__________________
ToDoList Obliques MusicMath Donation Some of mine and my friends music projects on Spotify
tompad is offline   Reply With Quote
Old 03-16-2020, 08:34 AM   #447
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,109
Default

Quote:
Originally Posted by tompad View Post
It would be nice to have a function that check if a time selection is done
Here's an example script to check if a time selection is set:
https://forum.cockos.com/showthread....53#post2169253
nofish is offline   Reply With Quote
Old 03-16-2020, 11:55 AM   #448
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 813
Default

Quote:
Originally Posted by nofish View Post
Here's an example script to check if a time selection is set:
https://forum.cockos.com/showthread....53#post2169253
Voow! Thanks!

(Silly me - forgot to check the forum - just checked the ReaperAPI and UltrashallAPI)
__________________
ToDoList Obliques MusicMath Donation Some of mine and my friends music projects on Spotify
tompad is offline   Reply With Quote
Old 03-17-2020, 11:55 AM   #449
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

But yeah, it could be helpful to have such a function, so I'll put one in.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 03-17-2020, 11:45 PM   #450
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 813
Default

Quote:
Originally Posted by mespotine View Post
But yeah, it could be helpful to have such a function, so I'll put one in.
Great - thanks!
__________________
ToDoList Obliques MusicMath Donation Some of mine and my friends music projects on Spotify
tompad is offline   Reply With Quote
Old 04-17-2020, 11:18 AM   #451
WarrenG
Human being with feelings
 
WarrenG's Avatar
 
Join Date: Jan 2020
Location: In the studio at my desk
Posts: 365
Default

Sorry not sure if this is the place to post this but for days I keep getting this response after a Reapack sync:

https://raw.githubusercontent.com/Ul...gelog-Api.txt:
HTTP response code said error (22): The requested URL returned error: 404 Not Found

https://raw.githubusercontent.com/Ul...chall_api.lua:
HTTP response code said error (22): The requested URL returned error: 404 Not Found

https://raw.githubusercontent.com/Ul...pi_readme.txt:
HTTP response code said error (22): The requested URL returned error: 404 Not Found

What might be the solution?
Thanks
Warren
WarrenG is offline   Reply With Quote
Old 04-17-2020, 02:02 PM   #452
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Yes, it's the right placce to post it.

I'll check and fix it. Thanks for reporting.

Can you give me the Reapack-link to Ultraschall-API, you are using?

Edit:
You are using the pre-release-reapack-index, which will have problems in the next few days. I recommend to use the official one:

https://github.com/Ultraschall/ultra..._api_index.xml


@all
No one complained about the fact, that I presented the final, but didn't update the Reapack-index file for that. I'm somehow disappointed
Just kidding. Updated index-file.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...

Last edited by Meo-Ada Mespotine; 04-17-2020 at 02:37 PM.
Meo-Ada Mespotine is offline   Reply With Quote
Old 04-17-2020, 06:57 PM   #453
WarrenG
Human being with feelings
 
WarrenG's Avatar
 
Join Date: Jan 2020
Location: In the studio at my desk
Posts: 365
Default

Thank you very much!

30 years in live sound during the analog days did not prepare me for DAW's and scripts. But I do enjoy it. Just take awhile to get started again.


Thanks

Warren
WarrenG is offline   Reply With Quote
Old 04-17-2020, 07:09 PM   #454
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Have fun with it. Reaper-scripting is cool.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 04-18-2020, 08:47 AM   #455
aurelien
Human being with feelings
 
Join Date: Apr 2014
Posts: 96
Default

Hello!
I'm reporting a bug in the RenderProject_RenderTable function : the OnlyMonoMedia flag boolean value is not taken into account.

Here's the code :
1.I create a render table with all my options,
2.I save it to the project, when I check in reaper, it's correctly saved
3.When I call the RenderProject_RenderTable, the rendered file is stereo.

Thanks,


PHP Code:
function RenderAllSelectedItemsThroughMaster()
    --
wav config wav 24bits function 
    
render_cfg_string ultraschall.CreateRenderCFG_WAV(2000false)
    
    --
Settings of the render table
    sourceDropDown
=32 -- 0 MasterMix32 Selected Mediam Items64 selected item via master
    bounds
=-- 2 TimeSelection3 Projects region4 Selected Media5 Selected Regions
    Startposition 
=0
    Endposition 
=0
    TailFlag 
=1
    TailMS
=0
    renderDirectory
="D:\\Test\\"
    
filePattern="$item"
    
sampleRate=48000
    channels
=2
    OfflineOnlineRendering
=0
    ProjectSampleRateFXProcessing 
=true
    RenderResample 
=9
    OnlyMonoMedia 
true
    MultiChannelFiles
=false
    dither
=0
    SilentlyIncrementFilename
=false
    AddToProj
=false
    SaveCopyOfProject
=false
    RenderQueueDelay
=false
    RenderQueueDelaySeconds
=0
    CloseAfterRender
=false
    
    
--Create the RenderTable
    RenderTable 
ultraschall.CreateNewRenderTable(sourceDropDownboundsStartpositionEndpositionTailFlagTailMSrenderDirectoryfilePatternsampleRatechannelsOfflineOnlineRenderingProjectSampleRateFXProcessingRenderResampleOnlyMonoMediaMultiChannelFilesditherrender_cfg_stringSilentlyIncrementFilenameAddToProjSaveCopyOfProjectRenderQueueDelayRenderQueueDelaySecondsCloseAfterRender)
    --
Apply the render table to project
    ultraschall
.ApplyRenderTable_Project(RenderTable,false)
    
ultraschall.ShowLastErrorMessage()
    
    --
Render with the Render table
    local count
MediaItemStateChunkArrayFilearray ultraschall.RenderProject_RenderTable(nilRenderTablefalsefalsefalse)

    
ultraschall.ShowLastErrorMessage()

    return 
Filearray
end 
aurelien is offline   Reply With Quote
Old 04-18-2020, 10:00 AM   #456
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Thanks, I'll have a check.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 04-18-2020, 10:19 AM   #457
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

New Hotfix available:

Hotfix 1 from 18th of April 2020

Changes:
- Markers: CountNormalMarkers_NumGap - had inner variables exposed -> fixed(thanks to fernsehmuell)
- MediaItems: IsValidMediaItemStateChunkArray - didn't always return true, when MediaItemStateChunkArrays were passed over it -> fixed
- Render: ApplyRenderTable_Project - accidentally reversed true and false in parameter OnlyMonoMedia -> fixed (thanks to aurelien)
- Ultraschall: IsTrackSoundboard - had inner variable exposed -> fixed
- Ultraschall: IsTrackStudioLink - had inner variable exposed -> fixed
- Ultraschall: IsTrackStudioLinkOnAir - had inner variable exposed -> fixed

please update your ReaPacks.

@aurelien
Should be fixed now. Was a problem with ApplyRenderTable_Project, which mistook false as true and true as false. Stupid bug on my side.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 04-18-2020, 11:43 AM   #458
aurelien
Human being with feelings
 
Join Date: Apr 2014
Posts: 96
Default

Awesome, thanks Mespotine!
aurelien is offline   Reply With Quote
Old 04-18-2020, 05:35 PM   #459
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Ok, will now post under this new account, to prevent accidental misgendering.
Also means, PMs only to this one.

You can stille use @mespotine to address me
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 04-19-2020, 03:32 AM   #460
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,032
Default

Quote:
Originally Posted by mespotine View Post
Have fun with it. Reaper-scripting is cool.
Especially, we have immediate gratification, when things work, in an area we are really interested, like making music, and not some code examples from programming books, that makes it big fun.
TonE is offline   Reply With Quote
Old 04-19-2020, 04:52 PM   #461
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Ok, boys and girls, I'm back at developing Ultraschall-API.
The first instalment of the US-API 4.1-devcycle will be released probably next week.

Have some big plans for it in preparation and in parts, actual development.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 04-19-2020, 10:54 PM   #462
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 813
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Ok, boys and girls, I'm back at developing Ultraschall-API.
The first instalment of the US-API 4.1-devcycle will be released probably next week.

Have some big plans for it in preparation and in parts, actual development.
Yummy!
__________________
ToDoList Obliques MusicMath Donation Some of mine and my friends music projects on Spotify
tompad is offline   Reply With Quote
Old 04-27-2020, 02:43 AM   #463
aurelien
Human being with feelings
 
Join Date: Apr 2014
Posts: 96
Default

Hi !
Found a bug in the following function in ultraschall_functions_TrackManagement_Module.lua

PHP Code:
function ultraschall.DeleteTracks_TrackString(trackstring
Line 1536, when the API is calling this method with more than one track, the tracking argument is "tracknumber1,tracknumber2" and when the reaper.DeleteTrack is called, we get the following :

bad argument #1 to 'DeleteTrack' (MediaTrack expected)


Code is below :
PHP Code:
  local validcountindividual_tracknumbers ultraschall.IsValidTrackString(trackstring)
  if 
valid==false then ultraschall.AddErrorMessage("DeleteTracks_TrackString""trackstring""must be a valid trackstring", -1) return false end
  
for i=1count do
    
reaper.DeleteTrack(reaper.GetTrack(0,individual_tracknumbers[i]-1))
  
end
  
return true
end 
Investigated a bit more, as you delete tracks, need to iterate the loop by beginning at the end:
PHP Code:
    for i=count1, -do
        
reaper.DeleteTrack(reaper.GetTrack(0,individual_tracknumbers[i]-1))
    
end 

Last edited by aurelien; 04-27-2020 at 03:51 AM.
aurelien is offline   Reply With Quote
Old 04-27-2020, 09:52 AM   #464
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Thanks, will fix this asap.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 04-27-2020, 06:43 PM   #465
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

New Hotfix available:

Hotfix2: 28th of April 2020
  • DeveloperTools: Ultraschall State Inspector - extended number of saveslots to 20; didn't correctly store and load gmem-states from the stateslots -> fixed (thanks to lexaproductions)
  • TrackManagement: DeleteTracks_TrackString - didn't correctly delete the right tracks, sometimes throwing Lua-error -> fixed (thanks to aurelien)

Please update your ReaPacks.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 04-27-2020, 09:27 PM   #466
lexaproductions
Human being with feelings
 
Join Date: Jan 2013
Posts: 1,128
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
New Hotfix available:
  • DeveloperTools: Ultraschall State Inspector - extended number of saveslots to 20; didn't correctly store and load gmem-states from the stateslots -> fixed (thanks to lexaproductions)
Man you have no clue for how long I wanted to have GMEMS in this script. Thank yoooouuuuuuuu!!!!
lexaproductions is offline   Reply With Quote
Old 04-27-2020, 09:38 PM   #467
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Quote:
Originally Posted by lexaproductions View Post
Man you have no clue for how long I wanted to have GMEMS in this script. Thank yoooouuuuuuuu!!!!
Woman! :P

I also raised the number of saveslots available to 20, as I thought, nine are somehow very limited. Could be helpful as well, the more states for monitoring are needed.

Note to myself:
Definitely need to rewrite it from scratch. The codebase is terrible and messy for the StateInspector... Geez....
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...

Last edited by Meo-Ada Mespotine; 04-27-2020 at 09:43 PM.
Meo-Ada Mespotine is offline   Reply With Quote
Old 04-28-2020, 11:59 PM   #468
TabbyCat
Human being with feelings
 
TabbyCat's Avatar
 
Join Date: May 2019
Location: Los Angeles, CA
Posts: 161
Default

LOVE this API - thank you!

I was having trouble getting ultraschall.MB to work (nothing would happen) - so I enabled the function to show errors in the Console. The error I received was that I wasn't running Windows. ...but I am running Windows

I tracked it down to ultraschall_functions_ReaperUserInterface_Module, line 1071, where we have:

Code:
if ultraschall.IsOS_Windows()==true then ultraschall.AddErrorMessage("MB", "", "works only on Windows, sorry", 0) return -1 end
...but shouldn't it be instead:

Code:
if ultraschall.IsOS_Windows()~=true...
Meaning, it should error if IsOS_Windows does not return true? I changed this and now it's working great ...until you push an update, lol!
TabbyCat is offline   Reply With Quote
Old 04-29-2020, 07:45 AM   #469
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Oh.. Erhmm.. Will check that and make this bug never happened at all...


Geez... It's always the stupid typos being the annoyed bugs.


By the way, you can use SLEM() as well, which displays the last error message.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 04-29-2020, 11:44 AM   #470
TabbyCat
Human being with feelings
 
TabbyCat's Avatar
 
Join Date: May 2019
Location: Los Angeles, CA
Posts: 161
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Oh.. Erhmm.. Will check that and make this bug never happened at all...Geez... It's always the stupid typos being the annoyed bugs.
LOL no problem! Your work is appreciated.

If it makes you feel better - in your response, I thought "SLEM? What does that mean? Why 'SLEM' for an error message?"

yeah...Show...Last...Error...Message...
TabbyCat is offline   Reply With Quote
Old 04-29-2020, 01:36 PM   #471
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Funny thing is, as the word sound very much like JAM, I always have Michael Jackson's Jam in my head, when writing this function O_O XD
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 04-30-2020, 01:54 PM   #472
aurelien
Human being with feelings
 
Join Date: Apr 2014
Posts: 96
Default

Quick question, i updated via reapack but i did not get the hotfix, is there something specific to do to get them?
aurelien is offline   Reply With Quote
Old 04-30-2020, 05:52 PM   #473
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Hmm, it should have been in there. Can you post me the outputs of GetApiVersion?
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-01-2020, 08:43 PM   #474
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

New Hotfix available:

- Helperfunctions: IsValidMatchingPattern - wasn't reporting unfinished captures all the time -> improved
- User Interface: MB - didn't work on Windows, though it should only work on Windows -> fixed (thanks to TabbyCat)

Please update your ReaPacks
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...

Last edited by Meo-Ada Mespotine; 05-01-2020 at 10:20 PM.
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-02-2020, 01:29 AM   #475
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 813
Default

Hi Meo-Ada!

Any news on IsTimeSigmarkersAtPosition and IsTimeSelectionDone?
__________________
ToDoList Obliques MusicMath Donation Some of mine and my friends music projects on Spotify
tompad is offline   Reply With Quote
Old 05-02-2020, 04:52 PM   #476
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

IsTimeSigmarkersAtPosition with the next release. With IsTimeSelectionDone, it's returning true if there's a timeselection, right? If yes, will also be in the next one.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-02-2020, 07:51 PM   #477
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Quote:
Originally Posted by TonE View Post
Thanks for caring, here we go.

export_track_names.lua
PHP Code:
-- export track numbertrack namefx nameparameter name as text fileTonE greets you :)

dofile(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua")  -- required for ultraschall

local reaper 
reaper

-- construct an array
track_names_array = {}
function 
Main( )
   -- 
construct a string
   result 
"" 
   
   
for i=1,reaper.CountTracks() do
      
track_names_array[i] = {}

      -- 
i is track numberstarting counting with 1
      trackname 
ultraschall.GetTrackName(i)
      
track_names_array[i].trackname trackname

      
-- fxname ultraschall.GetTrackName(i)
      
local fromTrack reaper.GetTrack(0,i-1)
      if 
fromTrack ~= nil 
      then
         local fxcount 
reaper.TrackFX_GetCount(fromTrack)

         -- 
first of triple command
         B0
TrackStateChunk reaper.GetTrackStateChunk(fromTrack,"",false)

         -- 
second of triple command
         
-- Returns an FXStateChunk from a TrackStateChunk or a MediaItemStateChunk.
         -- 
An FXStateChunk holds all FX-plugin-settings for a specific MediaTrack or MediaItem.
         
FXStateChunk        ultraschall.GetFXStateChunk(TrackStateChunk1)

         
         if 
fxcount == 0 then
           result 
result .. .. "," .. trackname .. "," .. "fx count:0" .. "\n"
         
else    
           for 
j=1,fxcount do
              --
local retfxname reaper.TrackFX_GetFXName(fromTrack0"")
             
local retfxname reaper.TrackFX_GetFXName(fromTrackj-1"")
                        -- if 
fxname == "" then fxname "fxname will be here" end
             track_names_array
[i].fxname fxname       -- fxname using 0 it should show first fx at least
             
             
-- get parameter names from fxname
             numparams 
reaper.TrackFX_GetNumParams(fromTrackj-1)

             -- 
third of triple command
             
-- integer count ultraschall.CountParmLearn_FXStateChunk(string FXStateChunkinteger fxid)
             -- 
Description:
             -- 
Counts already existing Parm-Learn-entries of an FX-plugin from an FXStateChunk.
             
paramslearned ultraschall.CountParmLearn_FXStateChunk(FXStateChunkj-1)

             
             for 
k=1,numparams do
                --
boolean retvalstring buf reaper.TrackFX_GetParamName(MediaTrack trackinteger fxinteger paramstring buf)
                
retparamname reaper.TrackFX_GetParamName(fromTrackj-1k-1"")            
                
             
                --
track_names_array[i].paramname "paramname will be here"     -- paramname is the goal here
             
                result 
result .. .. "," .. trackname .. "," .. fxname .. "," .."fx count:" .. .. "," .. paramname .. "," .. "param count:" .. .. "," .. "paramslearned:" .. paramslearned .. "\n"
                
-- "parm learn:" .. .. .. .. .. .. "\n"
                
--1


      
--ultraschall.GetParmLearn_MediaTrack(MediaTrackfxidid)
      --
A,B,C,D,E,F,G=ultraschall.GetParmLearn_MediaTrack(reaper.GetTrack(0,0), 11)


                
             
end
             
           end
         end  
      end
      
  end

end


function export()
  -- 
OS BASED SEPARATOR
  
if reaper.GetOS() == "Win32" or reaper.GetOS() == "Win64" then
    slash 
"\\"
  
else
    
slash "/"
  
end

  resource 
reaper.GetResourcePath()

  -- 
file_name reaper.GetTakeNametake )
  -- 
dir_name resource .. slash .. "Data" .. slash .. "MIDI Sequences"
  
dir_name reaper.GetProjectPath("")
  
reaper.RecursiveCreateDirectory(dir_name0)

  -- 
file dir_name .. slash .. file_name .. ".txt"
  
file dir_name .. slash .. "midi_mappings" .. ".txt"

  
-- CREATE THE FILE
--  io.open(file"w")
--  
io.output(f)
  --
Msg(file)

--  for 
iline in ipairs(track_names_array) do
--     
f:writetostring.. "," .. track_names_array[i].trackname .. "," .. track_names_array[i].fxname .. "," .. track_names_array[i].paramname ) )
--    if 
== #track_names_array then break end
--    f:write("\n")
--  
end

--  f:close() -- never forget to close the file

--  Msg("File exported: " .. file)


file2 dir_name .. slash .. "midi_mappings_result" .. ".txt"
io.open(file2"w")
    
io.output(f)
f:writeresult )
f:close()
Msg("File exported: " .. file2)
  
end

function Msg(g)
  
reaper.ShowConsoleMsg(tostring(g).."\n")
end



-------------------------------
-- 
INIT
-------------------------------

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

  
Main( ) -- Execute your main function
  
export()

  
reaper.Undo_EndBlock("Export track based midi mapping information as CSV"0) -- End of the undo blockLeave it at the bottom of your main function.

  
reaper.UpdateArrange() -- Update the arrangement (often needed)

-- 
end -- 

I've investigated into it.
the following line in your code is the problem:

Code:
   paramslearned = ultraschall.CountParmLearn_FXStateChunk(FXStateChunk, j-1)
it should be this way, as you were trying to read the zero'th parmlearn, not the first parmlearn.

Code:
   paramslearned = ultraschall.CountParmLearn_FXStateChunk(FXStateChunk, j)
I'll add an error-message, which will warn, if you try to set fxid=0, instead of fxid=1 and higher.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...

Last edited by Meo-Ada Mespotine; 05-02-2020 at 07:58 PM.
Meo-Ada Mespotine is offline   Reply With Quote
Old 05-03-2020, 01:27 AM   #478
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 813
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
IsTimeSigmarkersAtPosition with the next release. With IsTimeSelectionDone, it's returning true if there's a timeselection, right? If yes, will also be in the next one.
Yes!

Thank you so much, miss!
__________________
ToDoList Obliques MusicMath Donation Some of mine and my friends music projects on Spotify
tompad is offline   Reply With Quote
Old 05-04-2020, 03:37 AM   #479
aurelien
Human being with feelings
 
Join Date: Apr 2014
Posts: 96
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Hmm, it should have been in there. Can you post me the outputs of GetApiVersion?
I'm getting the following (printing all variables)
400.1 4.00 11th of February 2020 "Aphrodite's Child - Four Horsemen" 2_May_2020
aurelien is offline   Reply With Quote
Old 05-04-2020, 11:21 AM   #480
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,630
Default

Ok, this is weird. I'll check.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine 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:43 PM.


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