{ "info": { "author": "UNKNOWN", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Operating System :: MacOS", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: C", "Programming Language :: Cython", "Programming Language :: Python", "Programming Language :: Python :: 2", "Topic :: Multimedia", "Topic :: Multimedia :: Sound/Audio", "Topic :: Multimedia :: Sound/Audio :: Analysis", "Topic :: Multimedia :: Sound/Audio :: Sound Synthesis", "Topic :: Multimedia :: Sound/Audio :: Speech", "Topic :: Scientific/Engineering", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Needs Cython >= 0.15\n\nIt allows to read and write any kind of SDIF file, to define new\nkinds of frames and matrices and to read and write metadata. \n\nThe matrices read from a sdif file are exposed as numpy arrays.\n\nIt exposes both a low level and a high level interface.\n\nThe low level interface for reading and writing sdif files mirrors the \nsdif library quite transparently so that the example files and \nutilities using it can be directly translated with it. In particular\nit does not create any intermediate objects, even the data of the matrices\nis a numpy array mapped to the c array read from disk, so no allocation takes\nplace. Whereas this makes for very fast code, one has to take care to copy the\ndata if it will be used longer, since by the time a new matrix is read this\ndata is no longer valid. \n\nto read for ex. 1TRC format:\n\nimport pysdif\n\nsdif_file = pysdif.SdifFile('filename.sdif')\nsig1TRC = pysdif.str2signature(\"1TRC\")\nwhile not sdif_file.eof:\n sdif_file.read_frame_header()\n if sdif_file.frame_numerical_signature) == sig1TRC:\n print sdif_file.time\n for n in range(sdif_file.matrices_in_frame):\n sdif_file.read_matrix_header()\n if sdif_file.matrix_numerical_signature == sig1TRC:\n data = sdif_file.get_matrix_data(copy=True) # default is True \n # data is now a numpy array\n # here is what happens under the hood: the SDIF library\n # reads a whole matrix and puts it in its internal buffer\n # This data is memcpy(ed) to create a numpy array\n # If you dont intend to keep this data and there are no\n # chances that a new matrix or frame will be read before \n # you use this data for some calculation, then it is safe\n # to call sdif_file.get_matrix_data(copy=False)\n # in this case no memory is copied, the numpy array does not\n # own its memory and uses the internal buffer of the SDIF runtime\n print data\n \na more natural way:\n\nfrom pysdif import SdifFile\nsdif_file = SdifFile('filename.sdif')\nfor frame in sdif_file:\n if frame.signature == \"1TRC\":\n print frame.time\n for matrix in frame:\n if matrix.signature == \"1TRC\":\n print matrix.get_data() # data will be copied, use .get_data(copy=False) to avoid this\n \nthe frames and the matrices resulting from the iteration\nare only guaranteed to be valid as long as no new frames and matrices are read\n\nto write a SdifFile:\n\nf = SdifFile('new_sdif.sdif', 'w')\n# these are optional\n# add some metadata\nf.add_NVT({\n 'name' : 'my name',\n 'date' : time.asctime(time.localtime())\n})\n# define new frame and matrix types\nf.add_frame_type('1NEW', '1ABC NewMatrix, 1FQ0 New1FQ0')\nf.add_matrix_type('1ABC', 'Column1, Column2')\n# now you can begin adding frames\nframe = f.new_frame('1NEW', time_now)\nframe.add_matrix('1ABC', array([\n [0, 1.2],\n [3.5, 8.13],\n ...\n ]))\nframe.write()\n\n# say we just want to take the data from an existing\n# sdiffile, modify it and write it back\nin_sdif = SdifFile(\"existing-file.sdif\")\nout_sdif = SdifFile(\"outfile.sdif\", \"w\")\nout_sdif.clone_definitions(in_sdif)\nfor in_frame in in_sdif:\n if in_frame.signature == \"1NEW\":\n new_frame = out_sdif.new_frame(\"1NEW\", in_frame.time)\n # we know there is only one matrix and we dont need to keep the data\n in_data = in_frame.get_matrix_data(copy=False) \n # multiply it\n in_data[:,1] *= 0.5\n # add it to the stream\n new_frame.add_matrix('1ABC', in_data)\n # only one matrix, so write the frame.\n new_frame.write()\n # along this operation, only the memory used to allocate the original \n # matrix was used, the rest of the operations is performed in place\n # This is only safe where only one thread has access to \n # the sdif entity at once and data is not kept longer than the time\n # read it, transform it and rewrite it. \n\nthere are also many utility functions under pysdif.sdiftools\n\nsee release notes and changes at http://github.com/gesellkammer/pysdif", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/gesellkammer/pysdif", "keywords": "scientific computing,music,sound analysis,SDIF,IRCAM", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "pysdif", "package_url": "https://pypi.org/project/pysdif/", "platform": "Linux,Mac OS X", "project_url": "https://pypi.org/project/pysdif/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/gesellkammer/pysdif" }, "release_url": "https://pypi.org/project/pysdif/0.1.4/", "requires_dist": null, "requires_python": null, "summary": "SDIF for python", "version": "0.1.4" }, "last_serial": 797717, "releases": { "0.0.2": [], "0.0.3": [ { "comment_text": "", "digests": { "md5": "3e74d6ce3a1d90c73dba2fb834ad5eb6", "sha256": "878d3f89c402655ed8c440d4f3ed8d9bfce8e3674638a70075e578e8b4f71de6" }, "downloads": -1, "filename": "pysdif-0.0.3.tar.gz", "has_sig": false, "md5_digest": "3e74d6ce3a1d90c73dba2fb834ad5eb6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 161290, "upload_time": "2009-12-12T00:53:26", "url": "https://files.pythonhosted.org/packages/31/30/ed7160e84e8dbb910b0e16d3dd8412c5099075075dfedbe1629d7947a95a/pysdif-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "9036e87a610b27cf8ff8ab28e136d13c", "sha256": "d05d1f7654e621f0b143684dc573943f914826828f9d21522b2de5a53ba14b3c" }, "downloads": -1, "filename": "pysdif-0.0.4.tar.gz", "has_sig": false, "md5_digest": "9036e87a610b27cf8ff8ab28e136d13c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 161514, "upload_time": "2009-12-20T00:48:05", "url": "https://files.pythonhosted.org/packages/54/dd/d648942b3bc1453c5de90847cb91739ac2b99f190247570427129a20f6bb/pysdif-0.0.4.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "d9129a6bd3158365f5132a075a9e1274", "sha256": "9cee3d85ed19976a0a5f7fffcca4d7eeb2b42d8f741f77765132046d1ea54ee5" }, "downloads": -1, "filename": "pysdif-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d9129a6bd3158365f5132a075a9e1274", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 161927, "upload_time": "2010-08-17T19:56:33", "url": "https://files.pythonhosted.org/packages/a2/bf/efe1a92edd27baf0f7852a536866c08d264bc4475a149579d73bb64502b8/pysdif-0.1.0.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "f3a61eb7d762901ce6d90bcc42c33fdb", "sha256": "a19291b0874b25d46b12160e02d3f72135d11d74117bc1074648ceb9950adc6e" }, "downloads": -1, "filename": "pysdif-0.1.3.tar.gz", "has_sig": false, "md5_digest": "f3a61eb7d762901ce6d90bcc42c33fdb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 170040, "upload_time": "2011-08-08T17:29:54", "url": "https://files.pythonhosted.org/packages/5b/b9/1ec5c7b2a049de4bf449676ead5c2a46b4fbd605ac2f5ac2a978dbfd592d/pysdif-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "9c8c38f2ef19177f9e41747961bda44c", "sha256": "e34cb1f50970c3cb27b80b242ee45460ddecec8f1e9b82eb263c1e4f447d31da" }, "downloads": -1, "filename": "pysdif-0.1.4.tar.gz", "has_sig": false, "md5_digest": "9c8c38f2ef19177f9e41747961bda44c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 171069, "upload_time": "2012-01-13T19:12:06", "url": "https://files.pythonhosted.org/packages/b9/c5/ad49898ead620e76ece85d9f52a0a95ef15ef9273226d1254f1c1cfca014/pysdif-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9c8c38f2ef19177f9e41747961bda44c", "sha256": "e34cb1f50970c3cb27b80b242ee45460ddecec8f1e9b82eb263c1e4f447d31da" }, "downloads": -1, "filename": "pysdif-0.1.4.tar.gz", "has_sig": false, "md5_digest": "9c8c38f2ef19177f9e41747961bda44c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 171069, "upload_time": "2012-01-13T19:12:06", "url": "https://files.pythonhosted.org/packages/b9/c5/ad49898ead620e76ece85d9f52a0a95ef15ef9273226d1254f1c1cfca014/pysdif-0.1.4.tar.gz" } ] }