Go Back   Cockos Incorporated Forums > REAPER Forums > Dstruct's Casa De Nitpicks

Reply
 
Thread Tools Display Modes
Old 09-11-2020, 05:23 AM   #1
Yanick
Human being with feelings
 
Yanick's Avatar
 
Join Date: May 2018
Location: Moscow, Russia
Posts: 260
Default The function reaper.CreateNewMIDIItemInProj does not create .MID files

If I activate the "Create new MIDI items as .MID files" setting, then the function CreateNewMIDIItemInProj does not create .MID files in project directory.
__________________
My scripts for rendering
Yanick is offline   Reply With Quote
Old Yesterday, 04:17 PM   #2
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 1,168
Default

I can confirm that, no MIDI-file is created, unlike the action "Insert new MIDI item...".

In addition to that, when I duplicate the MIDI-items, no additional MIDI-files are created. I would expect that being the case.
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old Yesterday, 04:49 PM   #3
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 9,916
Default

Seems reasonable to me as the function's purpose is to create new in project MIDI items (edit: that's what I gather from its name at least, otherwise the function could just have been named "CreateNewMIDIItem") which is disabled via Preferences, so the function does nothing.

edit2:
I think the confusion may come from OP is taking InProj for 'in project directory' but I think it actually refers to 'in project MIDI' (as opposed to .MID files).

edit3:
I can only guess though as the API doc doesn't clarify this.

Last edited by nofish; Yesterday at 05:17 PM.
nofish is offline   Reply With Quote
Old Today, 12:02 AM   #4
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 1,168
Default

Not necessarily. The OP set the option, that new Midi items shall be created as modi-files in the prefs.
It's only natural to assume, that this function obeys this setting and creates a new midi item as .mid-file.
It works with the action I mentioned but not in other cases.

I think an optional parameter would help:
integer Create_Mid - 0 or nil, don't create it as midifile, 1, create as midifile, 2, obey preference's setting
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old Today, 06:36 AM   #5
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 9,916
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
It works with the action I mentioned but not in other cases.
But the action doesn't contain the InProj suffix (or a similar wording), unlike the API function, that's the difference imo.
I.e. the action doesn't specify if a new MIDI item should be created as in project MIDI or .MID file, but the API function does (to my understanding), hence it's no-op if the Preference is set to only create MIDI items as .MID files.
nofish is offline   Reply With Quote
Old Today, 11:05 AM   #6
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 1,168
Default

The action obeys the preferences setting which is totally fine.

I think the problem is that, despite the prefs-setting set, certain parts of Reaper do their own stuff. In regards of the function in the OP, there's no chance to insert with it a midi item, that obeys the prefs setting. So you can't insert midi items who are stored as mid-files, despite the setting and you have no alternative to do it via Api, unless you make a hack.

Speaking of which, I have an idea that could help Yanick, thanks to your responses.
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old Today, 11:54 AM   #7
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 9,916
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
In regards of the function in the OP, there's no chance to insert with it a midi item, that obeys the prefs setting. So you can't insert midi items who are stored as mid-files, despite the setting and you have no alternative to do it via Api, unless you make a hack.
I didn't deny that, in fact I fully agree.
But I still think the function behaves correctly in its current form (even if quite limited in functionality, as noted by you), so this would be better suited for feature requests than nitpicks imo.
nofish is offline   Reply With Quote
Old Today, 01:49 PM   #8
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 1,168
Default

I agree that this thread should be moved to FR.
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
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:35 PM.


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