1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Max-MSPでファイルパスを取得し、ファイル名などを末尾に追加する方法。

Posted at

概要

sfrecordや、jit.recordなどで、オーディオシグナルや映像マトリックスをファイルに出力して保存したいなどの場合、事前に出力先のファイルパスを設定したいなどあると思います。

その際に、パス取得して、ファイル名を追加したシンボルメッセージが欲しい場合などがあると思います。

ここでは、MaxMSPやMax for Liveでファイルパスを取得して、ファイル名などを末尾に追加する方法を紹介します。

スクリーンショット 2021-04-29 22.28.47.png

{
	"boxes" : [ 		{
			"box" : 			{
				"maxclass" : "newobj",
				"text" : "sprintf symout %saudio.aiff",
				"patching_rect" : [ 1380.0, 677.0, 140.0, 20.0 ],
				"outlettype" : [ "" ],
				"id" : "obj-220",
				"numinlets" : 1,
				"numoutlets" : 1
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "newobj",
				"text" : "append aiff",
				"patching_rect" : [ 1380.0, 711.0, 62.0, 20.0 ],
				"outlettype" : [ "" ],
				"id" : "obj-215",
				"numinlets" : 1,
				"numoutlets" : 1
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "message",
				"text" : "open \"Macintosh HD:/Users/taito-otani/Downloadsrec.aiff\" aiff",
				"patching_rect" : [ 1273.5, 744.0, 353.0, 20.0 ],
				"outlettype" : [ "" ],
				"id" : "obj-214",
				"numinlets" : 2,
				"numoutlets" : 1
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "newobj",
				"text" : "t b b",
				"patching_rect" : [ 1379.0, 566.5, 30.0, 20.0 ],
				"outlettype" : [ "bang", "bang" ],
				"id" : "obj-209",
				"numinlets" : 1,
				"numoutlets" : 2
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "button",
				"patching_rect" : [ 1427.0, 445.0, 24.0, 24.0 ],
				"outlettype" : [ "bang" ],
				"parameter_enable" : 0,
				"id" : "obj-203",
				"numinlets" : 1,
				"numoutlets" : 1
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "newobj",
				"text" : "prepend set",
				"patching_rect" : [ 1424.0, 566.5, 81.0, 23.0 ],
				"outlettype" : [ "" ],
				"id" : "obj-18",
				"fontsize" : 13.0,
				"numinlets" : 1,
				"fontname" : "Arial",
				"numoutlets" : 1
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "newobj",
				"text" : "relativepath",
				"patching_rect" : [ 1427.0, 531.5, 80.0, 23.0 ],
				"outlettype" : [ "" ],
				"id" : "obj-204",
				"fontsize" : 13.0,
				"numinlets" : 1,
				"fontname" : "Arial",
				"numoutlets" : 1
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "newobj",
				"text" : "opendialog fold",
				"patching_rect" : [ 1427.0, 501.5, 101.0, 23.0 ],
				"outlettype" : [ "", "bang" ],
				"id" : "obj-205",
				"fontsize" : 13.0,
				"numinlets" : 1,
				"fontname" : "Arial",
				"numoutlets" : 2
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "newobj",
				"text" : "filepath search 4",
				"patching_rect" : [ 1379.0, 602.5, 220.0, 23.0 ],
				"outlettype" : [ "" ],
				"id" : "obj-208",
				"fontsize" : 13.0,
				"numinlets" : 1,
				"fontname" : "Arial",
				"numoutlets" : 1
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "message",
				"text" : "\"Macintosh HD:/Users/taito-otani/Downloads\"",
				"patching_rect" : [ 1301.0, 646.0, 332.0, 20.0 ],
				"outlettype" : [ "" ],
				"id" : "obj-193",
				"numinlets" : 2,
				"numoutlets" : 1
			}

		}
 ],
	"lines" : [ 		{
			"patchline" : 			{
				"source" : [ "obj-215", 0 ],
				"destination" : [ "obj-214", 1 ]
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-208", 0 ],
				"destination" : [ "obj-220", 0 ],
				"order" : 1
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-220", 0 ],
				"destination" : [ "obj-215", 0 ]
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-209", 0 ],
				"destination" : [ "obj-208", 0 ]
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-204", 0 ],
				"destination" : [ "obj-209", 0 ],
				"order" : 1
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-208", 0 ],
				"destination" : [ "obj-193", 1 ],
				"order" : 0
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-205", 0 ],
				"destination" : [ "obj-204", 0 ]
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-204", 0 ],
				"destination" : [ "obj-18", 0 ],
				"order" : 0
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-18", 0 ],
				"destination" : [ "obj-208", 0 ]
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-203", 0 ],
				"destination" : [ "obj-205", 0 ]
			}

		}
 ],
	"appversion" : 	{
		"major" : 8,
		"minor" : 1,
		"revision" : 10,
		"architecture" : "x64",
		"modernui" : 1
	}
,
	"classnamespace" : "box"
}

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?