pax_global_header00006660000000000000000000000064151354151310014511gustar00rootroot0000000000000052 comment=125c0f576dfc8544ce64801e0462c1ff5349a1b7 gnu-octave-octave-audio-125c0f5/000077500000000000000000000000001513541513100164665ustar00rootroot00000000000000gnu-octave-octave-audio-125c0f5/.gitignore000066400000000000000000000013311513541513100204540ustar00rootroot00000000000000# http://www.gnu.org/software/automake Makefile.in /ar-lib /mdate-sh /py-compile /test-driver /ylwrap # http://www.gnu.org/software/autoconf autom4te.cache /autoscan.log /autoscan-*.log /aclocal.m4 /compile /config.guess /config.h.in /config.log /config.status /config.sub /configure /configure.scan /depcomp /install-sh /missing /stamp-h1 # https://www.gnu.org/software/libtool/ /ltmain.sh # http://www.gnu.org/software/texinfo /texinfo.tex # http://www.gnu.org/software/m4/ m4/libtool.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 m4/lt~obsolete.m4 # Generated Makefile # (meta build system like autotools, # can automatically generate from config.status script # (which is called by configure script)) Makefile gnu-octave-octave-audio-125c0f5/.hgignore000066400000000000000000000011241513541513100202670ustar00rootroot00000000000000syntax: regexp # The recurrent (^|/) idiom in the regexps below should be understood # to mean "at any directory" while the ^ idiom means "from the # project's top-level directory". (^|/).*\.dvi$ (^|/).*\.pdf$ (^|/).*\.o$ (^|/).*\.oct$ (^|/).*\.octlink$ (^|/)octave-core$ (^|/).*\.tar\.gz$ (^|/)aclocal\.m4$ (^|/)configure$ (^|/)autom4te\.cache($|/) # e.g. doc/faq/OctaveFAQ.info # doc/interpreter/octave.info-4 ^doc/.*\.info(-\d)?$ ^doc/\w*/stamp-vti$ ^doc/\w*/version\.texi$ # Emacs tools create these (^|/)TAGS$ (^|/)semantic.cache$ # Other text editors often create these (^|/)~.* gnu-octave-octave-audio-125c0f5/COPYING000066400000000000000000001045131513541513100175250ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . gnu-octave-octave-audio-125c0f5/DESCRIPTION000066400000000000000000000007451513541513100202020ustar00rootroot00000000000000Name: audio Version: 2.0.10 Date: 2026-01-25 Author: John Donoghue Maintainer: John Donoghue Title: Audio Toolbox Description: Audio and MIDI Toolbox for GNU Octave Categories: Midi, Audio Depends: octave (>= 4.0.0) SystemRequirements: rtmidi Autoload: no License: GPLv3+ Url: https://gnu-octave.github.io/octave-audio/ Repository: https://github.com/gnu-octave/octave-audio/ Tracker: https://github.com/gnu-octave/octave-audio/issues gnu-octave-octave-audio-125c0f5/INDEX000066400000000000000000000007321513541513100172620ustar00rootroot00000000000000audio >> Audio and MIDI Toolbox MIDI Device Interface mididevice mididevinfo midiflush midimsg midireceive midisend @octave_midi/hasdata MIDI Controller Interface midiid midicontrols midisync midiread midicallback MIDI File I/O midifileinfo midifileread midifilewrite ismidifile Enumerations midimsgtype Waveform Generation audioOscillator Domain Conversion bark2hz erb2hz mel2hz hz2bark hz2erb hz2mel phon2sone sone2phon gnu-octave-octave-audio-125c0f5/Makefile000066400000000000000000000304141513541513100201300ustar00rootroot00000000000000## Copyright 2015-2016 CarnĂ« Draug ## Copyright 2015-2016 Oliver Heimlich ## Copyright 2017 Julien Bect ## Copyright 2017 Olaf Till ## Copyright 2019-2026 John Donoghue ## ## Copying and distribution of this file, with or without modification, ## are permitted in any medium without royalty provided the copyright ## notice and this notice are preserved. This file is offered as-is, ## without any warranty. TOPDIR := $(shell pwd) ## Some basic tools (can be overriden using environment variables) SED ?= sed TAR ?= tar GREP ?= grep CUT ?= cut TR ?= tr TEXI2PDF ?= texi2pdf -q MAKEINFO ?= makeinfo MAKEINFO_HTML_OPTIONS := --no-headers --no-split MAKEINFO_HTML_FILTER := $(SED) 's|: ||g' | $(SED) 's|]*class=.copiable[^>]*> ¶||g' | $(SED) 's|\([^<]*\)|\1|g' # work out a possible help generator ifeq ($(strip $(QHELPGENERATOR)),) ifneq ($(shell qhelpgenerator-qt5 -v 2>/dev/null),) QHELPGENERATOR = qhelpgenerator-qt5 else ifneq ($(shell qcollectiongenerator-qt5 -v 2>/dev/null),) QHELPGENERATOR = qcollectiongenerator-qt5 #else ifneq ($(shell qhelpgenerator -qt5 -v 2>/dev/null),) # v4 doesnt work # QHELPGENERATOR = qhelpgenerator -qt5 else ifneq ($(shell qcollectiongenerator -qt5 -v 2>/dev/null),) QHELPGENERATOR = qcollectiongenerator -qt5 else QHELPGENERATOR = true endif endif ## Note the use of ':=' (immediate set) and not just '=' (lazy set). ## http://stackoverflow.com/a/448939/1609556 package := $(shell $(GREP) "^Name: " DESCRIPTION | $(CUT) -f2 -d" " | \ $(TR) '[:upper:]' '[:lower:]') version := $(shell $(GREP) "^Version: " DESCRIPTION | $(CUT) -f2 -d" ") pkg_date := $(shell $(GREP) "^Date: " DESCRIPTION | $(CUT) -f2 -d" ") pkg_year := $(shell $(GREP) "^Date: " DESCRIPTION | $(CUT) -f2 -d" " | $(CUT) -f1 -d"-") ## These are the paths that will be created for the releases. target_dir := target release_dir := $(target_dir)/$(package)-$(version) release_tarball := $(target_dir)/$(package)-$(version).tar.gz html_dir := $(target_dir)/$(package)-html html_tarball := $(target_dir)/$(package)-html.tar.gz ## Using $(realpath ...) avoids problems with symlinks due to bug ## #50994 in Octaves scripts/pkg/private/install.m. But at least the ## release directory above is needed in the relative form, for 'git ## archive --format=tar --prefix=$(release_dir). real_target_dir := $(realpath .)/$(target_dir) installation_dir := $(real_target_dir)/.installation package_list := $(installation_dir)/.octave_packages install_stamp := $(installation_dir)/.install_stamp ## These can be set by environment variables which allow to easily ## test with different Octave versions. ifndef OCTAVE OCTAVE := octave endif OCTAVE := $(OCTAVE) --no-gui --silent --norc MKOCTFILE ?= mkoctfile ## Command used to set permissions before creating tarballs FIX_PERMISSIONS ?= chmod -R a+rX,u+w,go-w,ug-s ## Detect which VCS is used vcs := $(if $(wildcard .hg),hg,$(if $(wildcard .git),git,unknown)) ifeq ($(vcs),hg) release_dir_dep := .hg/dirstate HG := hg HG_CMD = $(HG) --config alias.$(1)=$(1) --config defaults.$(1)= $(1) HG_ID := $(shell $(call HG_CMD,identify) --id | sed -e 's/+//' ) REPO_TIMESTAMP := $(firstword $(shell $(call HG_CMD,log) --rev $(HG_ID) --template '{date|hgdate}')) endif ifeq ($(vcs),git) release_dir_dep := .git/index GIT := git REPO_TIMESTAMP := $(firstword $(shell $(GIT) log -n1 --date=unix --format="%ad")) endif TAR_REPRODUCIBLE_OPTIONS := --sort=name --mtime="@$(REPO_TIMESTAMP)" --owner=0 --group=0 --numeric-owner TAR_OPTIONS := --format=ustar $(TAR_REPRODUCIBLE_OPTIONS) ## .PHONY indicates targets that are not filenames ## (https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html) .PHONY: help ## make will display the command before runnning them. Use @command ## to not display it (makes specially sense for echo). help: @echo "Targets:" @echo " dist - Create $(release_tarball) for release." @echo " html - Create $(html_tarball) for release." @echo " release - Create both of the above and show md5sums." @echo " install - Install the package in $(installation_dir), where it is not visible in a normal Octave session." @echo " check - Execute package tests." @echo " doctest - Test the help texts with the doctest package." @echo " run - Run Octave with the package installed in $(installation_dir) in the path." @echo " clean - Remove everything made with this Makefile." ## ## Recipes for release tarballs (package + html) ## .PHONY: release dist html clean-tarballs clean-unpacked-release ## To make a release, build the distribution and html tarballs. release: dist html md5sum $(release_tarball) $(html_tarball) @echo "Upload @ https://sourceforge.net/p/octave/package-releases/new/" @echo " and note the changeset the release corresponds to" ## dist and html targets are only PHONY/alias targets to the release ## and html tarballs. dist: $(release_tarball) html: $(html_tarball) ## An implicit rule with a recipe to build the tarballs correctly. %.tar.gz: % $(TAR) -cf - $(TAR_OPTIONS) -C "$(target_dir)/" "$(notdir $<)" | gzip -9n > "$@" clean-tarballs: @echo "## Cleaning release tarballs (package + html)..." -$(RM) $(release_tarball) $(html_tarball) @echo ## Create the unpacked package. ## ## Notes: ## * having ".hg/dirstate" (or ".git/index") as a prerequesite means it is ## only rebuilt if we are at a different commit. ## * the variable RM usually defaults to "rm -f" ## * having this recipe separate from the one that makes the tarball ## makes it easy to have packages in alternative formats (such as zip) ## * note that if a commands needs to be run in a specific directory, ## the command to "cd" needs to be on the same line. Each line restores ## the original working directory. $(release_dir): $(release_dir_dep) -$(RM) -r "$@" ifeq (${vcs},hg) hg archive --exclude ".hg*" --type files "$@" endif ifeq (${vcs},git) git archive --format=tar --prefix="$@/" HEAD | $(TAR) -x $(RM) "$@/.gitignore" endif ## Don't fall back to run the supposed necessary contents of ## 'bootstrap' here. Users are better off if they provide ## 'bootstrap'. Administrators, checking build reproducibility, can ## put in the missing 'bootstrap' file if they feel they know its ## necessary contents. ifneq (,$(wildcard src/bootstrap)) cd "$@/src" && ./bootstrap && $(RM) -r "autom4te.cache" endif ## Uncomment this if your src/Makefile.in has these targets for ## pre-building something for the release (e.g. documentation). # cd "$@/src" && ./configure && $(MAKE) prebuild && \ # $(MAKE) clean && $(RM) Makefile ## $(MAKE) -C "$@" docs # cd "$@" && $(MAKE) tests # remove dev stuff cd "$@" && $(RM) -rf "devel" # && $(RM) -f doc/mkfuncdocs.py doc/mkqhcp.py ${FIX_PERMISSIONS} "$@" .PHONY: docs docs: doc/$(package).pdf doc/$(package).info doc/$(package).qhc doc/$(package).html .PHONY: clean-docs clean-docs: $(RM) -f doc/$(package).html $(RM) -f doc/$(package).qhc $(RM) -f doc/$(package).qch $(RM) -f doc/$(package).info $(RM) -f doc/$(package).pdf $(RM) -f doc/version.texi $(RM) -f doc/functions.texi doc/version.texi: $(release_dir_dep) @echo Generating $@ @echo "@c autogenerated from Makefile" > $@ @echo "@set VERSION $(version)" >> $@ @echo "@set PACKAGE $(package)" >> $@ @echo "@set DATE $(pkg_date)" >> $@ @echo "@set YEAR $(pkg_year)" >> $@ doc/$(package).pdf: doc/$(package).texi doc/functions.texi doc/version.texi cd doc && SOURCE_DATE_EPOCH=$(REPO_TIMESTAMP) $(TEXI2PDF) $(package).texi # remove temp files cd doc && $(RM) -f $(package).aux $(package).cp $(package).cps $(package).fn $(package).fns $(package).log $(package).toc doc/$(package).html: doc/$(package).texi doc/functions.texi doc/version.texi cd doc && SOURCE_DATE_EPOCH=$(REPO_TIMESTAMP) $(MAKEINFO) --html --css-ref=octave.css $(MAKEINFO_HTML_OPTIONS) $(package).texi -o - | $(MAKEINFO_HTML_FILTER) > $(package).html doc/$(package).qhc: doc/$(package).html ifeq ($(QHELPGENERATOR),true) $(warning No QHELPGENERATOR ... skipping QT doc build) else # try also create qch file if can cd doc && ./mkqhcp.py $(package) && $(QHELPGENERATOR) $(package).qhcp -o $(package).qhc cd doc && $(RM) -f $(package).qhcp $(package).qhp endif doc/$(package).info: doc/$(package).texi doc/functions.texi doc/version.texi cd doc && $(MAKEINFO) $(package).texi doc/functions.texi: $(release_dir_dep) cd doc && ./mkfuncdocs.py --src-dir=../inst/ ../INDEX | $(SED) 's/@seealso/@xseealso/g' > functions.texi run_in_place = $(OCTAVE) --eval ' pkg ("local_list", "$(package_list)"); ' \ --eval ' pkg ("load", "$(package)"); ' #html_options = --eval 'options = get_html_options ("octave-forge");' ## Uncomment this for package documentation. html_options = --eval 'options = get_html_options ("octave-forge");' \ --eval 'options.package_doc = "$(package).texi";' \ --eval 'options.package_doc_options = [options.package_doc_options " --css-include=$(package).css"];' $(html_dir): $(install_stamp) $(RM) -r "$@"; $(run_in_place) \ --eval ' pkg load generate_html; ' \ $(html_options) \ --eval ' generate_package_html ("$(package)", "$@", options); '; $(FIX_PERMISSIONS) "$@"; clean-unpacked-release: @echo "## Cleaning unpacked release tarballs (package + html)..." -$(RM) -r $(release_dir) $(html_dir) @echo ## ## Recipes for installing the package. ## .PHONY: install clean-install octave_install_commands = \ ' llist_path = pkg ("local_list"); \ mkdir ("$(installation_dir)"); \ load (llist_path); \ local_packages(cellfun (@ (x) strcmp ("$(package)", x.name), local_packages)) = []; \ save ("$(package_list)", "local_packages"); \ pkg ("local_list", "$(package_list)"); \ pkg ("prefix", "$(installation_dir)", "$(installation_dir)"); \ pkg ("install", "-local", "-verbose", "$(release_tarball)"); ' ## Install unconditionally. Maybe useful for testing installation with ## different versions of Octave. install: $(release_tarball) @echo "Installing package under $(installation_dir) ..." $(OCTAVE) --eval $(octave_install_commands) touch $(install_stamp) ## Install only if installation (under target/...) is not current. $(install_stamp): $(release_tarball) @echo "Installing package under $(installation_dir) ..." $(OCTAVE) --eval $(octave_install_commands) touch $(install_stamp) clean-install: @echo "## Cleaning installation under $(installation_dir) ..." -$(RM) -r $(installation_dir) @echo ## ## Recipes for testing purposes ## .PHONY: run doctest check ## Start an Octave session with the package directories on the path for ## interactice test of development sources. run: $(install_stamp) $(run_in_place) --persist ## Test example blocks in the documentation. Needs doctest package ## https://octave.sourceforge.io/doctest/index.html doctest: $(install_stamp) $(run_in_place) --eval 'pkg load doctest;' \ --eval "targets = pkg('list', '$(package)'){1}.dir;" \ --eval "doctest (targets);" ## Test package. octave_test_commands = \ ' pkgs = pkg("list", "$(package)"); \ dirs = {pkgs{1}.dir}; \ __run_test_suite__ (dirs, {}); ' ## the following works, too, but provides no overall summary output as ## __run_test_suite__ does: ## ## else cellfun (@runtests, horzcat (cellfun (@ (dir) ostrsplit (([~, dirs] = system (sprintf ("find %s -type d", dir))), "\n\r", true), dirs, "UniformOutput", false){:})); endif ' check: $(install_stamp) $(run_in_place) --eval $(octave_test_commands) ## ## CLEAN ## .PHONY: clean clean: clean-tarballs clean-unpacked-release clean-install clean-docs test -e inst/test && rmdir inst/test || true test -e fntests.log && rm -f fntests.log || true @echo "## Removing target directory (if empty)..." test -e $(target_dir) && rmdir $(target_dir) || true @echo @echo "## Cleaning done" @echo .PHONY: tests CC_TST_SOURCES := $(shell $(GREP) --files-with-matches '^%!' src/*.cc) TST_SOURCES := $(patsubst src/%.cc,inst/test/%.cc-tst,$(CC_TST_SOURCES)) inst/test: @mkdir -p "$@" $(TST_SOURCES): inst/test/%.cc-tst: src/%.cc | inst/test @echo "Extracting tests from $< ..." @$(RM) -f "$@" "$@-t" @( echo "## Generated from $<"; \ $(GREP) '^%!' "$<") > "$@" tests: $(TST_SOURCES) gnu-octave-octave-audio-125c0f5/NEWS000066400000000000000000000074351513541513100171760ustar00rootroot00000000000000Summary of important user-visible changes for releases of the audio package =============================================================================== audio-2.0.10 Release Date: 2026-01-25 =============================================================================== ** midimsg, add properties, size and default creation methods ** minor updates to documentation =============================================================================== audio-2.0.9 Release Date: 2024-09-23 =============================================================================== ** minor bug fixes ** minor updates to documentation ** NEW FUNCTIONS: - phone2sone - sone2phone =============================================================================== audio-2.0.8 Release Date: 2023-10-02 =============================================================================== ** bugfix midisend with multiple messages ** audioOscillator: update to allow functioning in < octave 6 ** minor updated for Octave 9+ compatibility =============================================================================== audio-2.0.7 Release Date: 2023-07-26 =============================================================================== ** bugfix crash on create mididevice without a midisystem ** minor updates to documentation =============================================================================== audio-2.0.6 Release Date: 2023-07-20 =============================================================================== ** minor updates for octave dld classes ** NEW FUNCTIONS: - erb2hz and hz2erb - bark2hz and hz2bark - mel2hz and hz2mel - audioOscillator ** minor updates to documentation =============================================================================== audio-2.0.5 Release Date: 2022-07-20 =============================================================================== ** minor updates for octave dld classes ** NEW FUNCTIONS: - @octave_midi/hasdata - midicallback - midiflush ** midirecv always returns abs timestamp from midimsg results ** added qt5 documentation =============================================================================== audio-2.0.4 Release Date: 2021-12-05 =============================================================================== ** minor updates for octave 7 compatibility =============================================================================== audio-2.0.3 Release Date: 2021-10-22 =============================================================================== ** midifilewrite: updates for time processing ** midifileread: updates reading sysex messages ** midimsg: allow horzcat to add multiple messages ** midisend: dont send metadata to mididevice =============================================================================== audio-2.0.2 Release Date: 2020-10-13 =============================================================================== ** added 'other' field to midifileinfo structure ** added metaevent type to midimsg ** additional FXX type message file reading ** added format specifier to midifileread ** bugfix ref count on midi_object unique_clone ** minor documentation updates =============================================================================== audio-2.0.1 Release Date: 2020-05-08 =============================================================================== ** added additional midimsg property set/get ** added midimsgtype enumeration class ** minor documentation updates =============================================================================== audio-2.0.0 Release Date: 2020-01-03 =============================================================================== ** Added midi functions ** remove obsolete / old audio functions gnu-octave-octave-audio-125c0f5/README.md000066400000000000000000000024771513541513100177570ustar00rootroot00000000000000Introduction ============ The Octave Audio package provides MIDI device functions and some basic sound measurement routines for GNU Octave Requirements ============ * Octave >= 4.0.0 * [RTMIDI](https://github.com/thestk/rtmidi) library and include files Installing ========== To install, run the octave package manager: 1. If running Windows, the package may already be installed: pkg list audio 2. To install from source forge: pkg install -forge audio 3. To install from a local tarball. pkg install audio-XXXXXXX.tar.gz Where XXXXXXX is the version of the the downloaded tarball. Usage: ====== 1. Load the package. pkg load audio (Required each time Octave is started) 2. Type help audio at the octave prompt to display a list of functions Documentation ============== See the function list for octave-audio on [octave github](https://gnu-octave.github.io/octave-audio/functions/) for function documentation. See the online manual for octave-audio on [octave github](https://gnu-octave.github.io/octave-audio/manual/) for complete documentation. Read the Octave [Octave audio package wiki](https://wiki.octave.org/Audio_package) for install tips and examples. Known limitations and bugs ========================== Report bugs on the [issue tracker](https://github.com/gnu-octave/octave-audio/issues) gnu-octave-octave-audio-125c0f5/devel/000077500000000000000000000000001513541513100175655ustar00rootroot00000000000000gnu-octave-octave-audio-125c0f5/devel/ctrl_monitor.m000066400000000000000000000005731513541513100224630ustar00rootroot00000000000000function control_monitor() [ctrlid, dev] = midiid() mididev = midicontrols(ctrlid, 'mididevice', dev) unwind_protect midicallback(mididev, @displayValue); printf("press a key to stop"); pause unwind_protect_cleanup midicallback(mididev, []); clear mididev end_unwind_protect endfunction function displayValue(ctrl) midiread(ctrl) endfunction gnu-octave-octave-audio-125c0f5/devel/play_midi.m000066400000000000000000000005151513541513100217130ustar00rootroot00000000000000function play_midi(filename) if nargin < 1 error ("no filename provided"); endif devid = getpref("midi", "DefaultDevice", 0); mididev = mididevice(devid) unwind_protect midimsgs = midifileread(filename); midisend(mididev, midimsgs); unwind_protect_cleanup clear devid end_unwind_protect endfunction gnu-octave-octave-audio-125c0f5/devel/record_midi.m000066400000000000000000000010641513541513100222240ustar00rootroot00000000000000function record_midi(filename) if nargin < 1 error ("no filename provided"); endif devid = getpref("midi", "DefaultDevice", 0); mididev = mididevice(devid) midimsgs = midimsg(0); unwind_protect while true pause(1); msgs = midireceive(mididev) if !isempty(msgs) midimsgs = [midimsgs msgs]; endif endwhile unwind_protect_cleanup clear devid if !isempty(midimsgs) printf("writing file %s...\n", filename); midifilewrite(filename, midimsgs); endif end_unwind_protect endfunction gnu-octave-octave-audio-125c0f5/doc/000077500000000000000000000000001513541513100172335ustar00rootroot00000000000000gnu-octave-octave-audio-125c0f5/doc/audio.css000066400000000000000000000013371513541513100210520ustar00rootroot00000000000000pre.example, .header, .float-caption, hr { /* base00 ~ body text in light solarized theme */ color: #657b83; border-color: #657b83; } pre.example { /* base3 ~ background color in light solarized theme */ background-color: #fdf6e3; padding: 0.5em; } table.cartouche { border: 1px solid #948473; background-color: #FFE3C6; width: 100%; } table.cartouche td, table.cartouche th { border: 1px solid #948473; padding: 4px 4px; } /* newer texinfo generation styles */ div.example { /* base00 ~ body text in light solarized theme */ color: #657b83; border-color: #657b83; } pre.example-preformatted { /* base3 ~ background color in light solarized theme */ background-color: #fdf6e3; padding: 0.5em; } gnu-octave-octave-audio-125c0f5/doc/audio.texi000066400000000000000000000167171513541513100212430ustar00rootroot00000000000000\input texinfo @c -*-texinfo-*- @c Copyright (c) 2019-2026, John Donoghue @c Octave Audio - Audio Toolkit for GNU octave. @c For manually generating the documentation use @c LANGUAGE=en makeinfo --html --no-split audio.texi @c %*** Start of HEADER @setfilename audio.info @settitle Octave Audio - Audio Toolkit for GNU octave @afourpaper @paragraphindent 0 @finalout @c @afourwide @c %*** End of the HEADER @include version.texi @include macros.texi @c %*** Start of TITLEPAGE @titlepage @title Audio Toolkit @value{VERSION} @subtitle Audio and MIDI functionality for @acronym{GNU} Octave. @author John Donoghue @page @vskip 0pt plus 1filll Copyright @copyright{} 2019-@value{YEAR} John Donoghue Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the same conditions as for modified versions. @page @heading Distribution The @acronym{GNU} Octave Audio package is @dfn{free} software. Free software is a matter of the users' freedom to run, copy, distribute, study, change and improve the software. This means that everyone is free to use it and free to redistribute it on certain conditions. The @acronym{GNU} Octave Audio package is not, however, in the public domain. It is copyrighted and there are restrictions on its distribution, but the restrictions are designed to ensure that others will have the same freedom to use and redistribute Octave that you have. The precise conditions can be found in the @acronym{GNU} General Public License that comes with the @acronym{GNU} Octave Audio package and that also appears in @ref{Copying}. To download a copy of the @acronym{GNU} Octave Audio package, please visit @url{https://gnu-octave.github.io/octave-audio/index}. @end titlepage @c %*** End of TITLEPAGE @dircategory Math @direntry * Octave Audio: (audio). Audio Toolkit for Octave @end direntry @c %*** Start of BODY @contents @ifnottex @node Top @top Introduction The Audio toolkit is a set of functions for manipulating MIDI devices and files for GNU Octave @end ifnottex @menu * Installing and loading:: Installing and loading the Audio toolkit * Basic Usage Overview:: Basic Usage Overview * Function Reference:: Audio toolkit functions * Copying:: Copying * Index:: Index @end menu @c ------------------------------------------------------------------------- @node Installing and loading @chapter Installing and loading @cindex Installing and loading The Audio toolkit must be installed and then loaded to be used. It can be installed in @acronym{GNU} Octave directly from octave-forge, or can be installed in an off-line mode via a downloaded tarball. The toolkit has a dependency on the RTMIDI library (@url{https://github.com/thestk/rtmidi}), so it must be installed in order to successfully install the toolkit. For Fedora: @code{yum install rtmidi-devel} For Ubuntu: @code{apt install librtmidi-dev} The toolkit must be then be loaded once per each @acronym{GNU} Octave session in order to use its functionality. @section Windows install @cindex Windows install If running in Windows, the package may already be installed, to check run: @example pkg list audio @end example Otherwise it can be installed by installing the requirements and then using the online or offline install method. @section Online Direct install @cindex Online install With an internet connection available, the Audio package can be installed from octave-forge using the following command within @acronym{GNU} Octave: @example pkg install -forge audio @end example The latest released version of the toolkit will be downloaded and installed. @section Off-line install @cindex Off-line install With the Audio toolkit package already downloaded, and in the current directory when running @acronym{GNU} Octave, the package can be installed using the following command within @acronym{GNU} Octave: @example pkg install audio-@value{VERSION}.tar.gz @end example @section Loading @cindex Loading Regardless of the method of installing the Audio toolkit, in order to use its functions, the toolkit must be loaded using the pkg load command: @example pkg load audio @end example The toolkit must be loaded on each @acronym{GNU} Octave session. @c ------------------------------------------------------------------------- @node Basic Usage Overview @chapter Basic Usage Overview @cindex Basic Usage Overview The Audio package must be loaded each time a @acronym{GNU} Octave session is started: @example pkg load audio @end example An overview of the package can be displayed by running @code{help audio} Help for each function can be displayed by @code{help thefunctionname} ie: @example help mididevice @end example @section Conversion Functionality @cindex Conversion Functionality The following functions are available to convert between audio domains: @table @asis @item hz2erb, erb2hz Conversion between hz and equivalent rectangular bandwidths (ERP) frequency scales @item hz2mel, mel2hz Conversion between hz and equivalent mel frequency scales @item hz2bark, bark2hz Conversion between hz and equivalent bark frequency scales @item phon2sone, sone2phone Conversion between sone and phon loudness scales @end table @section Waveform Generation @cindex Waveform Generation The @code{audioOscillator} function provides a method of creating a waveform generator for sine, square and sawtooth waveforms. @example % create a sawtooth audio generator osc = audioOscillator("sawtooth"); % get a frame of data data = osc(); % plot the data plot(data); @end example @section MIDI Functionality @cindex MIDI Functionality The Audio toolkit provides 3 main types of MIDI functionality: @table @asis @item Device functions These are functions that directly allow opening, sending and receiving MIDI messages. @item Controller functions Functions that provide a layer on top of the device functions for using MIDI controls. @item File functions Basic functions that allow read and write of MIDI files. @end table To read and write to a MIDI device, a MIDI device object must be created, using the name or id of a known MIDI device as provided by the mididevinfo function. MIDI devices can then be read using the midisend and midireceive functions that use midimsg type to encapsulate the MIDI data. @example % list the midi devices devs = mididevinfo % open a midi device, specifying the first input and output MIDI device dev = mididevice("input", devs.input@{1@}.ID, "output", devs.output@{1@}.ID) % receive data and echo it through the output port while true msg = midireceive(dev, 1); if !isempty(msg) midisend(msg); endif endwhile @end example @c ------------------------------------------------------------------------- @node Function Reference @chapter Function Reference @cindex Function Reference The functions currently available in the Audio toolkit are described below: @include functions.texi @c ------------------------------------------------------------------------- @include gpl.texi @c ------------------------------------------------------------------------- @node Index @unnumbered Index @printindex cp @bye gnu-octave-octave-audio-125c0f5/doc/gpl.texi000066400000000000000000001043301513541513100207110ustar00rootroot00000000000000@node Copying @appendix GNU General Public License @cindex warranty @cindex copyright @center Version 3, 29 June 2007 @display Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/} Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @end display @heading Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program---to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. @heading TERMS AND CONDITIONS @enumerate 0 @item Definitions. ``This License'' refers to version 3 of the GNU General Public License. ``Copyright'' also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. ``The Program'' refers to any copyrightable work licensed under this License. Each licensee is addressed as ``you''. ``Licensees'' and ``recipients'' may be individuals or organizations. To ``modify'' a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a ``modified version'' of the earlier work or a work ``based on'' the earlier work. A ``covered work'' means either the unmodified Program or a work based on the Program. To ``propagate'' a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To ``convey'' a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays ``Appropriate Legal Notices'' to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. @item Source Code. The ``source code'' for a work means the preferred form of the work for making modifications to it. ``Object code'' means any non-source form of a work. A ``Standard Interface'' means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The ``System Libraries'' of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A ``Major Component'', in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The ``Corresponding Source'' for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. @item Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. @item Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. @item Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. @item Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: @enumerate a @item The work must carry prominent notices stating that you modified it, and giving a relevant date. @item The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to ``keep intact all notices''. @item You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. @item If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. @end enumerate A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an ``aggregate'' if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. @item Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: @enumerate a @item Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. @item Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. @item Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. @item Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. @item Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. @end enumerate A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A ``User Product'' is either (1) a ``consumer product'', which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, ``normally used'' refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. ``Installation Information'' for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. @item Additional Terms. ``Additional permissions'' are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: @enumerate a @item Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or @item Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or @item Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or @item Limiting the use for publicity purposes of names of licensors or authors of the material; or @item Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or @item Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. @end enumerate All other non-permissive additional terms are considered ``further restrictions'' within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. @item Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. @item Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. @item Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An ``entity transaction'' is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. @item Patents. A ``contributor'' is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's ``contributor version''. A contributor's ``essential patent claims'' are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, ``control'' includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a ``patent license'' is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To ``grant'' such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. ``Knowingly relying'' means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is ``discriminatory'' if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. @item No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. @item Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. @item Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License ``or any later version'' applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. @item Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. @item Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. @item Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. @end enumerate @heading END OF TERMS AND CONDITIONS @heading How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the ``copyright'' line and a pointer to where the full notice is found. @smallexample @var{one line to give the program's name and a brief idea of what it does.} Copyright (C) @var{year} @var{name of author} This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see @url{http://www.gnu.org/licenses/}. @end smallexample Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: @smallexample @var{program} Copyright (C) @var{year} @var{name of author} This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}. This is free software, and you are welcome to redistribute it under certain conditions; type @samp{show c} for details. @end smallexample The hypothetical commands @samp{show w} and @samp{show c} should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an ``about box''. You should also get your employer (if you work as a programmer) or school, if any, to sign a ``copyright disclaimer'' for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see @url{http://www.gnu.org/licenses/}. The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read @url{http://www.gnu.org/philosophy/why-not-lgpl.html}. gnu-octave-octave-audio-125c0f5/doc/macros.texi000066400000000000000000000062411513541513100214150ustar00rootroot00000000000000@c Copyright (C) 2012-2019 John W. Eaton @c @c This file is part of Octave. @c @c Octave is free software: you can redistribute it and/or modify it @c under the terms of the GNU General Public License as published by @c the Free Software Foundation, either version 3 of the License, or @c (at your option) any later version. @c @c Octave is distributed in the hope that it will be useful, but @c WITHOUT ANY WARRANTY; without even the implied warranty of @c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @c GNU General Public License for more details. @c @c You should have received a copy of the GNU General Public License @c along with Octave; see the file COPYING. If not, see @c . @c The following macro marks words that aspell should ignore during @c spellchecking. Within Texinfo it has no effect as it merely replaces @c the macro call with the argument itself. @macro nospell {arg} \arg\ @end macro @c The following macro works around the Info/plain text expansion of @code{XXX} @c which is `XXX'. This looks particularly bad when the macro body is @c single or double-quoted text, such as a property value `"position"' @ifinfo @macro qcode{arg} \arg\ @end macro @end ifinfo @ifnotinfo @macro qcode{arg} @code{\arg\} @end macro @end ifnotinfo @c The following macro is used for the on-line help system, but we don't @c want lots of `See also: foo, bar, and baz' strings cluttering the @c printed manual (that information should be in the supporting text for @c each group of functions and variables). @c @c Implementation Note: @c For TeX, @vskip produces a nice separation. @c For Texinfo, '@sp 1' should work, but in practice produces ugly results @c for HTML. We use a simple blank line to produce the correct @c behavior. @c @c We use @xseealso now because Texinfo introduced its own @seealso @c command. But instead of modifying all source files, we'll have the @c munge-texi script convert @seealso to @xseealso. @macro xseealso {args} @iftex @vskip 2pt @end iftex @ifnottex @end ifnottex @ifnotinfo @noindent @strong{See also:} \args\. @end ifnotinfo @ifinfo @noindent See also: \args\. @end ifinfo @end macro @c The following macro works around a situation where the Info/plain text @c expansion of the @code{XXX} macro is `XXX'. The use of the apostrophe @c can be confusing if the code segment itself ends with a transpose operator. @ifinfo @macro tcode{arg} \arg\ @end macro @end ifinfo @ifnotinfo @macro tcode{arg} @code{\arg\} @end macro @end ifnotinfo @c FIXME: someday, when Texinfo 5.X is standard, we might replace this with @c @backslashchar, which is a new addition to Texinfo. @macro xbackslashchar \\ @end macro @c These may be useful for all, not just for octave.texi. @tex \ifx\rgbDarkRed\thisisundefined \def\rgbDarkRed{0.50 0.09 0.12} \fi \ifx\linkcolor\thisisundefined \relax \else \global\def\linkcolor{\rgbDarkRed} \fi \ifx\urlcolor\thisisundefined \relax \else \global\def\urlcolor{\rgbDarkRed} \fi \ifx\urefurlonlylinktrue\thisisundefined \relax \else \global\urefurlonlylinktrue \fi @end tex @c Make the apostrophe in code examples cut-and-paste friendly. @codequoteundirected on gnu-octave-octave-audio-125c0f5/doc/mkfuncdocs.py000077500000000000000000000336471513541513100217610ustar00rootroot00000000000000#!/usr/bin/env python3 ## Copyright 2018-2026 John Donoghue ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## . ## mkfuncdocs v1.0.10 ## mkfuncdocs.py will attempt to extract the help texts from functions in src ## dirs, extracting only those that are in the specifed INDEX file and output them ## to stdout in texi format ## ## It will extract from both .m and the help text for DEFUN_DLD help in .cc/.cpp ## files. ## ## It attempts to find the help text for each function in a file within the src search ## folders that match in order: [ functionname.m functionname.cc functionname.cpp ## functionname_withoutprefix.cc functionname_withoutprefix.cpp ] ## ## The INDEX file can contain additional subgroups in the form of: ## #! Subgroup Name ## ## Usage: ## mkfundocs.py options INDEXfile ## Options can be 0 or more of: ## --verbose : Turn on verbose mode ## --src-dir=xxxxx : Add dir xxxxx to the dirs searched for the function file. ## If no directories are provided, it will default to looking in the ## 'inst' directory. ## --ignore=xxxxx : dont attempt to generate help for function xxxxx. ## --funcprefix=xxxxx : remove xxxxx from the function name when searching for matching ## source file. ## --allowscan : if can not find function, attemp to scan .cc,cpp,cxx files for match ## ## --standalone : generate a texinfo file expected to be used with being included in ## another document file. import sys import os import re import tempfile import shutil import fnmatch import subprocess import glob import calendar; import time; class SubGroup: name = "" functions = [] def __init__ (self, name): if name: self.name = name self.functions = [] class Group: name = "Functions" functions = [] subgroups = [] def __init__ (self, name=""): if name: self.name = name self.functions = [] self.subgroups = [] def add_function(self, f): if len(self.subgroups) == 0: self.functions.append(f); else: functions = self.subgroups[-1].functions functions.append(f) self.subgroups[-1].functions = functions def add_subgroup(self, f): self.subgroups.append(SubGroup(f)) def isempty(self): if len(self.functions): return False for sg in self.subgroups: if len(sg.functions): return False return True def dump(self): print(f"Group {self.name}") for f in self.functions: print(f" {f}") for sg in self.subgroups: print(f" *{sg.name}") for f in sg.functions: print(f" {f}") class Index: name = "" groups = [] def texify_line(line): # convert any special chars in a line to texinfo format # currently just used for group formatting ? line = line.replace("@", "@@") line = line.replace("{", "@{") line = line.replace("}", "@}") line = line.replace(",", "@comma{}") return line def find_defun_line_in_file(filename, fnname): linecnt = 0 defun_line=re.compile(r"^DEFUN_DLD\s*\(\s*{}".format(fnname)) with open(filename, 'rt') as f: for line in f: if re.match(defun_line, line): return linecnt linecnt = linecnt + 1 return -1 def find_function_line_in_file(filename, fnname): linecnt = 0 func = False defun_line=re.compile(r"^\s*function \s*") with open(filename, 'rt') as f: for line in f: if func == True: x = line.strip() if x.startswith("## -*- texinfo -*-"): return linecnt else: func = False if re.match(defun_line, line): if line.find("=") != -1: x = line.split("=") x = x[-1] else: x = line.replace("function ", "") x = x.split("(") x = x[0].strip() if x == fnname: func = True linecnt = linecnt + 1 return -1 def read_m_file(filename, skip=0): help = [] inhelp = False havehelp = False; with open(filename, 'rt') as f: for line in f: line = line.lstrip() if skip > 0: skip = skip - 1 elif not havehelp: if havehelp == False and inhelp == False and line.startswith('##'): if "texinfo" in line: inhelp = True elif inhelp == True: if not line.startswith('##'): inhelp = False havehelp = True else: if line.startswith("## @"): line = line[3:] else: line = line[2:] help.append (line.rstrip()); return help def read_cc_file(filename, skip=0): help = [] inhelp = False havehelp = False; with open(filename, 'rt') as f: for line in f: line = line.lstrip() if skip > 0: skip = skip - 1 elif not havehelp: if havehelp == False and inhelp == False: if "texinfo" in line: inhelp = True elif inhelp == True: line = line.rstrip() if len(line) > 0 and line[-1] == '\\': line = line[:-1] line = line.rstrip() line = line.replace("\\n", "\n") line = line.replace("\\\"", "\"") if len(line) > 0 and line[-1] == '\n': line = line[:-1] # endif a texinfo line elif line.endswith('")'): line = line[:-2] if line.startswith('{'): inhelp = False havehelp = True else: help.append (line); return help def read_help (filename, skip=0): help = [] if filename[-2:] == ".m": help = read_m_file(filename, skip) else: help = read_cc_file(filename, skip) return help def read_index (filename, ignore): index = Index () with open(filename, 'rt') as f: lines = f.read().splitlines() #print ("read", lines) first = True category = Group() for l in lines: if l.startswith("#!"): l = l[2:].strip() category.add_subgroup(l) elif l.startswith("#"): pass elif first: index.name = l; first = False elif "=" in l: # func = some text work around funcs = l.split("=") f = funcs[0].strip() d = funcs[1].strip() if f not in ignore: category.add_function(f + "=" + d) elif l.startswith(" "): l = l.strip() # may be multiple functions here funcs = l.split() for f in funcs: if f not in ignore: category.add_function(l) else: # new category name if not category.isempty(): index.groups.append(category) category = Group(l.strip()) # left over category ? if not category.isempty(): index.groups.append(category) return index; def find_class_file(fname, paths): for f in paths: # class constructor ? name = f + "/@" + fname + "/" + fname + ".m" if os.path.isfile(name): return name, 0 # perhaps classname.func format ? x = fname.split(".") if len(x) > 0: zname = x.pop() cname = ".".join(x) name = f + "/" + cname + ".m" if os.path.isfile(name): idx = find_function_line_in_file(name, zname) if idx >= 0: return name, idx name = f + "/@" + cname + "/" + zname + ".m" if os.path.isfile(name): return name, 0 return None, -1 def find_func_file(fname, paths, prefix, scanfiles=False): for f in paths: name = f + "/" + fname + ".m" if os.path.isfile(name): return name, 0 # class constructor ? name = f + "/@" + fname + "/" + fname + ".m" if os.path.isfile(name): return name, 0 name = f + "/" + fname + ".cc" if os.path.isfile(name): return name, 0 name = f + "/" + fname + ".cpp" if os.path.isfile(name): return name, 0 # if have a prefix, remove and try if prefix and fname.startswith(prefix): fname = fname[len(prefix):] name = f + "/" + fname + ".cc" if os.path.isfile(name): return name, 0 name = f + "/" + fname + ".cpp" if os.path.isfile(name): return name, 0 # if here, we still dont have a file match # if allowed to scan files, do that if scanfiles: #sys.stderr.write("Warning: Scaning for {}\n".format(fname)) for f in paths: files = list(f + "/" + a for a in os.listdir(f)) cc_files = fnmatch.filter(files, "*.cc") cpp_files = fnmatch.filter(files, "*.cpp") cxx_files = fnmatch.filter(files, "*.cxx") for fn in cc_files + cpp_files + cxx_files: line = find_defun_line_in_file(fn, fname) if line >= 0: #sys.stderr.write("Warning: Found function for {} in {} at {}\n".format(fname, fn, line)) return fn, line return None, -1 def display_standalone_header(): # make a file that doesnt need to be included in a texinfo file to # be valid print("@c mkfuncdocs output for a standalone function list") print("@include macros.texi") print("@ifnottex") print("@node Top") print("@top Function Documentation") print("Function documentation extracted from texinfo source in octave source files.") print("@contents") print("@end ifnottex") print("@node Function Reference") print("@chapter Function Reference") print("@cindex Function Reference") def display_standalone_footer(): print("@bye") def display_func(name, ref, help, is_subgroup): print ("@c -----------------------------------------") if is_subgroup: print ("@subsubsection {}".format(name)) else: print ("@subsection {}".format(name)) print ("@cindex {}".format(ref)) for l in help: print ("{}".format(l)) def process_function_help(g_name, f, options, is_subgroup=False): if True: print ("@c {} {}".format(g_name, f)) h = "" filename = "" path = "" if "=" in f: # we are using func=some inline text x = f.split("=") name = ref = x[0] h = [x[1]] elif "@" in f: #print ("class func") path = f name = "@" + f ref = f.split("/")[-1] filename, lineno = find_func_file(path, options["srcdir"], options["funcprefix"]) elif "." in f: path = f ref = f.split(".")[-1] name = f.split(".")[-1] filename, lineno = find_class_file(path, options["srcdir"]) if not filename: parts = f.split('.') cnt = 0 path = "" for p in parts: if cnt < len(parts)-1: path = path + "/+" else: path = path + "/" path = path + p cnt = cnt + 1 name = f; ref = parts[-1] filename, lineno = find_func_file(path, options["srcdir"], options["funcprefix"]) elif "/" in f: path = f name = f ref = f.split("/")[-1] filename, lineno = find_func_file(path, options["srcdir"], options["funcprefix"]) else: path = f name = f ref = f filename, lineno = find_func_file(path, options["srcdir"], options["funcprefix"], options['allowscan']) if h: # we have the text already pass elif not filename: sys.stderr.write("Warning: Cant find source file for {}\n".format(f)) else: h = read_help (filename, lineno) if h: display_func (name, ref, h, is_subgroup) def process (args): options = { "verbose": False, "srcdir": [], "funcprefix": "", "ignore": [], "standalone": False, "allowscan": False } indexfile = "" for a in args: #print ("{}".format(a)) c=a.split("=") key=c[0] if len(c) > 1: val=c[1] else: val="" if key == "--verbose": options["verbose"] = True; if key == "--standalone": options["standalone"] = True; elif key == "--allowscan": options["allowscan"] = True; elif key == "--src-dir": if val: options["srcdir"].append(val); elif key == "--ignore": if val: options["ignore"].append(val); elif key == "--func-prefix": if val: options["funcprefix"] = val; elif val == "": if indexfile == "": indexfile = key if indexfile == "": raise Exception("No index filename") if len(options["srcdir"]) == 0: options["srcdir"].append("inst") #print "options=", options if options['standalone']: display_standalone_header() idx = read_index(indexfile, options["ignore"]) for g in idx.groups: #print ("************ {}".format(g.name)) g_name = texify_line(g.name) print ("@c ---------------------------------------------------") print ("@node {}".format(g_name)) print ("@section {}".format(g_name)) print ("@cindex {}".format(g_name)) for f in sorted(g.functions): process_function_help(g_name, f, options) for sg in g.subgroups: sg_name = texify_line(sg.name) print ("@c ---------------------------------------------------") print ("@node {}".format(g_name + " - " + sg_name)) print ("@subsection {}".format(sg_name)) print ("@cindex {}".format(g_name + " - " + sg_name)) for f in sorted(sg.functions): process_function_help(g_name + sg_name, f, options, True) if options['standalone']: display_standalone_footer() def show_usage(): print (sys.argv[0], "[options] indexfile") if __name__ == "__main__": if len(sys.argv) > 1: status = process(sys.argv[1:]) sys.exit(status) else: show_usage() gnu-octave-octave-audio-125c0f5/doc/mkqhcp.py000077500000000000000000000155101513541513100210750ustar00rootroot00000000000000#!/usr/bin/env python3 ## mkqhcp.py ## Version 1.0.6 ## Copyright 2022-2025 John Donoghue ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## . import sys import os import re def process(name): with open(name + ".qhcp", 'wt') as f: f.write ('\n') f.write ('\n') f.write (' \n') f.write (' \n') f.write (' \n') f.write (' {0}.qhp\n'.format(name)) f.write (' {0}.qch\n'.format(name)) f.write (' \n') f.write (' \n') f.write (' \n') f.write (' {0}.qch\n'.format(name)) f.write (' \n') f.write (' \n') f.write ('\n') title = name pat_match = re.compile(r".*(?P<title>[^<]+).*") with open(name + ".html", 'rt') as fin: # find html for line in fin: line = line.strip() e = pat_match.match(line) if e: title = e.group("title") break # section h2_match = re.compile(r'.*

]*>(?P[^<]+)</h2>.*') # appendix h2a_match = re.compile(r'.*<h2 class="appendix"[^>]*>(?P<title>[^<]+)</h2>.*') # index h2i_match = re.compile(r'.*<h2 class="unnumbered"[^>]*>(?P<title>[^<]+)</h2>.*') h3_match = re.compile(r'.*<h3 class="section"[^>]*>(?P<title>[^<]+)</h3>.*') h4_match = re.compile(r'.*<h4 class="subsection"[^>]*>(?P<title>[^<]+)</h4>.*') h5_match = re.compile(r'.*<h4 class="subsubsection"[^>]*>(?P<title>[^<]+)</h4>.*') tag_match1 = re.compile(r'.*<span id="(?P<tag>[^"]+)"[^>]*></span>.*') #tag_match2 = re.compile(r'.*<div class="[sub]*section" id="(?P<tag>[^"]+)"[^>]*>.*') tag_match2 = re.compile(r'.*<div class="[sub]*section[^"]*" id="(?P<tag>[^"]+)"[^>]*>.*') tag_match3 = re.compile(r'.*<div class="chapter-level-extent" id="(?P<tag>[^"]+)"[^>]*>.*') tag_match4 = re.compile(r'.*<div class="appendix-level-extent" id="(?P<tag>[^"]+)"[^>]*>.*') tag_match5 = re.compile(r'.*<div class="unnumbered-level-extent" id="(?P<tag>[^"]+)"[^>]*>.*') index_match = re.compile(r'.*<h4 class="[sub]+section"[^>]*>[\d\.\s]*(?P<name>[^<]+)</h4>.*') index_match2 = re.compile(r'.*<h4 class="[sub]+section"[^>]*><span>[\d\.\s]*(?P<name>[^<]+)<.*') tag = "top" has_h2 = False has_h3 = False has_h4 = False #pat_match = re.compile(r'.*<span id="(?P<tag>[^"])"></span>(?P<title>[.]+)$') with open(name + ".html", 'rt') as fin: with open(name + ".qhp", 'wt') as f: f.write('<?xml version="1.0" encoding="UTF-8"?>\n') f.write('<QtHelpProject version="1.0">\n') f.write(' <namespace>octave.community.{}</namespace>\n'.format(name)) f.write(' <virtualFolder>doc</virtualFolder>\n') f.write(' <filterSection>\n') f.write(' <toc>\n') f.write(' <section title="{} Manual" ref="{}.html">\n'.format(title, name)) # chapters here for line in fin: line = line.strip() e = tag_match1.match(line) if not e: e = tag_match2.match(line) if not e: e = tag_match3.match(line) if not e: e = tag_match4.match(line) if not e: e = tag_match5.match(line) if e: tag = e.group("tag") e = h2_match.match(line) if not e: e = h2a_match.match(line) if not e: e = h2i_match.match(line) if e: if has_h4: f.write(' </section>\n') has_h4 = False if has_h3: f.write(' </section>\n') has_h3 = False if has_h2: f.write(' </section>\n') has_h2 = True f.write(' <section title="{}" ref="{}.html#{}">\n'.format(e.group("title"), name, tag)) e = h3_match.match(line) if e: if has_h4: f.write(' </section>\n') has_h4 = False if has_h3: f.write(' </section>\n') has_h3 = True f.write(' <section title="{}" ref="{}.html#{}">\n'.format(e.group("title"), name, tag)) e = h4_match.match(line) if e: if has_h4: f.write(' </section>\n') has_h4 = True #f.write(' <section title="{}" ref="{}.html#{}"></section>\n'.format(e.group("title"), name, tag)) f.write(' <section title="{}" ref="{}.html#{}">\n'.format(e.group("title"), name, tag)) e = h5_match.match(line) if e: f.write(' <section title="{}" ref="{}.html#{}"></section>\n'.format(e.group("title"), name, tag)) if has_h4: f.write(' </section>\n') if has_h3: f.write(' </section>\n') if has_h2: f.write(' </section>\n') f.write(' </section>\n') f.write(' </toc>\n') f.write(' <keywords>\n') fin.seek(0) for line in fin: line = line.strip() e = tag_match1.match(line) if not e: e = tag_match2.match(line) if e: tag = e.group("tag") e = index_match.match(line) if not e: e = index_match2.match(line) if e: f.write(' <keyword name="{}" ref="{}.html#{}"></keyword>\n'.format(e.group("name"), name, tag)) f.write(' </keywords>\n') f.write(' <files>\n') f.write(' <file>{}.html</file>\n'.format(name)) # include octave.css if we have it if os.path.exists("octave.css"): f.write(' <file>octave.css</file>\n') if os.path.exists("{}.css".format(name)): f.write(' <file>{}.css</file>\n'.format(name)) f.write(' </files>\n') f.write(' </filterSection>\n') f.write('</QtHelpProject>\n') def show_usage(): print (sys.argv[0], "projname") if __name__ == "__main__": if len(sys.argv) > 1: status = process(sys.argv[1]) sys.exit(status) else: show_usage() ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/doc/octave.css������������������������������������������������������0000664�0000000�0000000�00000014442�15135415131�0021233�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Copyright (C) 2016-2026 The Octave Project Developers See the file COPYRIGHT.md in the top-level directory of this distribution or <https://octave.org/copyright/>. This file is part of Octave. Octave is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Octave is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Octave; see the file COPYING. If not, see <https://www.gnu.org/licenses/>. */ /* Import web font Roboto Condensed, Font Library Version 2015-06-06 */ @font-face { font-family: 'Roboto Condensed'; src: local('Roboto Condensed Bold'), local('RobotoCondensed-Bold'), url('https://fontlibrary.org/assets/fonts/roboto-condensed/71405335c70332d94afd24ae4f06c9b2/4b8b4b377e8cb358cf886d13c7bb287c/RobotoCondensedBold.ttf') format('truetype'); font-weight: bold; font-style: normal; } @font-face { font-family: 'Roboto Condensed'; src: local('Roboto Condensed Bold Italic'), local('RobotoCondensed-BoldItalic'), url('https://fontlibrary.org/assets/fonts/roboto-condensed/71405335c70332d94afd24ae4f06c9b2/9b1d05d1b332e5b95ad86e71ca8404fb/RobotoCondensedBoldItalic.ttf') format('truetype'); font-weight: bold; font-style: italic; } @font-face { font-family: 'Roboto Condensed'; src: local('Roboto Condensed Italic'), local('RobotoCondensed-Italic'), url('https://fontlibrary.org/assets/fonts/roboto-condensed/71405335c70332d94afd24ae4f06c9b2/d02fffb6890e4f28023dd149916d1b8a/RobotoCondensedItalic.ttf') format('truetype'); font-weight: normal; font-style: italic; } @font-face { font-family: 'Roboto Condensed'; src: local('Roboto Condensed Regular'), local('RobotoCondensed-Regular'), url('https://fontlibrary.org/assets/fonts/roboto-condensed/71405335c70332d94afd24ae4f06c9b2/b0b1845ecce8ab6a503971e808a8409c/RobotoCondensedRegular.ttf') format('truetype'); font-weight: normal; font-style: normal; } /* Import web font Fantasque Sans Mono, Font Library Version 2016-04-05 */ @font-face { font-family: 'Fantasque Sans Mono', FreeMono, 'Courier New', Cousine, Courier, monospace; src: local('Fantasque Sans Mono Bold'), local('FantasqueSansMono-Bold'), url('https://fontlibrary.org/assets/fonts/fantasque-sans-mono/b0cbb25e73a9f8354e96d89524f613e7/a46033d3a07d9385620dc83b7655203f/FantasqueSansMonoBold.ttf') format('truetype'); font-weight: bold; font-style: normal; } @font-face { font-family: 'Fantasque Sans Mono', FreeMono, 'Courier New', Cousine, Courier, 'monospace'; src: local('Fantasque Sans Mono Bold Italic'), local('FantasqueSansMono-BoldItalic'), url('https://fontlibrary.org/assets/fonts/fantasque-sans-mono/b0cbb25e73a9f8354e96d89524f613e7/b0683ef4c834908aa372ec78dea42349/FantasqueSansMonoBoldItalic.ttf') format('truetype'); font-weight: bold; font-style: italic; } @font-face { font-family: 'Fantasque Sans Mono', FreeMono, 'Courier New', Cousine, Courier, monospace; src: local('Fantasque Sans Mono Italic'), local('FantasqueSansMono-Italic'), url('https://fontlibrary.org/assets/fonts/fantasque-sans-mono/b0cbb25e73a9f8354e96d89524f613e7/b78d0a48e4443f797e8d45dcf97594f7/FantasqueSansMonoItalic.ttf') format('truetype'); font-weight: normal; font-style: italic; } @font-face { font-family: 'Fantasque Sans Mono', FreeMono, 'Courier New', Cousine, Courier, monospace; src: local('Fantasque Sans Mono Regular'), local('FantasqueSansMono-Regular'), url('https://fontlibrary.org/assets/fonts/fantasque-sans-mono/b0cbb25e73a9f8354e96d89524f613e7/f3fdc4f0f26e4431f54e8b552d55480c/FantasqueSansMonoRegular.ttf') format('truetype'); font-weight: normal; font-style: normal; } /* Use custom fonts */ code, kbd, samp, tt, pre { font-family: 'Fantasque Sans Mono', FreeMono, 'Courier New', Cousine, Courier, monospace; } code, kbd, samp, tt { font-style: italic; padding: 0 0.1ex; /* slightly increase margin to surrounding text */ } body, .sansserif { font-family: 'Roboto Condensed', sans-serif; } h1, h2, h3, h4, h5, .menu-comment, .roman, .menu-preformatted { font-family: 'Roboto Condensed', serif; } /* Use colors from the solarized color theme (sparsely), the main text will remain in default colors for optimal readability (black on white). */ pre.example, .header, .float-caption, hr { /* base00 ~ body text in light solarized theme */ color: #657b83; border-color: #657b83; } pre.example { /* base3 ~ background color in light solarized theme */ background-color: #fdf6e3; padding: 0.5em; } a { color: #268bd2; /* blue */ } a:visited { color: #d33682; /* magenta */ } /* Center floating tables and images */ .float table, .float img, .float object { margin-left: auto; margin-right: auto; } /* Decrease table width, but not on small screens */ .float table { max-width: 38em; } /* Use horizontal lines: above/below tables and after table headers (Chicago Style). */ .float table, .float th { border-collapse: collapse; border-top: 1px solid black; border-bottom: 1px solid black; } .float th, .float td { padding: 0.5em; } /* Use horizontal ruler with double lines */ hr { border-width: 0; border-top-width: 3px; border-style: double; } /* Smaller gap between subsequent @group blocks */ .example { margin-bottom: 1em; } .example + .example { margin-top: -0.5em } /* Smaller gap between definition and its description */ dd > p:first-child { margin-top: 0.5em; } /* Limit maximum body width such that text is easier to read */ body { max-width: 42em; margin-left: 0.5em; margin-right: 0.5em; } /* On small screens don't indent the code examples to prevent overflow */ div.example { margin-left: auto; max-width: 38.8em; } /* Use left margin such that text is easier to read, but don't sacrifice space on small screens. */ @media screen and (min-width: 43em) { /* Smooth transition for screens between 43em and 57em */ body { margin-left: auto; margin-right: auto; } @media (min-width: 57em) { body { margin-left: 7.5em; } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/���������������������������������������������������������������0000775�0000000�0000000�00000000000�15135415131�0017443�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/@midimsg/������������������������������������������������������0000775�0000000�0000000�00000000000�15135415131�0021174�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/@midimsg/properties.m������������������������������������������0000664�0000000�0000000�00000002135�15135415131�0023547�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2023 John Donoghue ## ## This file is part of Octave. ## ## Octave is free software; you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 3 of the License, or (at ## your option) any later version. ## ## Octave is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with Octave; see the file COPYING. If not, see ## <http://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {&var{props} =} properties (@var{rf}) ## Return the properties the midimsg ## @seealso{midimsg} ## @end deftypefn function props = properties(this) # in octave <= 6.4, 'properties' cant t be be used as a function name # otherwise will be a syntax error, so currently using separate file for the function props = __properties__(this); endfunction �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/@octave_midi/��������������������������������������������������0000775�0000000�0000000�00000000000�15135415131�0022026�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/@octave_midi/hasdata.m�����������������������������������������0000664�0000000�0000000�00000002342�15135415131�0023612�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2022 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {@var{tf} =} hasdata (@var{dev}) ## Return whether there is data available to read ## ## @subsubheading Inputs ## @var{dev} - a octave midi device opened using mididevice.@* ## ## @subsubheading Outputs ## @var{tf} - true if device has data available to read@* ## ## @seealso{mididevice} ## @end deftypefn function tf = hasdata(dev) if nargin < 1 || !isobject(dev) || !strcmp(typeinfo(dev), "octave_midi") error ("Expected midi device"); endif tf = __midistat__(dev); endfunction ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/__load_audio__.m�����������������������������������������������0000664�0000000�0000000�00000002643�15135415131�0022522�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2023 John Donoghue ## ## This program is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 3 of the ## License, or (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, see ## <http:##www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {} __load_audio__ () ## Undocumented internal function of audio package. ## @end deftypefn ## PKG_ADD: __load_audio__ () function __load_audio__ () # on package load, attempt to load docs try pkg_dir = fileparts (fullfile (mfilename ("fullpath"))); doc_file = fullfile (pkg_dir, "doc", "audio.qch"); doc_file = strrep (doc_file, '\', '/'); if exist(doc_file, "file") if exist("__event_manager_register_documentation__") __event_manager_register_documentation__ (doc_file); elseif exist("__event_manager_register_doc__") __event_manager_register_doc__ (doc_file); endif endif catch # do nothing end_try_catch endfunction ���������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/__unload_audio__.m���������������������������������������������0000664�0000000�0000000�00000002665�15135415131�0023071�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2023 John Donoghue ## ## This program is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 3 of the ## License, or (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, see ## <http:##www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {} __unload_audio__ () ## Undocumented internal function of audio package. ## @end deftypefn ## PKG_DEL: __unload_audio__ () function __unload_audio__ () # on package unload, attempt to unload docs try pkg_dir = fileparts (fullfile (mfilename ("fullpath"))); doc_file = fullfile (pkg_dir, "doc", "audio.qch"); doc_file = strrep (doc_file, '\', '/'); if exist(doc_file, "file") if exist("__event_manager_unregister_documentation__") __event_manager_unregister_documentation__ (doc_file); elseif exist("__event_manager_unregister_doc__") __event_manager_unregister_doc__ (doc_file); endif endif catch # do nothing end_try_catch endfunction ���������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/audio.m��������������������������������������������������������0000664�0000000�0000000�00000005225�15135415131�0020726�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2019 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## The Audio package provides basic MIDI and audio functionality for GNU octave. ## ## @subheading MIDI ## The following MIDI functions are available: ## ## @subsubheading MIDI Device query: ## @table @asis ## @item mididevinfo ## list any MIDI devices detected in the system ## @end table ## ## @subsubheading MIDI Device creation and manipulation: ## @table @asis ## @item mididevice ## Create a midi device ## @item midimsg ## Create a MIDI message or group of messages ## @item midireceive ## receive a MIDI message from a device ## @item midisend ## Send a MIDI message to a device ## @end table ## ## @subsubheading MIDI Controller Interface Functions: ## @table @asis ## @item midiid ## Identify a midi controller ## @item midicontrols ## Create a MIDI controller object ## @item midireceive ## Receive data from a MIDI controller object ## @item midisend ## Send data to a MIDI controller. ## @end table ## ## @subsubheading Writing and reading basic MIDI files: ## @table @asis ## @item midifileinfo ## read information about a MIDI file, including number of tracks, ## comments etc. ## @item midifileread ## read a MIDI file into a midimsg array ## @item midifilewrite ## write a midimsg array to a MIDI file ## @end table ## ## @subsubheading General usage: ## ## Normal usage would involve querying the devices that are available: ## @example ## mididevinfo ## @end example ## ## Then selecting the device(s) to connect to, and creating a mididevice to perform read and write functionality: ## @example ## dev = mididevice(0); ## @end example ## ## And then performing I/O on the device: ## @example ## msg = midireceive(dev) ## @end example ## ## @subheading Audio ## The following Audio functions are available: ## @table @asis ## @item hz2mel, hz2bark, hz2erp, mel2hz, bark2hz, erp2hz ## Convert between hz and other frequenct scales ## @item audioOscillator ## Create a audio waveform generator ## @end table function audio() help audio; endfunction ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/audioOscillator.m����������������������������������������������0000664�0000000�0000000�00000035102�15135415131�0022757�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2023 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. classdef audioOscillator < handle ## -*- texinfo -*- ## @deftypefn {} {} audioOscillator ## Generate sine, sawtool and square waveforms ## @end deftypefn ## ## @subheading Methods ## @deftypefn {} {@var{obj} =} audioOscillator () ## @deftypefnx {} {@var{obj} =} audioOscillator (@var{signalTypeValue}) ## @deftypefnx {} {@var{obj} =} audioOscillator (@var{signalTypeValue}, @var{frequencyValue}) ## @deftypefnx {} {@var{obj} =} audioOscillator (__, @var{propertyname}, @var{propertyvalue}) ## Create a audioOscillator object ## ## @subsubheading Inputs ## @var{signalTypeValue} - signal type of "sine" (default), "square", "sawtooth".@* ## @var{frequencyValue} - hz frequency value of waveform (default 100).@* ## @var{propertyname}, @var{propertyvalue} - properties to set on the object. ## ## Known properties are: ## @table @asis ## @item SignalType ## signal type of "sine" (default), "square" or "sawtooth". (readonly) ## @item Frequency ## frequency of the waveform (default 100) ## @item Amplitude ## amplitude of the signal (default 1) ## @item SampleRate ## sample rate of the signal (default 44100) ## @item PhaseOffset ## phase offset of signal 0 (default) - 1 (readonly) ## @item DutyCycle ## dutycycle of the signal 0 - 1 (default 0.5) when signal is a square wave. ## @item SamplePerFrame ## Samples per frame as returned from () (default 512) ## @item MaxSamplePerFrame ## Max samples per frame (default 192000) ## @item DCOffset ## DC Offset of signal (default 0) ## @item Width ## Width of sawtooth (default 1) ## @item OutputDataType ## Output data type of 'single' or 'double' (default 'double') ## @end table ## ## @subsubheading Outputs ## @var{obj} - signalGenerator object ## ## @subsubheading Examples ## Create a 100 hz sine wave and plot first 512 samples ## @example ## sinosc = audioOscillator ## data = sinosc(); ## plot(data); ## @end example ## ## Create a 2 hz square wave with duty cycle of 0.5 ## @example ## sqosc = audioOscillator('square', 'DutyCycle', 0.50, 'Frequency', 2); ## @end example ## ## @end deftypefn ## ## @deftypefn {} {@var{data} =} @var{obj}() ## Generate a frame of waveform data from the generator function ## ## @subsubheading Inputs ## @var{obj} - signalGenerator object ## ## @subsubheading Outputs ## @var{data} - waveform data ## @end deftypefn ## ## @deftypefn {} {} release(@var{obj}) ## Release resources of generator ## ## @subsubheading Inputs ## @var{obj} - signalGenerator object ## ## @subsubheading Outputs ## None ## @end deftypefn properties (SetAccess = private, GetAccess = public) # read only properties SignalType = "sine"; PhaseOffset = 0; endproperties properties (Access = public) # read/write properties SampleRate = 44100; DutyCycle = 0.5; Frequency = 100; Amplitude = 1.0; SamplesPerFrame = 512; Width = 1; DCOffset = 0; MaxSamplesPerFrame = 192000; OutputDataType = 'double' endproperties properties (Static = true, Access = private) # data validation functions check_sig_value = @(x) ischar(x) && any (strcmp (x, {'sine', 'square', 'sawtooth'})); check_odt_value = @(x) ischar(x) && any (strcmp (x, {'single', 'double'})); check_amp_value = @(x) isnumeric(x) && isreal(x) && (x >= 0) check_duty_value = @(x) isnumeric(x) && isreal(x) && isscalar(x) && (x >= 0 && x <= 1) check_freq_value = @(x) isnumeric(x) && isreal(x) && (x >= 0) check_srate_value = @(x) isnumeric(x) && isscalar(x) && isreal(x) && (x > 0) check_spf_value = @(x) isnumeric(x) && isscalar(x) && (rem(x, 1) == 0) && (x > 0) check_mspf_value = @(x) isnumeric(x) && isscalar(x) && (rem(x, 1) == 0) && (x > 0) check_width_value = @(x) isnumeric(x) && isscalar(x) && (x >= 0 && x <= 1) check_dcoff_value = @(x) isnumeric(x) && isreal(x) check_phase_value = @(x) isnumeric(x) && isreal(x) && all(x >= 0 && x <= 1) endproperties properties (Access = private) # internal data structure for waveform _wavedata = struct("data", [], "pos", 0); endproperties methods (Access = public) function this = audioOscillator(varargin) if nargin > 0 # either a property name or signal type if !ischar(varargin{1}) error ("Expected first input argument to be signal type or property name.") endif propstart = 1; # do we have signal type or possible property name/value? if this.check_sig_value(varargin{1}) this.SignalType = varargin{1}; propstart = 2; # we have frequency too ? if nargin > 1 && isnumeric(varargin{2}) propstart = 3; this.Frequency = varargin{2}; endif elseif !is_property(this, varargin{1}) error ("Expected first input argument to be signal type or property name.") endif if mod(length(varargin)-propstart, 2) != 1 error ("Expected property name/value pairs.") endif # handle the properties p = inputParser(CaseSensitive=false, FunctionName='audioOscillator'); p.addParameter('SignalType', this.SignalType, this.check_sig_value); p.addParameter('Amplitude', this.Amplitude, this.check_amp_value); p.addParameter('DutyCycle', this.DutyCycle, this.check_duty_value); p.addParameter('Frequency', this.Frequency, this.check_freq_value); p.addParameter('SampleRate', this.SampleRate, this.check_srate_value); p.addParameter('SamplesPerFrame', this.SamplesPerFrame, this.check_spf_value); p.addParameter('Width', this.Width, this.check_width_value); p.addParameter('DCOffset', this.DCOffset, this.check_dcoff_value); p.addParameter('MaxSamplesPerFrame', this.MaxSamplesPerFrame, this.check_mspf_value); p.addParameter('OutputDataType', this.OutputDataType, this.check_odt_value); p.addParameter('PhaseOffset', this.PhaseOffset, this.check_phase_value); p.parse(varargin{propstart:end}) # verify samples per frame vs maxsample per frame if p.Results.SamplesPerFrame > p.Results.MaxSamplesPerFrame error ("Invalid SamplesPerFrame - Can not be greater than MaxSamplesPerFrame") endif this.MaxSamplesPerFrame = p.Results.MaxSamplesPerFrame; # set properties from inputs/defaults fields = fieldnames(p.Results); for f = 1:length(fields) propname = fields{f}; propval = p.Results.(propname); this.(propname) = propval; endfor endif endfunction function release(this) # anything we need release ? if ! isempty(this._wavedata.data) this._wavedata.data = []; this._wavedata.pos = 0; endif endfunction function data = subsref(this, S) if nargin == 1 || (S(1).type == "()" && isempty(S(1).subs)) # build the waveform if we dont have one yet if isempty(this._wavedata.data) this._wavedata.pos = 0; # phase theta = this.PhaseOffset * 2 * pi; t = linspace(theta,2*pi*this.Frequency+theta,this.SampleRate); if strcmp(this.SignalType, "sine") wavedata = sin(t); elseif strcmp(this.SignalType, "square") t = t / 2*pi; wavedata = ones(size(t)); wavedata(t-floor(t) >= this.DutyCycle) = -1; elseif strcmp(this.SignalType, "sawtooth") t = mod (t / (2 * pi), 1); wavedata = zeros (size (t)); if this.Width != 0 wavedata(t < this.Width) = 2 * t(t<this.Width) / this.Width -1; endif if this.Width != 1 wavedata(t >= this.Width) = -2 * t(t>=this.Width) / (1-this.Width) +1; endif else # should never be able to get here error ("Unknown SignalType"); endif wavedata = this.DCOffset + (this.Amplitude * wavedata); if strcmp(this.OutputDataType, 'single') wavedata = single(wavedata); endif this._wavedata.data = wavedata; endif # extract some of the sample data = []; len = this.SamplesPerFrame - length(data); while len > 0 left = length(this._wavedata.data) - this._wavedata.pos; if left <= len # use up all thats left data = [data this._wavedata.data(this._wavedata.pos+1:end)]; this._wavedata.pos = 0; else data = [data this._wavedata.data(this._wavedata.pos+1:this._wavedata.pos+len)]; this._wavedata.pos = this._wavedata.pos + len; endif len = this.SamplesPerFrame - length(data); endwhile S = S(2:end); else data = this; endif if (numel (S) > 0) data = builtin('subsref',data, S); endif endfunction function this = set.SampleRate(this, rate) if ! this.check_srate_value(rate) error ("Invalid SampleRate - validation %s", func2str(this.check_srate_value)) endif this.SampleRate = rate; # clear data so will be regenerated this._wavedata.data = []; endfunction function this = set.DutyCycle(this, rate) if ! this.check_duty_value(rate) error ("Invalid DutyCycle - validation %s", func2str(this.check_duty_value)) endif this.DutyCycle = rate; # clear data so will be regenerated this._wavedata.data = []; endfunction function this = set.Amplitude(this, amp) if ! this.check_amp_value(amp) error ("Invalid Amplitude - validation %s", func2str(this.check_amp_value)) endif this.Amplitude = amp; # clear data so will be regenerated this._wavedata.data = []; endfunction function this = set.SamplesPerFrame(this, value) if ! this.check_spf_value(value) error ("Invalid SamplesPerFrame - validation %s", func2str(this.check_spf_value)) endif if value > this.MaxSamplesPerFrame error ("Invalid SamplesPerFrame - Can not be greater than MaxSamplesPerFrame"); endif this.SamplesPerFrame = value; # clear data so will be regenerated this._wavedata.data = []; endfunction function this = set.MaxSamplesPerFrame(this, value) if ! this.check_mspf_value(value) error ("Invalid MaxSamplesPerFrame - validation %s", func2str(this.check_mspf_value)) endif this.MaxSamplesPerFrame = value; # scale back samples per frame if now is invalid if this.SamplesPerFrame > value this.SamplesPerFrame = value; endif endfunction function this = set.Width(this, value) if ! this.check_width_value(value) error ("Invalid Width - validation %s", func2str(this.check_width_value)) endif this.Width = value; # clear data so will be regenerated this._wavedata.data = []; endfunction function this = set.DCOffset(this, value) if ! this.check_dcoff_value(value) error ("Invalid DCOffset - validation %s", func2str(this.check_dcoff_value)) endif this.DCOffset = value; # clear data so will be regenerated this._wavedata.data = []; endfunction function this = set.OutputDataType(this, value) if ! this.check_odt_value(value) error ("Invalid OutputDataType - validation %s", func2str(this.check_odt_value)) endif this.OutputDataType = value; # clear data so will be regenerated this._wavedata.data = []; endfunction function this = set.Frequency(this, value) if ! this.check_freq_value(value) error ("Invalid Frequency - validation %s", func2str(this.check_freq_value)) endif this.Frequency = value; # clear data so will be regenerated this._wavedata.data = []; endfunction endmethods methods (Access = private) function y = is_property(this, value) y = false; if exist ("properties") props_f = str2func("properties"); props = props_f(this); else # no properties function so manually look at classinfo props_all = metaclass(this).Properties; props = {}; for idx=1:length(props_all) p = props_all{idx}; if strcmp(p.GetAccess, "public") props{end+1} = p.Name; endif endfor endif if any(strcmpi(value, props)) y = true; endif endfunction endmethods endclassdef %!error audioOscillator(1) %!error audioOscillator("unknown") %!error audioOscillator("sine", "a") %!test %! osc = audioOscillator(); %! assert(osc.Frequency, 100); %! assert(osc.SampleRate, 44100); %! assert(osc.SignalType, "sine"); %! osc = audioOscillator("sine"); %! assert(osc.SignalType, "sine"); %! osc = audioOscillator("SignalType", "sine"); %! assert(osc.SignalType, "sine"); %! osc = audioOscillator("sine", 2); %! assert(osc.SignalType, "sine"); %! assert(osc.Frequency, 2); %!test %! osc = audioOscillator("square"); %! assert(osc.Frequency, 100); %! assert(osc.SampleRate, 44100); %! assert(osc.SignalType, "square"); %! osc = audioOscillator("SignalType", "square"); %! assert(osc.SignalType, "square"); %! osc = audioOscillator("square", 2); %! assert(osc.SignalType, "square"); %! assert(osc.Frequency, 2); %!test %! osc = audioOscillator("sawtooth"); %! assert(osc.Frequency, 100); %! assert(osc.SampleRate, 44100); %! assert(osc.SignalType, "sawtooth"); %! osc = audioOscillator("SignalType", "sawtooth"); %! assert(osc.SignalType, "sawtooth"); %!test %! osc = audioOscillator("SignalType", "sine", "Frequency", 2, "Amplitude", 1.1, "SamplesPerFrame", 1024); %! assert(osc.Frequency, 2); %! assert(osc.Amplitude, 1.1); %! assert(osc.SamplesPerFrame, 1024); %! assert(osc.SampleRate, 44100); %!test %! osc = audioOscillator("sine"); %! data = osc(); %! assert(length(data), osc.SamplesPerFrame) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/bark2hz.m������������������������������������������������������0000664�0000000�0000000�00000003256�15135415131�0021172�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2023 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {@var{hz} =} bark2hz (@var{bark}) ## Convert equivalent Bark Frequency to Hz. ## ## @subsubheading Inputs ## @var{bark} - input frequency in bark. ## ## @subsubheading Outputs ## @var{hz} - Output frequency in Hz. ## ## @subsubheading References ## TraunmĂ¼ller, Hartmut. @cite{Analytical Expressions for the Tonotopic Sensory Scale. ## Journal of the Acoustical Society of America. Vol. 88, Issue 1, 1990} ## ## @seealso {hz2bark} ## @end deftypefn function hz = bark2hz (bark) if nargin < 1 show_usage() endif if ! (isnumeric(bark) && isreal(bark)) error ("Expected real scalar or vector"); endif idx1 = find(bark<2); idx2 = find(bark>20.1); bark(idx1) = (bark(idx1) - 0.3) / 0.85; bark(idx2) = (bark(idx2) + 4.422) / 1.22; hz = 1960 * (bark + 0.53) / (26.28 - bark); endfunction %!error bark2hz() %!error bark2hz('a') %!error bark2hz(2i) %!test %! bark = hz2bark(10); %! hz = bark2hz(bark); %! assert(hz, 10, 100*eps) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/data/����������������������������������������������������������0000775�0000000�0000000�00000000000�15135415131�0020354�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/data/c_maj_melody.mid������������������������������������������0000664�0000000�0000000�00000000472�15135415131�0023474�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MThd�����àMTrk���¸�ÿX�ÿY���°y��À��°d� @�[��]��ÿ!��<PƒG<�>PƒG>�@PƒG@�APƒGA�CPƒGC�EPƒGE�GPƒGG�HPƒGH�HPcH� GPcG� EPcE� CPcC� APcA� @Pc@� >Pc>� <Pc<� <PƒG<�@PƒG@�CPƒGC�HPƒGH�ÿ/�MTrk���d�ÿY���ÿ!��0P‡0�17P‡7�12P‡2�17P‡7�17PƒG7�5PƒG5�2PƒG2�/PƒG/�0PƒG0�+PƒG+�/PƒG/�0PƒG0�ÿ/�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/data/sample.wav������������������������������������������������0000664�0000000�0000000�00000103764�15135415131�0022367�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������RIFF́‡��WAVEfmt �����"V��D¬����dataȇ��÷ÿ́ÿóÿæÿöÿñÿâÿÍÿ¿ÿÈÿÆÿÍÿÅÿÜÿÓÿ̉ÿäÿæÿâÿÊÿæÿ��1�D�P�9�;�5�Q�S�R�S�M�N�H�?�@�L�@�>�7�3�9�4�(�*�1�����K�‚�W�/��̣ÿøÿøÿ���ơÿ��ÉÿÈÿĂÿÄÿ¼ÿÊÿËÿ¼ÿ̀ÿƯÿäÿ́ÿ́ÿëÿúÿ ��áÿîÿîÿøÿ���øÿ �ÿÿèÿàÿëÿÿÿ₫ÿöÿ��íÿêÿïÿêÿơÿôÿ₫ÿüÿ₫ÿơÿ₫ÿưÿ₫ÿÿÿêÿîÿñÿñÿđÿâÿƯÿăÿ����óÿơÿăÿÜÿÓÿÖÿƯÿđÿ÷ÿíÿ×ÿÜÿÈÿÄÿÔÿºÿĂÿÂÿƠÿ̃ÿÜÿØÿåÿäÿäÿüÿøÿ�ÚÿÛÿçÿđÿøỵ̈ÿáÿçÿưÿ���øỵ̈ỵ̈ÿùÿ�₫ÿûÿ�̣ÿưÿ�÷ÿ́ÿîÿ� � �÷ÿ₫ÿ+�é�{ ±à“îrỏCYmÚ�†��©ÿ‰ÿuÿÿS₫æưáưV₫©₫₫üư$ư³ü·üư’ư)₫¬₫í₫¨₫₫§ưºư:₫ß₫vÿ†ÿ{ÿdÿzÿ¢ÿ³ÿåÿ/�]�p�I� �2�n�°�º�À�§�/�£ÿaÿ½ÿF�ˆ�I�̃ÿqÿ!ÿÿÿÿ2ÿ]ÿÿ₫+₫H₫·₫ÿRÿ̃₫2₫Ûư ₫‘₫�ÿ(ÿÿÿ÷₫ư₫ÿơ₫ ÿdÿÓÿ���₫ÿöÿ�F�w�|�O�\�¦�Ï�Æ�£�”�Ë�́�Ê�‚�i�½�!%Æ�P��ëÿîÿ �&�âÿ²ÿ’ÿtÿvÿ•ÿÛÿÁÿ_ÿù₫Ơ₫å₫5ÿÿ³ÿˆÿ=ÿä₫›₫§₫ä₫(ÿÿƯÿÈÿoÿ@ÿOÿËÿ8�m�T�ÛÿWÿuÿ��•�C�P�Q��öÿ#�l�ª�à�º�L�đÿØÿÎÿ¯ÿéÿ9�r�èÿô₫y₫‹₫ÿ₫…ÿ‹ÿ=ÿÛ₫¬₫ª₫œ₫×₫YÿÓÿºÿwÿ}ÿ‡ÿ|ÿfÿ«ÿâÿûÿ%��¡ÿ.ÿÿ`ÿÿ®ÿ̀ÿ́ÿ¼ÿqÿtÿĐÿ&�Z� �¡ÿ8ÿRÿ¾ÿñÿÚÿơÿ��ơÿ¶ÿ �©�å�±�m��Ëÿöÿ3�®�¹��¥ÿÎÿn�€��¹ÿÿ€ÿ‚ÿÿƠÿ÷ÿ��¾ÿ‰ÿ~ÿ¤ÿ¿ÿ̉ÿûÿ4�H��ûÿ�d�’�i��Çÿ÷ÿ<�•�¨�v��´ÿ¶ÿ¾ÿáÿ��×ÿ‡ÿ ÿâÿ�>�G��äÿÔÿæÿ2�@�0�G�l�d�ưÿyÿSÿ®ÿ<�“�O�¡ÿ'ÿ0ÿ…ÿ̃ÿûÿăÿ•ÿmÿiÿiÿÿ’ÿÚÿ�đÿpÿÎ₫¹₫ÿ¹ÿ�êÿ~ÿÿø₫ ÿ(ÿ,ÿHÿqÿ‚ÿsÿNÿ5ÿ;ÿdÿ²ÿÇÿ}ÿÿó₫;ÿœÿ��ÑÿiÿÿBÿ¤ÿ�`�h��¯ÿ´ÿàÿ��áÿÊÿ¦ÿaÿHÿuÿ¡ÿÄÿºÿwÿ.ÿ,ÿIÿfÿkÿGÿLÿjÿUÿGÿUÿ[ÿoÿ‹ÿÁÿßÿÙÿØÿêÿ₫ÿ�.�Y�Z�H�G�i��É�ô� ă�À��*�D�z�̃�ô�£�:�ÿÿ�n�Ê�å�Ë�”�U�0� �X� �Ø�Ư�Ÿ�V�5�L�¤�ú�5Â�›�¤�Ó�9!ñ�̣�À�£�¦�²�Ö�ñ�Å�j�)�,�X�g�u�l�U�*�øÿéÿưÿ�*�#�Ơÿ¡ÿ­ỵ̈ÿ&��đÿđÿ�B�K�@�Z�…�†�Y�'�0�F�o�ƒ�n�O�F�)��/�G�Y�/����ùÿóÿđÿ÷ÿøÿáÿ¼ÿ­ÿÙÿ₫ÿöÿĐÿ®ÿÜÿ₫ÿ �èÿ±ÿ¤ÿ̀ÿưÿ�Úÿ®ÿ¹ÿôÿ ��äÿ¦ÿ‹ÿ ÿ³ÿÎÿĂÿ»ÿ§ÿ™ÿ®ÿ©ÿ¤ÿ¦ÿ´ÿ½ÿ­ÿÿ›ÿ–ÿ›ÿ¥ÿŸÿÿtÿmÿuÿ“ÿ¤ÿ¦ÿ†ÿVÿIÿLÿfÿVÿYÿ]ÿfÿwÿ†ÿˆÿnÿSÿ7ÿ;ÿJÿhÿÿƒÿ`ÿFÿHÿ`ÿ•ÿ¯ÿÿwÿrÿ„ÿ¾ÿ�₫ÿăÿ×ÿàÿØÿªÿ}ÿvÿ”ÿ²ÿĐÿÀÿ–ÿÿmÿhÿnÿ{ÿ|ÿ}ÿhÿaÿlÿ„ÿmÿ[ÿ@ÿ1ÿEÿÿÿÿÿÿ-ÿGÿMÿiÿ`ÿHÿ:ÿjÿ—ÿ¦ÿÿmÿ–ÿ¤ÿÂÿÄÿ¡ÿ’ÿ¡ÿÉÿăÿÏÿ©ÿŸÿÿ²ÿ½ÿ©ÿyÿoÿŒÿ¶ÿÖÿ±ÿƒÿ~ÿÿ½ÿäÿÚÿ¡ÿƒÿ}ÿƒÿ—ÿ«ÿ®ÿ­ÿ™ÿ”ÿœÿ¢ÿ§ÿ´ÿÛÿ÷ÿ�íÿÙÿ¾ÿ¼ÿïÿ��úÿÅÿ̉ÿçÿ�%� �ØÿÀÿ«ÿ¹ÿÅÿÔÿưÿ ��çÿêÿæÿíÿ �*�J�E�B�4�/�!�@�Q�[�a�9�-�4�<�N�`�Q�:�7�R�^�W�P�S�b�a�n�[�X�s�–�ª�¤�†�^�A�G�`�_�S�-�/�Y�q�t�r�‹�”�œ�œ�“�—�’�«�Í�Ê�¯�•�„�}�’�•�¢�•���;�>�]�q�r�W�F�6�$�/�0�+�.�-�8��øÿ̃ÿ �@�P��­ÿxÿpÿœÿÂÿÁÿ§ÿ†ÿ‡ÿ–ÿ–ÿtÿqÿhÿÿÀÿÂÿ¦ÿÿÿÊÿøÿïÿ¹ÿ ÿ¢ÿÙÿ��đÿàÿøÿ�� �Ùÿ̉ÿØÿóÿ�Øÿ»ÿ¸ÿÍÿÜÿÜÿ¸ÿ‡ÿxÿ’ÿ·ÿ©ÿÿsÿwÿ¡ÿ¼ÿ¢ÿtÿlÿ…ÿĂÿÖÿĂÿ—ÿ…ÿ™ÿÅÿéÿĂÿÿŒÿĂÿ��íÿ·ÿ¦ÿÎÿ��̣ÿ¹ÿ¬ÿ×ÿùÿåÿ¼ÿ•ÿ…ÿĐÿüÿưÿóÿ́ÿøÿ÷ÿ��ëÿéÿ�6�B�L�W�j�’��™�‰��Î�ø� å�µ�Ç�÷�')/ckv7 NxVÔ�Ô�ù�ú�½�…�’��œ�T����]�\��¨ÿeÿ€ÿ¦ÿ©ÿbÿÿü₫₫₫ ÿ+ÿIÿ ÿÚ₫á₫đ₫å₫â₫Ư₫ÿ9ÿQÿCÿ.ÿ:ÿ`ÿ­ÿâÿ��ùÿäÿăÿîÿ�L�n�k�v��‚�•�`�?��2�6�<�-� �ăÿ½ÿ«ÿ|ÿKÿÿº₫…₫w₫p₫O₫üư¼ư£ư…ưyưCư ưÇü¤üËüéüÉü˜üüˆüüºüØüÓüêü#ưgư…ư?ưư$ưmưÛư₫ ₫îưöư8₫¥₫̃₫Ü₫Û₫̣₫ÿ1ÿFÿ9ÿAÿ}ÿÛÿ2�_�Z�V�i�†�¿�ơ�*XÏû C’æ,5<cÓàăơöúơîéÜÆÂ§Z ذ£¥‹CÏq/ ï�á�¹�n�A��̃ÿ¢ÿ~ÿgÿAÿ6ÿÿó₫É₫À₫¦₫Ă₫¶₫•₫₫z₫‡₫Œ₫±₫Ç₫Ù₫Í₫̀₫×₫È₫Ä₫×₫ù₫ ÿ!ÿÿÿø₫ÿÿÿ ÿÿơ₫â₫ú₫̣₫í₫Ó₫₫u₫E₫₫íưÔưÅưœưhư%ư×üüªü²ü¯üüfüOü/üüúûúûüü ü�ü̃ûÔûÜûÜûßûÓû´û’û®ûñûAü]ü4üüü"üQübüeüwü©üËüËü·ü¢üµü(ưÖư¤₫PÿÏÿA�¹�c-j ¹« À * øÙ ÿ g’Öµë ă Vŵ&-  + ; . ß¡"¬e"�ÿÔưüHû₫ùÇø›÷Ơö|öoöjöươRơ}ôàóäó•ôuơönöyöµöP÷!ø ùơùÑú¹ûµüéưÿ2�>¥!Ă“’‡?¤h)ơÓ»[ÆåÍÉ₫bÎ�C�‰ÿ₫ÊưùüKü¦ûû–ú'ú¿ùwùIù1ù:ùFù9ù'ùBù…ù×ù6úvúÊúpûưûTü©ǘü ưNư¢ươưV₫¬₫ÿmÿÿ\ÿ%ÿÿyÿÏÿæÿµÿJÿÎ₫˜₫‘₫¨₫ß₫Â₫K₫‘ưoüYûÉú¿úû;ûĐúêùÎøTø,ùMû×ưiÿWÿ₫/ư₫¾«Å_ÈSl F ¯»ƒ¸WáÚº�ƒS0 N V [ ) Ùq¬^�”₫[ư«üưûáúRù§÷%öơbôÖóYó óẹ̀Ẹ́¤̣ṭ̣Ụ́Póô¸ôgơö ÷@øËùqûĐüÆưQ₫Ç₫‘ÿ ưçPÿ,÷ ƒÄg ­ êöö/ÈT̀åáñ.�&ÿ&₫ưUü¡ûñúGúªùdùVù5ù°øó÷S÷5÷˜÷3øºøôøùưø/ùCùyùôù„ú1ûÊûEü‰üĂüưkưÛư₫₫úưåư₫t₫ø₫7ÿÿo₫”ưÔüiü…ü÷ükưÏưqư„üjû‹ú[ú÷ú&ü)ưÍư₫#₫₫·ÿe`'ù;\ ́ ("=-÷/2†ç¯4  œ ŠΤRÅ)|øÿf₫ăükûöù…øV÷‹ö ö¸ơ2ơoôyó»̣ḥạ̣ộxó!ôÜôơéơ:ö¸ö¤÷ù­ú9ü‘ư₫{ÿ9� fé0CèQµ" ” Û   ₫ ¨ & ‡÷]¢ÈÆ»–´Í�øÿÿçưƠü×ûÓúúwù/ùÿø®øpøø·÷p÷E÷T÷}÷ç÷Høø×ø ù`ù¡ùđù%úú#ûºûZüÚü!ưBưữư ₫,₫J₫₫Đ₫ ÿÿ₫ ₫æưÏưàưËư™ưư…ưpưưDübûưúDû üöüpưlưnư₫Yÿb„j_}L]ƒ G äkY"ê†O¤ă(ĂÛ©|+ ̉ ‰ ˆ „}%€¶û�nÿøư`üÏúù=÷böÜơ ơ!ơJô,óûñ5ñßđFñ\̣†ó<ô*ô²óoóơóBơ÷ øÚù�ûAüưª₫KÿÛÿÜ�™F+n»p\  :  6 ‚  ’ Ö ¸ƠBÍùÆoU˜å�äÿ`₫đüÇûû£úúMùŒøøÜ÷¹÷]÷Ñö„ö”ö÷¢÷ ø5ø:øBøøù‹ùúú1ûØû_ü§ü¸üºüåüaư ₫“₫Í₫ñ₫ư₫ï₫º₫d₫/₫>₫p₫¬₫ä₫œ₫₫uưữü”üXü!üđûßûêû÷ûüLü¾üư»₫&�¯^̃å[‹í ' Ñ p­ ăgyi^I È ” @ ÷*®9¦�ÿLưeûĂùøÚö̃ơ:ơ¹ô3ôọ́•ñØđ™đàđ¥ñ‹̣hóëóô$ôeô"ơpöøµùû\ü«ưÔ₫¯ÿ{�Y“7üpJ§ëm  ´ ç Ï ‡ N * Ñ 9 n€|q'êåp�‹ÿ\₫ĐücûMúù0ùÚøjøø¥÷÷¸öDöö=ö©ö÷J÷p÷b÷£÷ư÷oøíøqùú·úXûÈûèûü‰ü)ưäưw₫Æ₫ß₫Ø₫ñ₫ÿCÿ:ÿ-ÿÿâ₫Ç₫¡₫u₫C₫₫¶ưEư×üü?üüÛû²û¬û·ûü”ü(ưàưÂ₫�¬‚ưFS¡çI  ʾÈߦf¦­ Œg/    _ ß %˜à�+ÿ˜ưüúÙø[÷Bö¨ơMơơ|ô^ó8̣ñṇ̃˜̣ự$ó3ó°ó„ô»ơíö•÷XøYù™úüvưÛ₫?�œÆÆ’GHœ < ç ó ´ | h s ‡ m $ ­%ñ½è!AF�/ÿ#₫ưüưúúWù¯ø<øøÙ÷‹÷>÷êö̀ö̀öƯö ÷P÷§÷øyø¹øäøù}ù(úûØûHüvü„üËühư₫Ă₫2ÿUÿaÿÿ²ÿ­ÿœÿÿÿ ÿ°ÿÿ(ÿ‘₫!₫âưâưÀư`ửü5üÜûÄûưû%ü1ü[ü�ư×ư¹₫×ÿ#¸U²W…„Vc  ¼]¡Ǿ“øbP.÷ Ö ³ ˜ „DÑHÅ+ÿ5₫»ü#ûoù̀÷öÆơOơ*ơÆô ôó́ñ@ñ5ñØñ¼̣kóÂó¦ó¡óøó¾ôö†÷¹øĐùûYü¬ưÙ₫éÿV¯/Ú³ g ̀ Ö ´ ‡ t J ß _ £Ü1𻦫�¼ÿă₫ÖưÏüÍûÙúú‰ùđøkøï÷¨÷y÷:÷ ÷áöÎöúöT÷¸÷ø6ø[øÄø7ù¶ùJúÊúqû>üñüTưwư‘ựư₫cÿ�a��‚�O��ăÿ̃ÿ�W�9�¾ÿ0ÿĂ₫„₫{₫N₫�₫…ưåüAü²ûyûûåû@ü]üBü=üüữ₫—�:ƒ|Ơó<× N Ù Zî + ½  ̉ ³6 ª Ê đ    ưÙŸI º{�@ÿ)₫ëüQû›ùø#÷“ö^ö6ö¦ơ³ôÈóóœ̣Ỵ̈ỰZóîó†ôơˆơåơ?ö̉ö‰÷Äø4ú²ûûüúưî₫đÿ Uh§C03ôdm4ë®Y�œ!§ gf1ûÿÿq₫ÑưưƒüÍû$ûzúúØùtùNùiùhùFù7ùtùơù_úú¬úÚúöú…û9ü¡ü ư]ư¶ư1₫Ï₫™ÿ�#�ƠÿÙÿa�lD*_̃°íƒ»[ó©´¹�M�t�â�Ư�:�kÿù₫ä₫�ÿÿÜ₫₫=₫"₫>₫†₫·₫Ñ₫Ö₫ü₫;ÿ¡ÿ/�ü�° PO>\ذ¤éÙ™x—é<[1Ô~[S´ Q±>Ú,[�qÿ¡₫₫«ưeưçü`ü¾ûRû9ûYûû¦ûÄûµûÁû×ûüRüŒü§üÖüñüưüHư•ưñư6₫k₫—₫¼₫Ù₫ư₫7ÿ_ÿ–ÿ̉ÿ₫ÿ"�D�M�]�u�w�§�Ê�Í�È�̉�Ô�Ö�É�·�Á�Ă�Æ�®�œ�e�3�-�+�&���îÿâÿÀÿ¼ÿ¶ÿ™ÿˆÿ€ÿˆÿŸÿ£ÿ¦ÿÿ—ÿ²ÿ¿ÿÈÿÓÿÙÿ½ÿ»ÿđÿ ��.�%�0�+�+�0�,�&�����úÿùÿæÿËÿ»ÿºÿ¿ÿ²ÿ¨ÿÿÿcÿJÿ2ÿ$ÿ ÿó₫é₫Ú₫Û₫Ư₫Û₫Ñ₫ß₫è₫à₫½₫­₫¶₫¡₫§₫¬₫»₫Ç₫Ï₫á₫đ₫û₫ü₫ÿ9ÿdÿÿÉÿ÷ÿ'�s�¶�ß�́�í�ñ�=zºÚÖ·¨©®¬`2%ó�Ü�Ä�¨�œ�n�\�<��øÿèỵ̈ÿéÿéÿƯÿ´ÿ„ÿzÿqÿ|ÿvÿpÿQÿ4ÿ>ÿ>ÿCÿÿÿÿ÷₫ê₫̣₫ÿÿÿ!ÿ!ÿÿÿ$ÿ&ÿ'ÿ#ÿ6ÿ7ÿAÿcÿ~ÿ~ÿ”ÿ¡ÿ£ÿ°ÿªÿ¸ÿ¹ÿÁÿÍÿÜÿëÿóÿ����+�-�.�/�'�7�8�F�T�T�X�f�c�\�c�F�8�:�G�M�P�G�Q�Q�>�@�+�M�¢�–�\�B�4�����ùÿçÿÖÿ»ÿ·ÿ ÿˆÿ„ÿÿ†ÿyÿwÿeÿNÿTÿAÿ6ÿ&ÿ#ÿÿÿ,ÿü₫ó₫ô₫�ÿÿÿÿÿ ÿ&ÿ'ÿÿ ÿÿ ÿÿ2ÿ?ÿUÿLÿKÿTÿ]ÿxÿ{ÿ•ÿ ÿ¥ÿºÿÄÿÅÿáÿ�*�P�k�j�j�{��œ�¼�«�®�¸�Ë�à�Ư�³�“�˜�®�Ó�̃�Ơ�»�°���™��‰�l�W�C�L�)�%��ëÿæÿåÿçÿØÿƯÿăÿèÿíÿ́ÿôÿđÿäÿàÿÔÿÜÿäÿåÿơÿưÿåÿÙÿ¿ÿ°ÿ¥ÿ¹ÿÀÿºÿËÿ×ÿÚÿâÿÙÿÎÿƯÿØÿàÿóÿ �đÿ́ÿưÿ �+�/�)�+��"�+�/�;�T�O�X�Y�E�K�C�,� ��éÿêÿ�*�.�.�/�4�L�G�Y�M�L�U�Z�U�T�b�_�W�U�\�c�P�R�Y�8�$�.�0�4�5�C�1�!�%� �%��"�#�"� �Úÿ©ÿ^ÿYÿYÿmÿ~ÿpÿ_ÿ(ÿÿÿ₫ÿ7ÿBÿAÿ ÿ�ÿú₫ÿ?ÿ=ÿ ÿÿư₫ÿÿDÿZÿYÿTÿ@ÿFÿNÿhÿƒÿœÿ–ÿ’ÿªÿ¸ÿÖÿêÿưÿóÿ���$�:�8�I�@�?�P�s�x��ˆ�„�‚�\�i�Œ�¶�Ê�×�Đ�¾�¬�‹��Œ�­�®�–��p�ƒ�~�Œ�u�o�a�Q�G�/��íÿØÿ̀ÿĐÿÈÿ¿ÿ˜ÿ|ÿvÿqÿqÿ‡ÿ¦ÿ®ÿŸÿ…ÿqÿbÿPÿMÿgÿ†ÿÿ‘ÿiÿNÿAÿTÿ}ÿÿÁÿêÿ� ���öÿôÿ�:�D�9�7�>�<�f�‡�“�¤�¬�­�®�À�Ï�ú�(å�½�¦�«�‡�b�(�øÿÛÿêÿ%�<���ˆÿBÿ5ÿgÿÉÿ �)��«ÿ(ÿ)ÿ7ÿ_ÿOÿ́₫₫Q₫|₫Ơ₫ÿå₫–₫I₫2₫}₫¯₫´₫z₫a₫q₫₫ÿTÿTÿß₫D₫íưÈư₫Ơ₫.ÿÿ¯₫C₫0₫[₫Î₫+ÿ*ÿ̃₫£₫x₫₫Å₫ ÿ>ÿSÿPÿKÿiÿhÿhÿgÿfÿlÿÿ´ÿÜÿ́ÿ́ÿ�)�n�»�ù�+%:Ü4kyM% &mŸ¥c?'ûÀ†w`>ù�Æ�ˆ�>���₫ÿßÿ³ÿZÿ÷₫₫₫¬₫ơ₫ÿ̉₫q₫₫æưöư+₫e₫₫–₫™₫ˆ₫m₫j₫’₫Đ₫ÿ„ÿÅÿ·ÿsÿHÿtÿĐÿ[�¬�Ă�‡�3��%��°�º��Q�/�G�5�!�₫ÿ×ÿ·ÿ¢ÿÚÿ���vÿê₫Ê₫Ơ₫ÿÿ¹ÿ[ÿî₫¥₫₫̀₫Bÿ‰ÿzÿ0ÿ†₫-₫E₫æ₫”ÿµÿEÿ¾₫”₫®₫Ù₫Ö₫º₫a₫/₫d₫§₫Û₫Í₫µ₫²₫«₫‡₫t₫r₫µ₫WÿÉÿĂÿ$ÿ|₫f₫̀₫pÿ�)�·ÿđ₫j₫m₫Å₫ÿÿú₫ê₫×₫ó₫ü₫Ï₫Œ₫Y₫3₫^₫á₫hÿ³ÿ©ÿÿKÿeÿÉÿ[�ŒÊÀ̉NJ¬ñ•aoadQu¸.̀… ~îSÑ@¥Ö���9ÿŒ₫ÿưưäü+ürûåú·úÂúüúû ûÆúHúüùúœújûzü|ưU₫Ç₫‚₫Øưưâü‘ưÿ₫«�Шÿ�Ê�¬U«±wF=c¿ạ̈¤<¿,¸�_�.��C�U�G�Êÿÿ4₫‡ưSưsưÓư₫₫±ưVư+ư-ư]ưzư¨ưŸưtưDưiưäưz₫ñ₫'ÿ%ÿÑ₫{₫ ₫ÙưíưV₫Ô₫̣₫¸₫I₫₫₫₫Ö₫Í₫<₫Öưtư@ư”ưáư₫Úư‰ưXưLư2ưËü?üûJû´ûWüäüư‘ü¾ûûÜúEûæûiü±ü´üwü`ügüƯüÛưÜ₫̃ÿ«�Kç¼ÈC ôÈ ç < á w r h ï\lj' Ø Ă í ơëϦM̀;‘ÿ₫çü�üúúªù%ø¨ö]ơ¤ô‘ôÉô:ơ ơ»ơ„ơAơơ-ơÔơßöZøúøûßư”ÿÀ� “�̉ÿ§ÿ‰�”Uuqé5ÎÅà̉ Fú¶nÙôñ"�ÿúưư`ü>üƒüÊüxü¦ûEú̉øè÷Ï÷~øùtúóú'û<û=ûOû\û‹ûÓûeüBư^₫Pÿ��^�k�q�…�¡�´�°�e�æÿÿ<ÿÿ%ÿ.ÿ́₫‰₫Ïư ưTüŸû û™ú€úµúûmûkûïúúùSø.ø‰ø#ù›ùùùÜùœù¤ùºùäùøùú"ú?ú™úBû'ü3ưI₫iÿ§�öo 3F  Ơ�8·“• @�‘QƠ Ư l å¾8Ó �°ưû…øöKơ@ôọ̈/ñMïÚípíî.ïKđñEñ2ñGñèñ óËỗö÷ø=ûˆư¢ÿL˜[À%¿ÉP ư y p § W — ¹ ¹ ¯ ²¾#¹VÁÍ_¤Üÿ=₫ăüÄûâúúoùùóøâø¬øJø§÷ôöWö9ö‰ö_÷[øvù ú‘ûbüçüIưjưsư¿ư`₫aÿˆ�´§T“Ś›'È�Q�ØÿRÿ”₫ÆưÖüübûƯúQú¥ùâøø­÷÷É÷øøü÷È÷x÷9÷ ÷÷/÷|÷ ø°øŒù=ú¬úÆú€úAú@ú¯ú£û ư¾₫â�À/–ö§â å R‡•äÍ2l9[ËgO•₫=Â_Î  p ó!�•ưú–ö¦óâññođgïÓí'́ëüêâëRí¨î ï*đ¶đ–ñỤ̂aô öú÷úü%ÿêfhm Ä  d KÁ¤@>¾ßÇ í ¯ swÙ‘kQ�NÿW₫Tư'üËúùr÷EöÛơörö¸öÆö©öö̉öE÷ß÷[ø¿ø(ù½ùú§ûĂüÎư¯₫Yÿ�¡�#€Âû;¹X ŸSŸÍb²��Wÿs₫€ư–ü±ûáúúùsø ǿ÷̉÷}÷ëö?öÑơ¨ơçơQöÁö ÷>÷9÷Q÷÷û÷²ø}ùú´úAûûüwüÑüdưC₫”ÿ#Ö‡,º€ è »ËD“Ú¾Voư.oƯ£)Q0 �Î'àÿ~₫ƒüÖù́ö,ộ†đKï9îíôëcëvëT́‰íÙîđñ ̣;ó‡ỗơZ÷ ù ûbư₫ÿ¾L*l? Ü Ê  ̣Ïđl£¤ u  À ³Å̉z¾À¾ÿơư‹ü‚û™úÁù¾ø­÷»ö öîơơơöö7öwöáö^÷î÷xøù¯ùú«û¿üÁư₫÷₫ZÿĐÿˆ�9Ó3‚ÁôO¥×̉¦+–̉�̣ÿÿ1₫mư±üúû ûú<ùœø<ø�øă÷Ÿ÷3÷±öOö$ö-öcö²ö÷Œ÷ø÷Høøyø{ø—øĐøoùKú3ûüû¨üơü�ư(ư{ư!₫&ÿ¢�Z:öï  Ÿwé˜vbÇjº®ë 6Ïơg�•ÿ•₫ñülú]÷]ộYđ1ï îú́áëUëxëq́̉íï,đ ṇ̃[óçô‚öø“ù:ûPư­ÿbæ÷¦ë  ú ï ” s¦Â½a d  ^!ÁH˜̣�iÿ₫Ûü´û¦ú ùœø¹÷÷›ö6ö ööơöWöööº÷løçø2ù˜ùúăúÚû̃ü±ư…₫Vÿ�º�8«₫Q³/‰À߸zÓr¢W�zÿ–₫Àưæüüû<úfù«ø&ø¿÷•÷z÷€÷e÷÷®öCöö>öÏö÷_øÙøùVù\ùpù“ùäùZúû¼û‘üư^ưwư„ư©ưôư±₫¸ÿ0éɳWÙ € x ¹$ǘº te¹sˆâ±/Î ßÅC›�„ÿ|₫ùüÈú>øœơóíñÀđ­ï”î̀íjí—í|î³ï¹đ¨ñ‘̣¦óçôVö̃÷MùÄú\ü3₫G�z²äÔq Ó ¾ 2  m Å m « 3 § ® % ̣ T {£äC�ÿ₫₫³ưư ü·újùnø¯÷,÷�÷÷÷^÷á÷øDù×ùNú§ú̃ú ûkû÷û–üYư#₫ ÿóÿË�mÆÄgMrÍ0v¨£‹3¨ 4�Iÿn₫¶ưưüülû½úúlùÓø€ø@øô÷¬÷E÷÷÷Y÷Í÷8ø„øøø©øÉø₫øLù̀ùtúû¹ûülüüü—ü¢üư³ư´₫Æÿü�FÏi» ̣ |îºnM¬À°øúWƠß D 1GÆ₫�·ÿ¡₫ựúiøêơáóỤ(ñóï¿îÈíFíhí%î4ïIđ,ñđñỊ̈Øóơ»ö{øîùgûAư}ÿæ=HÇ®K    ]  k ¯ m { t   ¦ „¦@´ÿ}₫™ưûü~ü̉ûÑú‹ùGøh÷÷H÷°÷û÷2ø\øø�ù¤ù4ú«úơúaûöûĂü®ư₫=ÿÉÿ9�°�NæFnI G¤Öuî~û�_�†ÿ®₫øưaưÖüsụ̈û4û^ú‹ùùöøù÷øÈøpøø øøRø{ø°øíø%ùSùœùúEúlú‰ú̀ú^ûü¯üư₫üƠüƯü&ưÅư₫gÿ'�ü�%ªXöyû ¢ “ À—±È:·¡R_&3n—o M «ßb“L�,ÿëưüÊùk÷xơôÇ̣›ñKđ7ï²îÄîcïMđ8ñøñ£̣Zó-ôơYö¸÷7ùƯú¿ü¥₫†�XÉơ ă W ” >  t » ¼ ; 2 Û^́’]Gd�“ÿè₫n₫ÜưưÙûúOù€ø!øø=øbø„ø³øôøGù¯ùưù+ú0ú^úăúû‹ü†ưm₫%ÿµÿ1�¤�ÿ�Ex„ºúQj2É0©|�Îÿ:ÿ¤₫₫£ư*ư¸üühû·ú$ú°ùùlùJù8ù(ù;ùRù‹ùĐùøùú úú(úqú°úđú%ûcûÅû(ü¢üüü4ư#ưôüÚüØü"ư•ưW₫ÿæÿÄ�́5t“©è\ C Y 4Q¸ z(”6è –  5  8Ϫ�bÿºư¹û°ùÑ÷eöHơqô•ó¿̣₫ñyñrñÓñ|̣$ó£óô–ôBơ5öa÷¸ø&ú‚ûÙüB₫Æÿ€T̃Í́‡Ø_r " ä & dƒt…ÉZ2ƠĂÿt₫]ư’üü¦û$û•úúßùîùúú×ù§ùIùùcùéù–úGûîû–ü>ưØư^₫̉₫5ÿaÿÿ́ÿd�²#xe9è”I¨�@�óÿ¥ÿsÿAÿ ÿ¢₫#₫ưưü3üüüéûÏûÛûñû üü¼ûxûVûWû{û̃û^üÇü ưư÷ü»ü¡üºü ưeư»ư ₫5₫=₫:₫A₫q₫º₫Û₫ÿ₫ÿ3ÿ[ÿ«ÿ�§�QÑXÑ× | » ¢ Ú ”  µ Ñ m B × ù t l s^@�áÛư:S�?ÿ₫Îüªû¬ú̉ù!ùoø×÷b÷÷âö́ö4÷“÷é÷"ø#øGø´ø]ùHúRû]ü‚ư®₫Êÿ†�Í�‚�́ÿ̉ÿC�aẤ²ÿÄ@¿_6ç»d?40 À+h�Ÿÿç₫e₫ûưÁư­ư­ư«ưư‡ưqư@ư ưÆünü6üü_üîü…ư ₫n₫¢₫p₫*₫çưêư/₫₫ÿ}ÿäÿ>�{�p�(�¬ÿQÿ.ÿ_ÿÓÿO�Ë�û�é�}�'�ûÿíÿ�+�B�A��ăÿ¨ÿ~ÿlÿ†ÿ¼ÿäÿ� �ºÿTÿÿÙ₫í₫>ÿ™ÿ¬ÿ™ÿ‹ÿ¡ÿ¥ÿ¢ÿaÿư₫º₫Ë₫3ÿ£ÿ �6��Îÿiÿ#ÿ1ÿnÿºÿ�$�$�<�W�j�l�G� �Óÿ¾ÿÙÿđÿ4�^�U�B��éÿíÿ+�}�í�I¤¬¼µØë'9AZf}“xLØ¡cC0ö�Æ�~�=��íÿÜÿÄÿ´ÿÿWÿ!ÿÿÿ ÿÿ(ÿ&ÿÿÿà₫ë₫â₫÷₫ÿÿ#ÿ÷₫Ó₫¾₫®₫Û₫\ÿxÿWÿMÿ3ÿ"ÿ+ÿMÿ|ÿ£ÿÿ–ÿ–ÿoÿzÿ¢ÿÓÿ�1�?�U�T�J�D�@�N�Z�g�]�}�W�!������� �� �÷ÿ÷ÿùỵ̈ÿüÿîÿăÿÛÿÔÿ̉ÿ·ÿ¼ÿ»ÿÁÿ°ÿ±ÿ´ÿ±ÿ¼ÿµÿ«ÿ­ÿ´ÿµÿ¿ÿ³ÿ¬ÿ°ÿ­ÿËÿåÿƯÿÛÿÓÿÅÿáÿáÿÚÿÓÿ×ÿÖÿØÿíÿïÿƯÿÉÿÄÿÄÿÊÿ»ÿ³ÿ·ÿ¤ÿ§ÿœÿªÿ¤ÿ„ÿiÿbÿyÿ[ÿJÿZÿQÿPÿ<ÿ#ÿÿÿ*ÿZÿRÿGÿ?ÿFÿ=ÿ8ÿQÿKÿKÿSÿUÿRÿbÿ[ÿ`ÿzÿƒÿÿ¢ÿ—ÿ‘ÿÿ¤ÿ«ÿ½ÿ¸ÿ½ÿÀÿÏÿçỵ̈ÿÙÿƠÿóÿ� ���!�/�6�D�C�7�8�/�-�-�#��/�,�<�b�g�t�}�…�r�o��p��…�„�ˆ�z�Z�c�f�o��€�˜�z�j�”��—�©�¥��Œ�v�i�Z�R�5�3�;�5�.�.�-��øÿ×ÿÜÿäÿèÿåÿ̃ÿÓÿºÿ²ÿ²ÿ½ÿ±ÿ§ÿµÿ³ÿµÿªÿ¯ÿÎÿÛÿ̃ÿæÿêÿôÿóÿóÿưÿóÿ���!�'�>�>�0�:�?�I�D�N�D�G�<�'�-��� � � �ïÿàÿÓÿËÿ·ÿºÿ³ÿ­ÿ¯ÿ­ÿ¨ÿ£ÿªÿ¤ÿÿŒÿ–ÿ”ÿÿ~ÿŒÿ™ÿ‹ÿ‘ÿ‘ÿ“ÿ…ÿ¢ÿ¡ÿ¡ÿ£ÿ¡ÿ¢ÿœÿ¥ÿªÿ·ÿ­ÿŸÿÿ‹ÿˆÿ‚ÿ—ÿ›ÿÿƒÿÿÿ§ÿ§ÿ°ÿ³ÿ—ÿ¢ÿÿÿ™ÿ©ÿ«ÿ´ÿÔÿÜÿàÿÊÿÚÿèÿéÿăÿæÿôÿîÿ₫ÿÿÿüÿ�����ÿÿ �������������� �ùÿíÿ́ỵ̈ÿ� �üÿ�� ��)�-�#�ƒ�—�k�T�?�$����.�2�&�.�!� ����� �����öÿíÿơÿçÿèÿÚÿöÿÜÿ·ÿÄÿÂÿ̀ÿºÿ¸ÿ¹ÿÍÿàÿäÿÛÿËÿÄÿÄÿƯÿÔÿăÿæÿëÿçÿøÿúÿ� � �$�$�'�� ����ưÿ��öÿèÿ×ÿáÿàÿåÿÜÿ½ÿ³ÿÿ¸ÿªÿ›ÿŸÿ ÿ£ÿÿ«ÿ­ÿ¨ÿÿ‚ÿÿ‘ÿ‰ÿÿ“ÿ•ÿ¥ÿ ÿ—ÿˆÿ€ÿxÿ‰ÿ›ÿÿƒÿ}ÿ—ÿ ÿœÿ—ÿÿ•ÿ›ÿ¤ÿ”ÿÿ‹ÿƒÿ‚ÿŒÿÿ„ÿ|ÿuÿtÿƒÿÿ€ÿÿŸÿ¸ÿÄÿÎÿÓÿ¸ÿÎÿ×ÿ̀ÿÆÿÀÿ¼ÿÁÿÂÿÀÿÉÿ³ÿ»ÿÀÿÂÿ̉ÿÅÿÍÿåÿâÿ̃ÿëÿÔÿ½ÿµÿ¿ÿ»ÿÁÿ¹ÿ ÿ¬ÿ±ÿ°ÿÁÿÇÿÇÿ²ÿÁÿ¨ÿ°ÿ°ÿ¡ÿ¤ÿªÿ©ÿ¬ÿ¯ÿ®ÿÀÿ̀ÿÈÿ±ÿ®ÿ½ÿœÿ~ÿÿ¶ÿ±ÿ¾ÿÅÿÍÿ¼ÿÉÿÙÿËÿÔÿÏÿăÿÎÿÆÿÂÿÑÿéÿÜÿÊÿ±ÿ°ÿ°ÿÀÿ¶ÿ´ÿÆÿĐÿÆÿÆÿÆÿ ÿ–ÿÿ¨ÿ³ÿÇÿËÿØÿđÿúÿ�ùÿ�₫ÿúÿôÿøÿèÿåÿ ��+�1�9�P�>�H�@�<�=�7�.�.�5�1�1�+�3�8�5�)�%�+��� ��ôÿùÿéÿçÿèÿéÿéÿơỵ̈ÿÚÿáÿÈÿÙÿÑÿÊÿÊÿĐÿ̉ÿ¼ÿƠÿÓÿÔÿÏÿÖÿßÿéÿ̃ÿÍÿÙÿàÿ×ÿÂÿÔÿÚÿÉÿÛÿÎÿÑÿ̃ÿîÿêÿåÿêÿ��� � �� �����úÿ�öÿ��� ������ �̣ÿèÿơÿđÿËÿ±ÿ½ÿ¸ÿ¯ÿ¨ÿÿ¤ÿ¶ÿÁÿÆÿÄÿÂÿÁÿ¸ÿ¾ÿ¸ÿĂÿÄÿÍÿƯÿèÿĐÿÓÿóÿăÿâÿéÿÿÿ₫ÿ�`�‹�c�=��óÿßÿßÿáÿúÿ��ưÿ�úÿ̃ÿäÿáÿùÿàÿƠÿæÿƯÿäÿÜÿØÿæÿíÿúÿøÿ �ÿÿÉÿºÿÇÿËÿÎÿàÿáÿơÿûÿơÿàÿØÿ̀ÿÖÿÜÿăÿíÿ̃ÿßÿÔÿƯÿáÿêÿêÿëÿêÿáÿéÿơÿûÿ́ÿ́ỵ̈ÿ������ÿÿ,�*���ïÿøÿøÿóÿàÿéÿăÿîÿóÿóÿ����1�!����� � �ÿÿÿÿëÿñÿúÿ��ưÿ �,��œ•åä�6ÿu₫q₫ ÿĂÿ%� �‚ÿÛ₫v₫₫ÿ©ÿ�'�íÿ˜ÿdÿvÿ¼ÿ%�z�{�G�åÿ’ÿ~ÿÅÿ �z�©�q��Îÿ¡ÿ©ÿÜÿ$�M�F� �Úÿ½ÿ¼ÿƠÿ �%��áÿqÿGÿQÿnÿ©ÿÇÿÔÿÍÿ¸ÿÿ“ÿ¡ÿµÿĂÿÔÿÍÿ¿ÿ¯ÿÿ˜ÿ¨ÿÎÿƯÿ×ÿ̀ÿ¥ÿKÿHÿ`ÿ{ÿ§ÿÈÿêÿăÿêÿ́ÿúÿ₫ÿÿÿ �ưÿùÿ��0�H�J�*��ÿÿüÿúÿóÿ₫ÿ'�¥�©¾YÚQÿŸ₫ă₫��D¥ü��ÿîÿ K¸.ù�¨ÿÿ€ÿo� è�đÿ˜₫¯ưmư¸ư₫?₫₫¶ưyưưàưy₫ö₫ÿ̀₫a₫:₫c₫¼₫!ÿbÿÿªÿØÿôÿçÿ¯ÿiÿJÿyÿºÿ�A�=�3��ƯÿËÿ̃ỵ̈ÿ̃ÿ®ÿˆÿ]ÿAÿPÿ[ÿpÿ†ÿ¥ÿœÿQÿå₫n₫N₫[₫ª₫-ÿZÿÿ´₫­₫0ÿD�4¢îÿÿơ₫0ÿnÿoÿ ÿ₫m₫^₫‡₫×₫ß₫•₫₫Ëươư–₫}ÿ^�́�¢�̃ÿmÿàÿ8˜ä2¢7Â2@b§[&å˜ �/ÿDÿ�…��¯₫Gửü‡ưè₫ÙÿÙÿù₫×ưˆưA₫mÿ¾�ø�¬ÿ«₫~₫ÿăÿ’�î�ô�ú�ư�§�3�,��júÔç�«ÿé₫�ÿ�;^”�XÿF₫₫©₫¥ÿV�'�qÿ´₫µ₫1ÿ¨ÿåÿŸÿZÿVÿÿ�e�K�ûÿ®ÿÚÿ_�Ø�¼�üÿ'ÿê₫‚ÿM�Å� ��vÿ1ÿkÿĂÿ�âÿeÿí₫Ñ₫ÿ\ÿ`ÿ?ÿPÿuÿÿÿ@ÿî₫è₫+ÿ‘ÿåÿÜÿÿ‰ÿ—ÿ´ÿËÿÂÿ¢ÿƒÿÿ°ÿÆÿŸÿFÿ5ÿPÿ}ÿœÿ ÿ~ÿBÿ-ÿ ÿê₫Ä₫Ë₫è₫"ÿGÿ<ÿÿÍ₫·₫ß₫^ÿ�Ö�‚¨,U�“ÿKÿÿ!�¦�Ó�‰��¹ÿÿ“ÿŸÿŒÿ8ÿ̃₫›₫|₫v₫Œ₫º₫+ÿ…ÿàÿ"��¾ÿFÿ$ÿ\ÿƯÿd��³�˜�m�x�±�¹�–�w�€�®�¿�¨�Œ�†�†�Û�"7 ¨�/�îÿ�w�¿�«�Î�Ñ��I�åÿ½ÿËÿ�?�7� �îÿáÿ×ÿÚÿÓÿßÿäÿÑÿÀÿ–ÿsÿqÿ™ÿ̃ÿ$�L�Q��Ûÿ¶ÿ§ÿ²ÿÅÿ₫ÿ�üÿßÿĐÿ̃ÿĂÿ†ÿaÿeÿÿ¬ÿÊÿƠÿ»ÿƯÿ� �&� �ñÿÖÿßÿ́ÿüÿ�%�/�5�E�6�.��éÿÜÿçÿôÿơÿëÿ̃ÿîÿ�O�m�n�X�.��óÿèÿ�,�A�:�#��ÿÿ�/�;�1�)��ôÿÜÿĂÿ¿ÿƯÿíÿ �óÿåÿ¶ÿxÿoÿqÿŸÿƯÿöÿóÿ���úÿüÿ�7�R�{�z��D�� ��C�m�ƒ�o�T�.�&�,�7�:��íÿîÿ����₫ÿØÿ°ÿ°ÿ¾ÿ̀ÿáÿåÿïỵ̈ÿơÿáÿƠÿæÿæÿøÿøÿ÷ÿưÿ ��Üÿåÿ�!��� �(��¨’Pï�Ë�¾�x�R�K�A�/�ùÿ¼ÿwÿTÿÿ ÿ3ÿGÿuÿdÿVÿTÿ|ÿØÿ�O�r�e�?� �̣ÿÍÿƠÿ ��"��ùÿÑÿµÿ´ÿ¹ÿ̉ÿåÿÛÿÔÿåÿéÿ�C�l��j�†�¨�¡�‰�I�)�#�L�p�o�K��Êÿ‚ÿ7ÿÿ$ÿÿÿù₫ÿCÿXÿ`ÿ?ÿIÿjÿºÿßÿËÿ¨ÿ•ÿ›ÿ¤ÿĐÿêÿùÿÙÿ¡ÿmÿ_ÿiÿqÿpÿgÿhÿrÿ‰ÿ~ÿDÿ'ÿ.ÿBÿ@ÿ@ÿNÿiÿRÿ9ÿ6ÿÿÿđ₫̉₫°₫¯₫Ô₫ÿÿ÷₫ơ₫í₫�ÿô₫ö₫ÿ7ÿ{ÿÏÿ �$�H�Q�e�v�Ÿ�Ñ�¹�†�>�������%��̣ÿ¿ÿnÿOÿIÿ~ÿ�ñ�®Î:7�…ÿ'ÿ-ÿsÿÁÿ�p��b�æÿjÿÿÚ₫Ï₫æ₫&ÿQÿ5ÿÿÿsÿæÿX�—�€�0�ưÿäÿ©ÿËÿ1� �+ù��)�ÇÿÿwÿªÿÆÿÚÿèÿđÿ��-�*��íÿÆÿ£ÿ£ÿÚÿ�]�›�µ�™�c��äÿÎÿÍÿƯÿ×ÿáÿ%�\�n�i�g�\�/�!��₫ÿ-�U�|�­�đ� "ü�£�r�k�y�œ�Ê�ë�đ�¾�‘�f�O�8�7�D�I�n�›�°�†�<�éÿ—ÿKÿ5ÿ=ÿ4ÿKÿjÿ—ÿ§ÿ±ÿ¤ÿnÿ/ÿư₫Ö₫Ä₫Ư₫ù₫&ÿ3ÿ&ÿÿÿù₫¶₫}₫F₫.₫7₫e₫†₫‹₫ƒ₫|₫w₫P₫@₫₫öưăưàư₫O₫x₫ƒ₫s₫f₫’₫Ä₫̣₫*ÿDÿ^ÿdÿKÿÿµ₫₫Ÿ₫̉₫ÿRÿCÿÿÉ₫¤₫‘₫|₫h₫P₫₫â₫Rÿ²ÿÜÿèÿ½ÿ©ÿ¡ÿÅÿưÿX�„�–�|�J��æÿ�e�LàyưAx�r��đ�ê�Ë�ƒ��Ơÿ·ÿÿŒÿ‡ÿ•ÿ|ÿ*ÿ×₫ä₫‘ÿŸ�Pl$ü�×�Î�ă�z¨à*HL@IêbˆuX‹²Àsü™ƒë|ë�Ê��C�Úÿiÿç₫x₫4₫₫óứưöư₫,₫B₫l₫„₫‰₫r₫c₫V₫G₫`₫a₫c₫{₫¯₫º₫–₫d₫)₫ñưàứư ₫%₫#₫0₫I₫g₫r₫^₫M₫*₫ùưØưçư₫óưóư ₫,₫1₫₫Îư¨ưư–ư“ưzưBưư/ư6ư3ư;ưAưUưWưZưTưSưGưdư’ưµưäư₫0₫=₫W₫8₫�₫¦ư7ưûüíüïüØüÉü²ü™üxüaügüLü2üüøû ü3üLüeüuü†üŒüsü'üñûüaü“ư�Ô… OÛƯbR­-ÙHÆÙ á … ˜Hÿjü¸ùƯ÷C÷½÷ˆøùù¿ø\øøø"ø[øùeú üÇư(ÿ�å�™j‘¬XÎÑÄ›øÙ#g8e$yne�³ÿ/ÿ}₫ưư₫d₫§₫f₫¢ưËüGü5ü̃üÁư_₫Á₫À₫ª₫₫́₫iÿ­ÿ��V�™�p�óÿeÿÿÿ3ÿeÿJÿơ₫{₫₫”ưsư‚ưư¢ư¼ưÜưæưÎưưtư†ư¾ư₫Z₫f₫:₫₫ÛưÀư ưjư5ưúü¯üsüCü/ü8üXüÈü3ưoưqư4ưëüÆüâü#ưwưŸưÏư₫₫₫øư•ưư©üü{ûåúzú3úôùàùÜùåùØù¾ù¬ù³ùÈùëù*úwúGû›üs₫»�=˼F \‡ OM­¨âÔ‘à N ægIÿùü ûùÖö́ổóÈó’ô/ơcơmơ’ơ öÑöË÷Åøçùrû^ư‡ÿ‰ü Ø D£³Vü¨i xÍ…ª¦�¡ÿµ₫óư‚ưJư5ưSưưÏưÛưàưÄư°ưµưçưZ₫Ü₫mÿíÿZ�§�å�ă�È�²��n�/�ùÿÆÿœÿxÿBỵ̈₫‘₫3₫ïư¢ư1ưëüËüÇüÿüIưư©ưÑưÍưëưîươư₫F₫v₫±₫ÿÿ!ÿÿÿÿ�ÿ̉₫“₫X₫ ₫âư¿ư’ư?ưêü¸üoü"üÑû‹û€ûûµûÊû®û¤û¡ûû¯û¬ûÀûÇûÖûÎû°û‹û_ûAû(ûû±úGú¹ùXùùùPùŸùăù0ú˜ú3ûüOư³₫F��ẹ̀đ Èï‹wưâd;¤¢ » ƒ¯Mù₫QüQúdøCöôỌ£ñîñụ́6ô,ơö÷ƒøùùOûpüvưđ₫.' iö9  v‘€¿Ó¥y…�)�(�´ÿH₫üúù%ùÈùpúûÜûèüñứ₫nÿÿÖÿK�ú¬ØẪ`Ñés—­́�.�8ÿV₫›ư`ư}ư·ư®ư?ư¹üFü)ü*üKüqü¹ü:ưùư¹₫5ÿmÿnÿmÿ€ÿ¥ÿÿxÿ<ÿÿ+ÿYÿ•ÿxÿKÿơ₫₫+₫·ư8ư›ü>üüRüŒü¨ü«üzü?ü üåûvûơú—ú¢úñúûOü´üÈülü'üâû¥ûXû$ûûú´úMúÚù”ù[ùxùĂùúMúUúLúdúóúü‰ưÿ¾�–†—æ Ö ¹Ü;Ô\n"g:n@WÖ > ÔMGÚ₫tûŒøzö×ô#ó\ñóï[ïîïnñHóơyöø»ù~û-ư¶₫&�ö°–K < x u A ¯ Ô™®a�5ÿíưËü¤û­úèùPùƠøzøKøøtù°ú-ü™ữ₫�Ô©QÈ-ø' …ï`Ï ưÿë₫÷ưBưäü§üxügügü|ü…üü•üÈüÿükươưY₫Æ₫-ÿÿËÿ₫ÿ�üÿîÿ°ÿ‹ÿMÿ ÿÏ₫¢₫€₫^₫X₫G₫ ₫Øư“ưYưưÄüŒüoüCüü÷ûăû¤ûUûûåúĐú¶úÁúëú û"ûeû•û”ûsû)û×ú›úŒú˜úúƒúEúúäù₫ù>ú–úíúDû×û¼üÙưÿ{�̀]'%* A ́ W#„[(nưôfLúø ‚ ÑoÀ~₫%û3øöZô¬̣ñªïïyïâđụ̂ ơîö­øŒúNüôưhÿÙ�f0Å+ î c k   {t×J�Á₫JưøûûcúÏùbùơøËøÍøÙøùùúëû£ưXÿ₫�>*ßjà=bv`Ö8k„ Á�Öÿû₫ ₫ưü™û;ûû)ûfû¾û2üŸüâü.ưưêưl₫ÿ¢ÿ�z�¥�Î�æ�å�¹�r�4�ôÿÿGÿÿË₫‰₫K₫ ₫Çư_ưưÇü®üüuüWü'üûûĐûÀû´û—ûQûÿú¶úúrúwúúëúŒûüoü`üôûgûÙú‰úRú2úûùĂùªùÓù7úÆúIûÔû|ü^ưl₫œÿ¦zS6 1 f˜BNAyu0p Q »x�¨üYù~ö<ôˆ̣ÇđïÛí¢í·îÊđdóéơ øñù¼ûqưÿ�ùŸ`L e  P  u ‚ <¾á̃É�̃₫-ưØûơú%ú°ùxù-ù¥øLø+ø%øvø\ùëú×ǜ₫t�ÚîÈœdjcUYV#¥Å¼ŒL�ÿÆưuü¤û1ûûûûKû¢û ükü¦üáüưnưåưŒ₫?ÿâÿh�ơ�aˆu)°��¯ÿZÿÿÑ₫™₫}₫s₫v₫Y₫₫lưúüülüDü ü÷ûưû%ü[ümü1üÔû‚ûLû2û ûûÚúÄúû¹û“ü ưøüüüxûƠú úÆù·ùÜù*ú|úáú!ûhû²ûFünưË₫(�‚ûº¤[ ƒ mÆÂYºÊ9ƒ  NÀ;SÿüÜø7ö!ôṚđîîÓí¶íßîñ·óFöcø:úåû›ư+ÿ¨�D₫Ñœ< h , ^  d d ltNH�j₫Úü€ûúĂùù´ø€ø”ø£ø„øYø‡øKùÙúăüß₫v�¥í®Ü̉yEæR«–Ѷ�wÿ ₫Úüôûgû ûĂú­úÛú@û¹û*üsü½üüü`ưËư-₫•₫ÿÿ#�´�ÿ�ù�Ú�ª�h��¿ÿ`ÿ2ÿÿÿÓ₫~₫₫²ưSưươüÜü¹üeüü̃ûºûûnûAûû̀ú\úôù—ùlù§ù,ú¼ú6û¿ûüNüü©û&û´úZúúơùøù?ú¤úûrûïûuüúü—ư_₫hÿ‚�Đ.ש‚} ü w“G5£l°‚cÏÉè G )ă&ÿ üùÀöûô<ócñĐïùîeïôđ>óơ£÷VùÈúRüåưiÿñ�añ˜>’« d ¤ t î  º.@n�à₫ư|ü¾ûAûû¼úOúœùÍøIøkøCù—ú!üŸưÿk�Âߺ:¸F[Zˆé—†UÔ²5�Ä₫dưHüƒûûùúVûèûeüü…ü[üTü˜üưyưáưY₫§₫Rÿñÿy�É�̣�ÿ�À�9�ÿ ÿ½₫¨₫Å₫ö₫+ÿ7ÿî₫Œ₫₫ưöü†ü2ü üüü(üüáû–ûOûÿú§úGú̃ùœù›ù úâúÅûüàü̃üyüÉû÷ú3ú¬ù—ùÄù!ú“úæú8ûSûvû¿ûCüÿü ₫nÿÿ�Ä–Wµ Ø ơͨzAäj$›ôtG₫ ₫v=·�Íư²úØ÷¥ơóóỴ•đïî:ïơđ8óKơööDøùIûưÿĐ�kÔ  ‰ ¹ ª ] ¤ Œ#’kÛ�"ÿư7üjûâú3ú2ùAø°÷Ÿ÷Zø^ùiú€û¾ü₫ÿº�¥m%ơÛªZ̃÷ƯP \úÿÜ₫ëưư9üÍûÀû̃ûü üçûàûôûEü•üñüRư¬ư ₫Ê₫sÿ �‚�±�¾�©�“�e�÷ÿÿIÿ9ÿPÿTÿ?ÿÿđ₫²₫v₫/₫ÈưHưíü•ürüuüjü>üóû¬ûlû,ûÛú†ú(ú×ù·ùÎùúhúÛúaûùûxüäü�ưxüûgú­ù’ùÓùIúĂú%ûvûÀûü”üưæưă₫9�Éj̣PU å X+PơÉKK›º-\Ć ¥“„8p₫ûơøÿöNơ˜óËñJđ«ïDđÏñ¥ó.ơ9ö3÷Tøăù¤û;ư ₫ÛÿBÉ‘>YÈ 8 VEđ¥›œœZ�ÿôươüü+ûEútùù:ùùú¹úsûLü:ư"₫ÿƯÿ�<í¤cï]w6Ç?Ç/ƒµ� �ÿ»₫öưOư­üAüüôûüüüüMü“üư®ư4₫¸₫ÿnÿ¾ÿóÿ(�;�2� �E�L�T�`��Üÿƒÿ6ÿ́₫®₫{₫Q₫'₫åư‰ưAưưóüĐüœüŒüuübüMüüØûû€ûtû“û¶ûÑû̃ûÜûîûü/ü"ü üåû•ûNû&û)ûZû•ûËûü-ü|üư¯ư„₫ÿ¶�ưVḈp} � ¯úuƒú˜¢t~º z ]·q? �¤ư~ûµù>øÑö\ơôóêóĐôÈơYö˜öÅöW÷føÀùû üñüØư ÿr�è'Ö}+—ƬGÉ:£^Œ¿Ê�đÿ<ÿ¬₫₫•ư2ưĐüqüXühüsü§ü»üư¿ư„₫Cÿ¿ÿ��&�S�ˆ�¬�Ö�è�±�Z�÷ÿœÿ&ÿÄ₫₫A₫ùưưjư/ưƯü̉üÿü-ưqừư₫K₫p₫•₫Ä₫ö₫ÿ'ÿZÿ‘ÿ¿ÿêÿ ���øÿ́ÿÊÿÿUÿ%ÿ/ÿHÿ9ÿÿÿơ₫ï₫ó₫ü₫ÿ ÿî₫È₫Á₫Ñ₫Ơ₫ú₫ÿÿÿ0ÿ&ÿ:ÿPÿkÿoÿlÿfÿXÿ\ÿSÿzÿŸÿ¬ÿ¬ÿœÿƒÿRÿLÿMÿfÿzÿœÿ»ÿÔÿơÿøÿ �$�T�…�Â�:w½W´&Éḥ>>ÙªÇ̃Ö¡Jơ¼q₫†î�P� ÿô₫›₫M₫₫ôưçưØư±ư’ưQư'ưư&ư:ưIưWưoư{ưư¥ưĂưăư₫E₫R₫Y₫[₫u₫ª₫Ú₫ÿ?ÿJÿ>ÿ:ÿ>ÿEÿUÿhÿxÿÿ­ÿÖÿ��6�\�i�…�~�z�d�q�„�‡�Œ�…��g�L�!� �åÿÅÿ°ÿƒÿ\ÿ?ÿ2ÿÿÿvÿyÿXÿ@ÿ)ÿ ÿÿ ÿÿ:ÿMÿZÿtÿfÿdÿ†ÿ•ÿ ÿÿ­ÿ©ÿ©ÿ¬ÿ¯ÿ¶ÿ°ÿµÿ´ÿ­ÿ½ÿ‹ÿrÿgÿ\ÿZÿTÿWÿbÿ‚ÿ‰ÿ‰ÿÿ˜ÿ”ÿ•ÿŸÿ´ÿªÿ”ÿsÿnÿYÿRÿ^ÿ`ÿLÿIÿVÿHÿ;ÿ!ÿ ÿÿơ₫đ₫ă₫Ë₫¾₫Đ₫Ư₫ö₫đ₫Û₫Ï₫¿₫Æ₫Ô₫ü₫̣₫÷₫ÿ'ÿRÿoÿ‘ÿ£ÿºÿĐÿüÿ+�V�”�Ë�E„©̃ VÊBh›§”€[I5'ă4ă¢fÊ�v�6�èÿ©ÿcÿÿñ₫Ë₫¹₫—₫’₫p₫a₫V₫I₫I₫4₫+₫;₫`₫k₫…₫₫‰₫¨₫Ô₫9ÿ‰ÿÇÿĐÿÉÿŸÿ…ÿxÿlÿ|ÿÿØÿùÿ�"����ưÿơÿëÿâÿÚÿ̉ÿ̉ÿĐÿđÿ��(�)�/�đÿÆÿ¶ÿ­ÿ¬ÿÿ„ÿÿZÿYÿÿœÿµÿ®ÿ¡ÿÿ_ÿRÿYÿqÿ…ÿ´ÿÉÿÇÿÑÿÉÿÜÿÙÿ̃ÿÍÿ¸ÿ³ÿ±ÿ²ÿ¾ÿÊÿÚÿêÿçÿñỵ̈ÿƯÿĐÿ¿ÿ¦ÿ‹ÿÿ˜ÿËÿËÿÇÿ«ÿ›ÿ¬ÿ¶ÿÁÿ²ÿ“ÿfÿEÿ>ÿAÿKÿhÿiÿjÿnÿVÿ4ÿ́₫¿₫’₫Œ₫†₫h₫V₫+₫'₫*₫₫₫ưĂưœưư¶ưæư-₫Q₫o₫†₫¬₫ß₫ÿ>ÿ|ÿ̀ÿ�®�6°hÎ4âTø5,÷¢†’—¯y ƒÔVÈ0¡c�Ëÿ.ÿ ₫₫—ư4ưđü̉üÈüÙüâüïüïüüü ưưlư©ưÿưj₫Ư₫Iÿ‹ÿÖÿ�R�ˆ�è�T®ăà¤Iđ��T�B�^�}�‚�g�)�ƠÿxÿFÿÿÿ,ÿ'ÿ/ÿ9ÿ\ÿbÿƒÿœÿ²ÿ©ÿ‰ÿ`ÿ ÿÿ+ÿ#ÿ́₫̣₫ă₫í₫ÿñ₫ö₫Ă₫¡₫h₫;₫'₫$₫[₫²₫ÿ₫/ÿYÿQÿIÿ=ÿNÿRÿOÿgÿÿ–ÿ²ÿ‹ÿiÿ{ÿÿ„ÿÿUÿ(ÿù₫Ø₫¸₫’₫₫¸₫Î₫̉₫Ë₫µ₫x₫!₫đư×ưÛư₫;₫[₫f₫h₫b₫d₫_₫I₫-₫₫éư¸ưuưưÑü©ü¾üÓü²ü’üiüaüxü¼üûü[ưÇư7₫·₫@ÿÇÿY�Ư½•/Î ç d C ̉ b # > z d ù W ”ÀÙä$‰ �¡₫Hư,üû�ú#ù†ø8ø$ø9ø>ø=ø1ø-øMø¤øùÅù™ú–ûÁüÛứ₫Ïÿ�>̉€µ$Ù`œªw;Ouá€7À�w���ÿ,ÿÔ₫l₫₫̉ư¬ưÈưđư7₫“₫ß₫ÿ&ÿÿÿ#ÿ ÿï₫¿₫¼₫´₫È₫î₫(ÿ,ÿÿ ÿå₫Ç₫₫‡₫₫›₫¼₫í₫)ÿkÿ§ÿ¾ÿÅÿÁÿ¬ÿ¡ÿÿoÿnÿsÿÿ¥ÿ¯ÿ§ÿÿWÿÿ₫Œ₫'₫·ư…ưDưưưưüêüÑüÙüÓüƠü̉ü¿üüüü‹ü§ü³üÓüđüư;ư.ư×üeü̃ûiû6ûû1û[ûûÔûücüÈüGưÄưt₫6ÿ+�G“êmOv ̉ Ü _ù¼ˆZf“vù 1 @ G pỎU"ÿQưâûˆúù×÷µöïơ‡ơdơ2ơơÎô¾ôăô3ơƠơöŸ÷ĐøNúü˜ư$ÿu�qR-ă“-³'ô.> ¿B—§–ni²� �½ÿqÿ8ÿû₫®₫?₫̃ư‘ưAưóüËüĐüÛü*ư‹ưåưI₫”₫×₫́₫̃₫Á₫¯₫€₫T₫L₫]₫‚₫½₫ ÿ>ÿjÿdÿJÿ6ÿ^ÿgÿÿÿü₫ÿGÿˆÿĂÿÚÿñÿÛÿºÿyÿIÿCÿ<ÿ5ÿ8ÿMÿSÿdÿEÿ*ÿü₫®₫G₫çưwư1ưåü|übü-ü$ü+ü[ü¥ǜüÈü—ü7üæû×ûÂû̀ûƯûüEüJüFüüăû{ûûÏú°ú·úăúCû†û₫ûªüư_₫\ÿb�^‡́±ÏT ̣ k$ØË!‚,'G¤ĐÑ ¦ J l çơÇ₫öüû#ú»ø5÷ØơÙôMôßó”óVóóóWóÉóqôVơbö´÷IùûÍü₫2�ƒ£SøKÜfư„Ä×u¤‰3ÿÿU¹�=�ÉÿPÿ¿₫&₫Vư§üÿû¶ûyûlûûƯûEü«ü;ưÂưD₫´₫ø₫ÿƯ₫®₫₫Ä₫�ÿSÿ•ÿ̉ÿ�#��àÿŒÿÿ©₫u₫d₫™₫Ü₫ÿ'ÿ>ÿ?ÿ?ÿÿÿÏ₫‚₫₫~₫®₫Ơ₫î₫î₫æ₫Í₫¹₫«₫{₫E₫ ₫̀ưxưJưưáüœü_ü<üüüîûëûÀû’û~ûœû̉ûü1ü&ü)ü4ü^ü^üü¦ûû‹úPúUú†úíúCû›û üŸü‚ư„₫¥ÿ²�½ư£©2  Ñ5¾?å=K3 ùxËƯÈ ( Ï í£�₫1üªú=ù×÷~öLơiôÖó^ó÷̣ṇ̣óñỊị̈åóûô0ö¬÷`ùLû'ưí₫ƒ�̃×tåxÆœW µ § " W/è’j`•Â�x�óÿLÿ₫ưªüü—û_û?ûRûºûüü�ưeư¼ư₫c₫ƒ₫§₫Ä₫Ê₫̃₫ü₫7ÿ‡ÿËÿ�!�+��æÿ¦ÿUÿÿă₫Đ₫ê₫ÿTÿ{ÿ±ÿÁÿ§ÿ€ÿ:ÿÿâ₫Ö₫ß₫ó₫ÿaÿŒÿHÿ�ÿ©₫\₫ëư‘ư9ưÔü|ü+üđû°û—û®ûÇûñûüüºûWûûÁú£ú×ú6ûĂû-üªü»üEüÑû ûWú¿ùùùú´úsû0üÖüxựưy₫ÿ�4±¦ Ơ ¸ “®ÇçxèrJXe)ƠCi=x  *� ¯₫Âüû—ùø©ö”ơïô]ổó5ó‹̣ ̣Øṇ̃Ạ̈óô»ơQ÷ù ûÿü¬₫�[x”l"Î…p\ î  ‘ Û ûÜÁăOßẓ�:�QÿY₫\ưüü¶û“û‹û¥ûêûKü¼ü,ư˜ưÁưđư"₫A₫]₫|₫₫¨₫Ù₫)ÿ˜ỵ̈ÿ3�=� �ÏÿlÿÿÊ₫₫‰₫¶₫̣₫9ÿnÿ™ÿ°ÿ“ÿiÿ/ÿû₫È₫¸₫Ê₫å₫₫₫ÿ ÿÔ₫ ₫X₫₫ư*ưßü¢üqü)üüÖûûmûnû‚ûŸûºû¡û“ûˆû‰ûŒûû¨ûÎû�ü2üEüAü0üÓû|ûûÄú»úÜúûVûÆû/ü¯üư¼ưo₫FÿM�m¾W[Ñ ,O­¶₫Iåį“u5Íù „ # È­�%₫Düđú¼ù¨ø£÷̉ööhơ ô·óẠ̀éñ¢ñÍñ‹̣tó†ô¨ơñömøú­û6ư₫©ÿÊ�ĐÇ·€D ă­# 8 ăR‰ÎBî¾ê7^�VÿQ₫EưœüüËûàû<ü×ü`ưÔưêưÆư|ư6ưưưPư¬ư%₫²₫7ÿ¹ÿ�'�₫ÿÁÿmÿCÿ;ÿ8ÿ^ÿÿ³ÿàÿ�$�>�#��Ùÿ¥ÿzÿXÿUÿ?ÿ/ÿ.ÿ7ÿFÿLÿ6ÿ ÿÀ₫g₫₫¨ưOưùüÑüümüKü,üǘûÙûÚûü>ü üáûÚûƯûüJü€ü ü§üœü‹üiüüÚûûsûƒû–ûÆûđû%üqüÈü/ưÅư₫JÿL�M+‰*#y ú 0ïÏÎG”Üâñ �¾Dn Ë \ ZR¸�–₫&ưüûú6ùuø¦÷Çö±ơvôWó‘̣ḅỊ́™órôbơ[ö|÷°ø÷ù(û:üKưh₫xÿ�°«¸K ¿ >đgµù2¡D₫¸q„«—�qÿr₫“ưưÖü×ü₫üGưư­ư“ưCưÈüBǘûÏûünüđüŒư&₫¡₫ë₫ÿÛ₫°₫v₫a₫₫Ê₫)ÿ¯ÿ2�„�´�¯�Ÿ�‹�_�>�0������� �Üÿ¢ÿPÿ ÿÆ₫7₫Àư\ưưăü¹üÇü©üüDüüéûÆûÍûÎûÄû¾û¿ûĂûçûünü¶üƠüéüûüăüđüûǘüÊü¤ü‰üuü†ü­üßüư5ưsư·ư'₫§₫iÿQ�ä�«yxÊ[HG #  :Eæ _ æ ê  C D . ä $  ¶L¹k¹ÿŒ₫ºưưQü‚û±ú̀ùÎø£÷\ö9ơTô�ô*ô¹ôrơIö ÷½÷…ø9ùöù¢úXûüơü₫3ÿa�›{V«. ·}=#ưѺ_Ưï�èÿ8ÿÍ₫£₫¶₫á₫Ú₫½₫l₫èưưLüºû=ûû<ûÅûjüđüWưˆư}ưMưưïüáǘü<ư¾ư]₫ÿ‡ÿïÿ� �Ùÿ¶ÿ–ÿ—ÿ®ÿÂÿûÿ&�\�€�„�f�(�ÏÿmÿÿÔ₫‚₫M₫4₫₫₫åưÔư™ưHư÷üü?üüñûûû#üVüü·ü×ü ưưưư ưîüưDư}ưêưV₫^₫&₫ûưÏưªưŸư§ư»ưÊư ₫X₫Ï₫&ÿzÿßÿ:�¯�5Ù„e_ª%ª Ô  è C ä Ó ù ; ‚ ¹ Ü ₫ Ú *  g–áxÓ�6�™ÿÿg₫·ữüåûÔú ù™øú÷µ÷÷Î÷økøÆøùpù¬ùôù%ú—úûûOüư₫á₫¬ÿ_�!âw±§Ÿ›̀‘_ÉÀƒmÊ$°ƒƒ‘eÿ�{�´ÿÜ₫"₫{ư₫ü¼üü“ü¹üÚüóüñüÂüƒüQü'ü)ü`ü¯üư…ư ₫v₫Ä₫ÿ₫ ÿ ÿÿ,ÿOÿ|ÿ¢ÿ́ÿ;�f�”���i�>����êÿôÿåÿÓÿ²ÿ‹ÿlÿiÿdÿYÿiÿ!ÿî₫Ü₫Ă₫₫k₫X₫d₫₫·₫á₫ù₫Ø₫₫₫{₫x₫s₫|₫₫Ú₫*ÿpÿŸÿ‚ÿNÿ÷₫¹₫¾₫Î₫ ÿKÿ¡ÿäÿ�)�6�4���øÿ�)�v�ë�L¯é>¡üG¥̀đJW}²½ƠÁ˜3Óg¦Rü´ođ�Ï�…�-�¯ÿ6ÿÅ₫N₫âưưmưNư?ư6ưứüÎüªü‘ü€üü›üÁüưüNư±ư/₫₫±₫Ù₫Í₫¦₫t₫q₫Œ₫Â₫ÿ}ÿøÿY�—�¦�´�ˆ�R�/��%�R�£�ä�2g|aÄ�n�1�̃ÿÄÿèÿ�0�K�h�U�%�Óÿ…ÿ(ÿö₫Ù₫Ö₫ ÿ(ÿeÿ’ÿ›ÿÿrÿDÿÿÏ₫¾₫Ô₫Ü₫�ÿ?ÿ}ÿ£ÿ½ÿ»ÿ¥ÿ~ÿOÿ@ÿ0ÿQÿ~ÿ¼ÿëÿ �&�<�:���åÿ̀ÿÑÿƯÿùÿøÿ�&�5�%��åÿÀÿ°ÿ¡ÿ£ÿ¦ÿºÿÁÿÈÿÊÿ°ÿ¸ÿçÿËÿjÿRÿ:ÿ*ÿ%ÿ3ÿFÿfÿkÿWÿ\ÿ0ÿ!ÿ"ÿÿÿ1ÿFÿLÿOÿWÿwÿiÿTÿNÿPÿYÿnÿPÿSÿmÿÿÿ¯ÿƠÿ÷ÿ �2�=�>�I�Q�U�a�]�x�‹�„� �½�Ü�à�ë�Ü�̃�Ô�à�ë�Ù�Ơ�Ù�Ơ�Í�À�¿�¢�–��—��i�L�D�)�$��ưÿêÿàÿƯÿàÿÏÿ¬ÿœÿ•ÿÿ†ÿ”ÿ¡ÿ•ÿ¢ÿ´ÿ±ÿ«ÿ–ÿ~ÿ`ÿgÿcÿ}ÿÿÿ£ÿ¶ÿÆÿ»ÿ²ÿ¬ÿ³ÿ½ÿƠÿßÿçÿöÿÿÿ��#�� ���"�+�(�$�:�U�\�N�Q�9�"�)�.�1���&�2�F�<�.�&�����ăÿÙÿàÿÙÿÛÿÔÿ̀ÿªÿ›ÿÿwÿ‰ÿcÿ=ÿ2ÿ<ÿNÿeÿbÿeÿtÿˆÿ‹ÿ‚ÿ}ÿwÿ„ÿ‡ÿ™ÿ­ÿ·ÿÂÿÈÿËÿÇÿÍÿ»ÿ¼ÿ¢ÿ›ÿ¥ÿ§ÿ¾ÿ¸ÿ·ÿ¼ÿ¹ÿ¤ÿ°ÿ«ÿ¦ÿ£ÿŸÿ›ÿ˜ÿŒÿÿ³ÿ•ÿˆÿÿyÿmÿiÿ{ÿÿ”ÿ‹ÿÿ™ÿŸÿ ÿ«ÿ̀ÿ̉ÿëÿéÿƯÿñÿ�ưÿùÿ�ùÿ�ûÿ��)�6�?�T�J�D�8�6�7�3�4�3�)�� ����øÿûÿùÿôÿ ����%�*�4�6�6�<�6�A�C�D�.�5�1�6�<�1�2�"�2�*�&�;�5�)�0�/�(�5�"�����øÿéÿêÿÑÿ­ÿ¡ÿ­ÿ©ÿ®ÿ¨ÿÇÿ̀ÿ¿ÿÊÿ¿ÿÙÿßÿáÿíÿåÿÏÿÚÿèÿæỵ̈ÿûÿûÿöÿưÿ��� �;�!�,�;�8�>�C�C�4�4�(�%�!�!�!������̣ÿêÿóÿñÿàÿßÿæÿßÿÏÿÏÿĐÿÈÿÂÿ¼ÿ«ÿ™ÿÿÿÿ‰ÿwÿxÿºÿØÿ«ÿ†ÿ]ÿLÿ0ÿ;ÿBÿZÿyÿeÿ^ÿGÿ>ÿJÿ=ÿ@ÿNÿIÿWÿoÿuÿÿyÿ…ÿ‘ÿÿ¨ÿÖÿ¸ÿ´ÿÅÿÀÿÖÿÚÿæÿ́ÿ���̣ÿëÿíÿñÿëÿÙÿçÿâÿăÿĐÿƯÿàÿÅÿ¼ÿ³ÿ³ÿ´ÿ­ÿ¯ÿ§ÿ«ÿ«ÿ·ÿºÿÄÿ¹ÿµÿÆÿ̀ÿèÿ��ơÿ₫ÿÿÿ���̣ÿéÿóÿ ����ưÿúÿ� � ��ÿÿùÿöÿ÷ÿúÿđÿïÿîÿäÿçÿƯÿÍÿ·ÿ®ÿµÿ¼ÿÅÿ¿ÿÊÿØÿƯÿßÿƯÿÅÿ¸ÿ½ÿÊÿºÿ£ÿ¨ÿ°ÿ¾ÿÆÿÏÿÎÿ¿ÿ̀ÿÇÿÖÿÎÿÅÿÖÿßÿ×ÿÛÿáÿÚÿƯÿïÿ�"�%�!�%�� ���+�-�:�9�>�4�'�&��+�/� �� �2�:�;�4�?�A�2�<�H�>�1�)��#�'�/��ưỵ̈ÿåÿçÿæÿçÿ»ÿœÿ©ÿ»ÿ·ÿ¶ÿ¸ÿ±ÿÊÿÍÿÉÿÅÿÊÿ¼ÿºÿÍÿÊÿÖÿóÿ� ���₫ÿúÿ₫ÿ�������� � �� � ��ưÿïÿđÿàÿăÿØÿËÿÄÿ¾ÿÉÿ½ÿºÿ¾ÿ´ÿ®ÿ·ÿÉÿÏÿàÿâÿæÿØÿÄÿÔÿßÿäÿïÿóÿéÿøÿ�M�›�ç�Æ�%�eÿÊ₫á₫ÿb�$Rû�N�®ÿRÿ.ÿCÿˆÿÏÿ �O�e�`�/��Ñÿ¥ÿeÿ]ÿ‹ÿÆÿ1��³�€��œÿHÿCÿ{ÿ½ÿ�J�9�1�üÿÑÿ­ÿ•ÿÿ­ÿºÿÜÿïÿ��ëÿÏÿÀÿ¨ÿzÿwÿ‹ÿ­ÿâÿ���äÿÆÿ§ÿ¨ÿ²ÿ×ÿäÿ�₫ÿéÿăÿÎÿÓÿ±ÿ£ÿÿ«ÿ½ÿÙÿíÿđÿèÿÖÿÚÿÙÿÛÿØÿƯÿ÷ÿ �#�3�A�$�������� ���J�e�:��üÿéÿÛÿäÿïÿ�����đỵ̈ÿêÿñÿ � �� � ��₫ÿúÿáÿçÿÙÿ�ïÿÏÿØÿÊÿÎÿÈÿƠÿ̃ÿưÿ��áÿÏÿÀÿ¾ÿ̉ÿÉÿƠÿĐÿËÿĂÿºÿÍÿÜÿÚÿÖÿÚÿÔÿÜÿÓÿÜÿÔÿ×ÿ̃ÿßÿ́ÿÚÿÔÿØÿÎÿÊÿđÿâÿ×ÿÈÿÅÿÎÿÊÿÈÿ³ÿ´ÿ­ÿ¯ÿ¸ÿ£ÿ¨ÿ¡ÿ´ÿ¾ÿÅÿÍÿ·ÿÈÿÊÿÉÿÊÿÀÿ´ÿ©ÿ±ÿÂÿÛÿßÿØÿÚÿØÿ̃ÿ́ÿÜÿ×ÿßÿ̃ÿíÿèÿÖÿÄÿÅÿ¶ÿ¾ÿÏÿÈÿ»ÿÁÿ·ÿ®ÿ´ÿ¦ÿ˜ÿ™ÿÿ³ÿ«ÿÿ«ÿ¦ÿ”ÿ¬ÿ¬ÿ ÿ–ÿÿ ÿªÿ²ÿ’ÿœÿ‘ÿŒÿ¦ÿ©ÿ´ÿ´ÿ½ÿÂÿÔÿËÿµÿ°ÿ´ÿ©ÿ®ÿŸÿÿ‰ÿ‚ÿÿ³ÿ«ÿÿ—ÿ£ÿ’ÿŸÿ‘ÿ™ÿ£ÿ¦ÿ¿ÿËÿÇÿÄÿÆÿºÿÇÿÛÿ́ÿöÿ̉ÿÆÿ̉ÿÔÿ×ÿÜÿăÿéÿóÿúÿúÿ����%�3��,�O�1��ÿÿñÿíÿ÷ÿÿÿ$�)�/�2�-�=���1�A�Z�c�^�P�Q�G�N�\�Z�V�L�6�%�+���������÷ÿ� ��������ïÿüÿ�̣ÿéÿéÿïÿéÿêÿÛÿàÿÑÿ̃ÿÛÿƠÿÜÿÔÿÛÿÍÿƯÿèÿàÿíÿưÿâÿÛÿäÿßÿïÿƯÿéÿ̃ÿÓÿæÿçÿíÿæÿöỵ̈ÿ�ÿÿíÿĐÿƠÿïÿùÿ ���÷ỵ̈ÿñÿíÿúÿ÷ÿøÿûÿ�� ���ûÿûÿïÿöÿ������îÿñÿđÿăÿ́ÿÿÿ́ÿåÿÔÿáÿàÿÓÿÚÿ̃ÿ̃ÿ̀ÿÙÿăÿâÿêÿïÿíÿêÿëÿßÿâÿáÿèÿđÿöÿåÿèÿäÿêÿơÿ́ÿùÿơÿÿÿ��ăÿØÿÏÿ�7��øÿêÿÛÿ̉ÿÑÿæÿ����₫ÿÖÿçÿëÿ̃ÿÛÿÈÿÑÿĐÿ×ÿØÿçÿöÿÜÿ̉ÿÚÿíÿåÿ¶ÿ·ÿ³ÿ¦ÿ¬ÿ¼ÿÈÿÜÿàÿöÿàÿÜÿÈÿÀÿÑÿÏÿÔÿÛÿÙÿÓÿÛÿèÿ �₫ỵ̈ÿüỵ̈ÿ÷ÿûÿ��� � ��#������D�D�-� � ����ơÿûÿúÿ���öÿơÿîÿçÿ��àÿ̃ÿíÿáÿáÿæÿơÿèÿåÿÊÿÏÿÑÿ×ÿÖÿ̉ÿ̉ÿÎÿƠÿÖÿÑÿÊÿËÿƠÿéÿêÿÔÿÊÿ¾ÿÍÿÜÿËÿ±ÿ»ÿ¿ÿ³ÿËÿÄÿÀÿ³ÿÄÿÔÿƠÿÎÿÁÿÆÿ¼ÿÂÿÂÿ»ÿ«ÿ´ÿ°ÿµÿºÿ³ÿºÿÀÿµÿ¸ÿºÿ¤ÿ§ÿ­ÿ”ÿÿzÿ‚ÿ†ÿ•ÿÿ¦ÿ¦ÿxÿƒÿˆÿ•ÿ¬ÿ©ÿµÿÑÿÍÿÉÿÑÿÁÿ±ÿ§ÿ«ÿ§ÿ²ÿ»ÿ½ÿĂÿĐÿÙÿöÿöÿëÿăÿ¸ÿ¼ÿ»ÿÓÿåÿ×ÿĐÿÙÿÜÿÔÿÙÿÔÿƠÿ×ÿÁÿ̀ÿÏÿ̃ÿđÿăÿƯÿÍÿÅÿÉÿ̀ÿ·ÿ½ÿ½ÿÈÿ´ÿ¶ÿÍÿÉÿÅÿÄÿÉÿ»ÿÔÿ¾ÿ¦ÿ¦ÿ ÿ¬ÿµÿ¯ÿ©ÿ¶ÿ«ÿµÿ¹ÿ¹ÿÄÿ¶ÿÄÿÇÿĐÿÄÿÑÿíÿ́ÿăÿëÿùÿâÿÚÿÛÿôỵ̈ÿêÿưÿûÿúÿûÿ����úÿúÿ ��ôÿ��÷ÿùÿïÿ� � ��ùÿ�́ÿ́ÿöÿñÿñÿûÿ�������+�!�&�#�&�2�2�*� ���*�;�.�D�8�9�6�&��#�"����� ��� ����₫ÿ �� �öÿöÿđÿăÿ̃ÿÍÿÖÿ̉ÿĐÿØÿæÿèÿ́ÿéÿƠÿèÿéÿâÿÔÿÖÿÓÿÚÿæÿ́ÿóÿëÿçÿßÿçÿàÿëÿóÿóÿ́ÿåÿêÿØÿçÿëÿ́ÿñÿîÿ0�ƒ�g�1�#�÷ÿßÿ̉ÿÛÿéÿïÿöÿëÿđÿ×ÿØÿ×ÿÆÿ²ÿ¸ÿÆÿÍÿÚÿÊÿËÿÏÿăÿêÿéÿùÿ �ÜÿÇÿËÿ¿ÿÈÿÈÿÛÿñÿôÿ�÷ÿáÿÎÿĂÿÂÿÓÿÛÿÜÿÔÿÍÿ̉ÿƯÿđÿùÿñÿÿÿ+�K�"�àÿ†ÿeÿ‡ÿØÿ9�w�k�3�ûÿÓÿßÿăÿîÿïÿ� ���Ưÿ̃ÿñÿ�B�·�‰£ƒ¿pƠÿÄ₫’₫�ÿÿÈÿQÿp₫ưKư¥ư`₫ ÿjÿ9ÿØ₫¬₫Ă₫?ÿéÿn�‹�Q�äÿ×ÿ—�ÍÖ”=­œ�?��ä�Ë��ÿ₫®ưĐư6₫„₫k₫øưGưƯüïü’ưZ₫Ơ₫³₫4₫ÿư-₫¼₫dÿĐÿ÷ÿơÿÂÿ´ÿăÿ�4����y�'÷¯P¥„4¬ºî́_œ�Ôÿ'ÿù₫&ÿ@ÿư₫u₫×ưwưưËư₫₫F₫+₫Åư|ư…ưÙư0₫A₫ßư”ư®ưI₫ó₫3ÿ'ÿÛ₫²₫Ù₫JÿÎÿ �Öÿ}ÿZÿ®ÿ#�‹��?�Øÿ×ÿ^�Ư�₫�¨�̃ÿ]ÿHÿÇÿn�“�a�%�̉ÿiÿ8ÿBÿOÿ)ÿÿÜ₫Ñ₫ÿ₫.ÿJÿ3ÿ&ÿÿ ÿEÿbÿCÿ ÿó₫#ÿ“ÿ�O�$�äÿ̃ÿ�‚��7�æÿ��ä�đ�̉�²�¦�÷�M†f ­�i�”�ô�h�(�g�Ô�¦�4�åÿôÿL�Ÿ�±�V�Áÿù₫§₫ÿ‘ÿúÿüÿ{ÿê₫̀₫Iÿöÿ�™�öÿAÿÖ₫́₫Rÿ·ÿùÿ�đÿËÿđÿ,�-�¼ÿ+ÿ÷₫ ÿ’ÿáÿ�óÿÀÿ§ÿ×ÿ�U�|�4�­ÿÿƯ₫ÿÿ�Z�Q�&��́ÿ¤ÿ=ÿ ÿ6ÿ•ÿ �+�6�-��ăÿ�‡�̀� �=��íÿøÿ3�–�~�y�‹�]�"�¾ÿ«ÿíÿX�…�l�=�çÿÆÿ¶ÿÏÿïÿ)�E�M�P�5� �ïÿêÿâÿ�T�‘�>�Ñÿxÿ*ÿRÿàÿˆ�Å�~�Àÿÿơ₫6ÿˆÿÆÿåÿåÿÇÿÿtÿWÿMÿfÿ°ÿøÿ�)��Ëÿÿ™ÿÍÿ�^�m��—ÿIÿ€ÿùÿv�¾�¨�]�0��üÿÀÿ†ÿjÿÿ��É�{�!�Äÿ¤ÿÆÿÈÿÀÿ³ÿ ÿ~ÿ‘ÿÇỵ̈ỵ̈ÿ×ÿ¹ÿ̀ÿ� �çÿ¤ÿyÿÿÖÿöÿÚÿ ÿMÿ;ÿWÿ‰ÿÚÿ��%�<�I�!�¸ÿ]ÿ>ÿ~ÿăÿ8�_�A��íÿäÿøÿ₫ÿÉÿcÿÿÿLÿ¡ÿäÿ���/��Óÿ‚ÿ-ÿ8ÿÿóÿ/�>��Óÿ¦ÿÈÿ�0��Ôÿ°ÿ©ÿÓÿ�)�&����úÿáÿ½ÿ›ÿÿ¥ÿáÿúỵ̈ÿÆÿwÿWÿˆÿäÿ!�æÿ°ÿƒÿfÿzÿÿÆÿÑÿÉÿƯÿ��� �+�P�…�»�à�â�•�B�÷ÿ�\�¥�Î�Î�®�a�$��÷ÿ����₫ÿăÿÅÿ¨ÿ¡ÿ®ÿÓÿöÿ��øÿ´ÿ€ÿÿÈỵ̈ÿ%�+�üÿ¾ÿÿÿ ÿÉÿÜÿ₫ÿ �'�@�,��àÿ̉ÿñÿ�3�K�<��âÿ¶ÿÛÿ���øÿưÿ��ñÿÏÿªÿÿ ÿ¾ÿÛÿÔÿ©ÿ‡ÿoÿhÿˆÿ±ÿ­ÿ¥ÿÿŒÿÿ‰ÿ…ÿ…ÿÿÿ¯ÿÉÿÇÿ¹ÿµÿ®ÿ¦ÿ¸ÿ×ÿ��6�Q�D�<�.�1���(�:�-��âÿ¼ÿµÿ«ÿËÿßÿđÿèÿ½ÿƒÿXÿQÿRÿgÿXÿqÿ‘ÿ¦ÿ¹ÿ¥ÿ“ÿ¡ÿ¸ÿÓÿàÿàÿæÿâÿïÿúÿưÿ ��&�*�4�(�;�H�L�P�?�K�9�?�)�$��̣ÿíÿ÷ÿK�8�çÿ´ÿ“ÿ†ÿnÿmÿaÿHÿ?ÿQÿXÿSÿAÿDÿCÿ3ÿ-ÿ#ÿ>ÿMÿ\ÿtÿ€ÿ—ÿ±ÿÄÿÄÿçÿ¿ÿ¨ÿºÿÍÿáÿçÿ��=�N�R�3��åÿăÿ� �(����!���öÿÍÿÄÿ´ÿÈÿàÿüÿùÿéÿÂÿËÿ́ÿôÿûÿ���6��óÿÓÿ¹ÿƠÿÍÿàÿơÿ���æÿÁÿÇÿØÿôÿ�"���%� ���$�� �ôÿ÷ÿüÿçÿëÿ÷ÿ��äÿÍÿ¸ÿ«ÿ¡ÿªÿ¢ÿÿ™ÿ·ÿºÿÍÿÀÿÿ„ÿÿ®ÿ±ÿ¯ÿ›ÿ›ÿ¤ÿ¯ÿ̀ÿ¼ÿ¤ÿ‹ÿ’ÿ§ÿ¦ÿ›ÿ‡ÿÿ ÿ³ÿ̃ÿđÿâÿëÿ×ÿÖÿÍÿÎÿæÿ�� ���ôÿåÿäÿïÿûÿ ��ûÿëÿèÿóÿ� �'�@�X�V�0� �ùÿßÿƯÿ�/�7�Q�D�S�V�G�H�"��&�E�b�i�k�g�d�z�ª�¸�½�´�œ��z��–�›�¡�«�¡�¦�¢��~�r�j�q�‚�”��[�@�*�/�4�#���îÿÇÿ³ÿ¿ÿ»ÿÉÿ±ÿ§ÿ£ÿ§ÿÊÿÆÿĂÿ¹ÿ«ÿ©ÿºÿÖÿñÿöÿîÿđÿëÿóÿ₫ÿ �� �-��� �ơÿæÿăÿ̉ÿÜÿóÿÙÿáÿÖÿÀÿªÿÿÿ{ÿyÿmÿgÿ\ÿZÿAÿ&ÿÿÿü₫í₫æ₫Ă₫Á₫¯₫¨₫¬₫³₫¸₫¶₫°₫¢₫—₫₫k₫R₫V₫O₫?₫5₫4₫,₫₫₫"₫;₫6₫-₫?₫8₫T₫`₫s₫₫₫¯₫°₫Ê₫̣₫ÿÿ+ÿNÿmÿqÿwÿbÿEÿQÿiÿ‹ÿ‹ÿ‘ÿ¯ÿÖÿơÿ ��ơÿñÿ÷ÿ��0�*��� �&�J��Ă�Or{‚Œ¦₫GÓZŸ,aGXˆŸ§¡–|W@A1̣Á3â³Qư�É�p��¡ÿÿè₫₫>₫₫₫æưÂư”ưpưvưxưvưhưư°ư¨ư›ư›ưÂưƠựư ₫<₫h₫«₫̀₫å₫đ₫ÿ₫!ÿ.ÿCÿIÿ^ÿnÿoÿmÿxÿ}ÿ€ÿ‡ÿ˜ÿ§ÿ’ÿzÿ@ÿÿô₫Ơ₫­₫‘₫z₫I₫%₫đưºưxưMư8ưưưÚü¹ü’ü€üüdü>ü5üDüAü_üqügü?ü1üBürü›ü¸üÓüâụ̈ü ư ư,ư&ư:ư@ư;ư-ư)ưưưưưưúüđüóü÷üư*ư`ư¯ư ₫½₫dÿäÿe�đ�×,"mu ï  X F  G I ‡ÉưçaĆ h Q Ă ) 1«å!ÓÛ�èÿ·₫-ưûÿù¦øt÷nömơ¸ôôÈô*ơQơ ơ°ôaô«ô–ơ©ö÷NøùúRû“ü‹ư ₫€₫ÿ �3]”&ñÿµû幫Û�ßwƯ­yư 0ză�;�6ÿ)₫Yư×üfüñûWû°úIúúúú×ùù~ù›ù ú‘úûWûûüü&ư‘ưçư9₫œ₫ÿ~ÿÜÿ�#�'�4�V�e�4�ßÿ—ÿiÿdÿWÿ2ÿÎ₫k₫=₫₫ñưœư,ưÍüŸü}üRüöûlû÷ú™ú{úrúVú+úúù̀ùÙùøùú!úCú½ú…ûqüSư₫₫Aÿ)�aûăR 1 j ö - V æ Úï¨@9,ÍêŸ5 ü ÿ ÏơL�́₫¯ưüuúăø…÷Yö-ơ%ôSóị́ạ̀ó9ó>óGó^óËózô]ơHöA÷Wø€ùÉú ü?ưx₫ÿ†�OFJÜ…8ÓZ´̀“J¿… {ßC‹ơ>Zhf�xÿ‡₫zưˆü¬ûÑúcúúÁùoù$ùÿøåøÛøâøäø ù]ù×ùHúÀúUûØû^ü₫üư₫₫÷₫Oÿ ÿđÿ4�y�•��‰�b�7� ���øÿÛÿ£ÿZÿË₫[₫ơưư?ưưüĂüzüCüïûû û¬ú]úúÓù¡ùrù/ùùùZù¢ùøùqúúúºûwüEư ₫̃₫­ÿË� µ˜”¢ @ ( Ÿ ÷ _ (,öx—|4ªØ¥ 4 û ö Úa¡¦Úl�9ÿ₫Æü?ûµùNø ÷éơƯôäó"ó´̣ª̣Ụ̈óó8ópóÍójô>ơ3öD÷ƒø½ù û^üưƠ₫ïÿÀ�s8%50,̉mïB 5  Éw6ÊcÉ…ë&†§«®�¦ÿ–₫}ưvü—û ûúEúñù¥ùùeùwùzùeùXùsù²ùú›ú.ûÓû|ü,ừưk₫è₫?ÿ ÿçÿJ�™�ï�8\]9Ô��h�L�.�Ûÿyÿÿ¯₫Z₫!₫̣ư—ưư…ü ü¢ûGûöú²úsúJú:úúÜù¢ùyùrùƒùÅùú‚úûÔû¾ü¼ư¥₫ÿ�ưÍƯ·^ { $ ˜ % ăÊ€èÎ]›tX = 1 " Ô,(]Â`�ÿÂưZüĐúIùï÷Äö·ơ»ôơónó%óó óó"ó;óó ôçôÇơßöö÷ù3úIûiü‘ưå₫)�9 ÄtY_=œ:Á F >  °\›ú]›è^±ÖÊĂ�¸ÿ±₫²ưÆüÓûÿú‚ú!úÍù¦ùŸù?ù÷øñøùøù.ùfùÀùBúÂúDûËû@üÛüư9₫Í₫Nÿ©ÿ�a�Ă�₫�ú�å�Ä�˜�1��ñÿ̉ÿ¬ÿpÿÿ¦₫T₫ ₫ªư-ư±ü5üÆûmû&ûÍúsúDú!úú ú÷ù±ù€ùoù}ù®ùêù5ú¨úOû%üư₫ô₫çÿá�¬oD Y ç w H7´úîÅ C7 Ô Í ¡ J•¿ôP�×₫˜ưüú)ùÑ÷¬öªơ¥ốóvó#ó(ó óóóVó̀óaôơåơÇö«÷§øîù:ûqü¿ư₫₫-�<Çh!ûï»Zë]°ÍÙÂ<ÜlĂû+z̉>°̉�Éÿº₫—ưrü˜ûøújúùùùMùùØø̀øçøùùVù›ù̉ù+ú˜úû³ûhü&ưéư₫ÿƒÿ¸ÿ �g�Í�c“’‹^+ß�˜�1�Óÿ‰ÿCÿ0ÿí₫z₫₫–ư-ưÖühụ̈û‰û(ûÍúeú úĂù§ù¡ùªù¦ù†ùrùBù)ùJù‹ùæù}ú û×û¶ü§ưª₫–ÿ�Ÿßc!ô°  đ { Ü x .µø̉pñ (  !  À8v» ª�uÿ5₫ùü›û?ú̃ø¶÷ö¹ơûôiôôäó̉óÙóÔó÷ó=ô¯ôSơ&öïöÓ÷Çø½ùÎúíû ư3₫€ÿâ�)/ă]à‰m?á[· , 4  ”<à‰/6b¨^ Ă�Ûÿđ₫ ₫ư�ü&ûxúúÔùùeù ùùùUù—ùÏù�ú9ú‘úûqûĐû?üÉü†ư\₫ÿÿàÿB�‡�á�<KMB7ß�Ú�†�9��Ưÿˆÿÿq₫₫ưŸư=ưîü–ü,üÖûû8ûĐú~úJú=ú,úDú:úúËù­ù°ùƯù>úiúíúû[üưûưÇ₫‘ÿ‡�ƒ¡ø¹& „ j  b é œ VéPge6ăx· Ñ Ø × Ç ¥@Đ>ï�×ÿ°₫mưüµúsùWø2÷$öAơµôLôôàó¸ó»óĐó ô}ôơ¦ơ[ö÷å÷̀ø¶ù¶úçû1ư•₫÷ÿ38ù¦IáEù¢x§—{^A£b¹öQü[Ÿ�Âÿ¼₫½ưÜüü]ûâúwúúÊùùvùjùsù›ùëù?úú̃úûdûÍûOüéü‘ư9₫Æ₫WÿÉÿ2��¹�ê�%]—¨Œf-̃��K��ïÿËÿ‡ÿÿœ₫ ₫„ư7ưöüÏüoü ü¤ûûÉúúbúGúHú*úúơù¶ù“ù~ù§ùïù`úĐúNûóû¹üqư+₫â₫Ÿÿ�¯&»  £  {  ª ?œ†f+Æ  3 = L I ¿+’!Ù�›ÿs₫Uư"üàú ù„øp÷wö™ơơô?ôôô(ôHô†ôØôYơ÷ơöY÷/øöø½ù¹úÖû$ưZ₫ÿß�ư­6§.̀ƒÜ!WR@÷˜F̃VŒ”Ơ‘ư�Z�“ÿ³₫ñư&ưHüoûÀúQúúàù±ùzùMù\ù‡ùÎùúcú¡úÛúDûŸû üiüêü”ưH₫ÿ₫ÿüÿM�ˆ�Ơ�9Whƒ…m:â� �H� �́ÿĂÿxÿÿœ₫0₫Óưgư+ựü¡üEüöû¢û:ûåú­ú”únúYúOúlú«úú[úaúyú¼ú#û¡û-üáü˜ưE₫ö₫“ÿK�>:ÿ°N‘ l ă U Ä Y ú Œ #ø ½ U É ' r — ¨ …"—óIB�LÿG₫ữûµúùxøj÷ö̃ơUơơ×ô»ô¢ôÀôéô-ơ•ơ$öÁön÷øÚøÁùújû[üpưœ₫³ÿÏ�ó(;$¸ B“úcÊ-5.¾•gÍ.9|É�!�wÿ¹₫ ₫lưÙüDüụ̂úeú ú̃ùÚùØù̉ùÛù úNú–úôú.û‡ûçûdüàü>ư£ư₫‰₫ÿ–ÿúÿT�›�ư�QtuliVÇ�u��§ÿCÿĐ₫o₫ ₫§ư=ưöüü5üñû¬ûrû"ûÜú£úmúAú?ú@ú>ú1ú0úAútú¸ú́ú/û¥û"ü¸ücư ₫´₫>ÿùÿö� ¼‰MÓÇ ] ơ † / Ù b  û )$ä \ µ  ' W i RÔGÅ„|„�ÿ™₫wư<üùú¨ù‹ø…÷±ö ö‰ơRơơïôáổôÿôCơ°ơ<öÀö9÷·÷HøôøÙùûuü ưº₫¥ÿ‹�qfn]Aë‘%)4fœª’$ rÖ7ƒĂ8b^�Uÿq₫Çư3ư¯üEü›ûûú<úëù»ù™ù ù·ùÓùôùåù úFúÅúYûàûcüËü5ưƒư₫ưn₫Ö₫@ÿ½ÿ4�‚�Ë�î�)bŒ©£€?í��0�´ÿ>ÿÚ₫x₫₫·ưEưåü}ü+üÚû’û)ûÎú…úFúúÇùœùlù]ù}ùºùúbú·úû}ûôû„ü₫ü†ư5₫ö₫æÿ;ÑGUÿW Ÿ E  § * Ù  2  Ë * m í 8 J ÷ÀÉư;E�1ÿöư°ü‚û0úëøç÷"÷ŒööÂơ‰ơgơFơơơcơ·ơ4öööö\÷Ó÷}ølùƒú©ûÎüàư ÿ�,"� ÍD¡ư^ ¾ Đ ¨ z 9 ·üEăFƒ›¤º�ñÿ4ÿc₫ ưéüKü°ûûuúú²ùˆù{ùmùrù•ùÍùøùFúzúÈúBûÂûFüÉü?ư¦ư-₫¢₫ÿ•ÿ₫ÿr�±�đ�'aƒÅÏÖÆ¬}:ç�¬�m�)�Úÿ‚ÿÿ₫₫ưư¡ü3üàû’ûLû́ú±útú5úêù¼ù•ùˆùù´ù,ú§úUûƠûAüÚü˜ư„₫¹ÿ%²&=ư•>ØÅÆ ” S Ñ F ” | 1 Î  ‹ ́ ̃°‚hˆ¢´´°�~ÿ?₫ôü¸ûú¦ùôøNøă÷[÷ËöVöÓơ‚ơqơơäơ.ödö¯öñög÷ø̉ø¨ù‰úû[üLư)₫đ₫ËÿÎ�i°™6µhå åÖđ̉…ô[í P7óƠb�¢ÿ̀₫ưưTưáü\üÅûû‚úPúGúCúúƠù›ù ùàù-úXúúíúdûöûSü¡üƠüư©ưT₫í₫Iÿÿ̉ÿ*�•�;Yq“Á̉º–kA=Ø�—�0�Ôÿvÿ ÿº₫E₫Ưưyư%ưÁüZüùû¢ûXû-ûûƠú£úvúPúPú}úÛú“û[ü@ư%₫ÿ � Ă:±V)ăm¿4 «   ® I  ©#l¸"“ ars �ºÿ‰₫‚ưŒü ûæú@ú½ù5ù̀øSøú÷÷m÷N÷&÷!÷÷Q÷‘÷øªøVùú ú=ûåû”ü]ư₫¦₫‰ÿ�»·s~ ¯jù>bu‰}4¸Q Æ 3lÇJ¨�×ÿÿj₫ƯưOưü×ûTûûüú û¹úEúèùÎùơù&úHúƒúÑúûxûƠûü>ü“ü ư´ư7₫‘₫Ơ₫ ÿcÿÉÿ$�k�¯�Ù�₫�%CF'38HN+×�x�0��Îÿ‡ÿCÿ̉₫‡₫V₫₫¾ư@ưửüàüØü§ücü üïûåûüzüVư₫̣ÿï�V5D₫ËfÎTøœÿ�-¢₫ di›'̃xkÔÿ  �ÿ₫₫ÈưMưœụ̈ûjûûçú̉ú¯údú$úüùÉùºù”ù’ù úúû£ûü]ü£üư‰ư(₫ă₫ºÿ~�qÿ§;¶HX[]]krœ‘6›Ø;ÉZßvơ�l�ÜÿCÿ¡₫ùưzư-ưñü¯ügüïû}û6ûû#û8ûaû‚û¨û¬û½û̉ûûûFüªüư„ưæư ₫E₫m₫£₫ÿkÿÎÿ+�i�•�Ä�Đ�ä�ö�Y„V"ñ�̉�Â�½�˜�f�K�"�̉ÿÿeÿÿ₫₫ç₫Ó₫³₫y₫Q₫₫₫₫,₫“₫ÿfÿ¦ÿÂÿåÿ�Y�­�û�[Æl©âVƯ÷®vI4 è›Dåˆ-̉�[��ÏÿÿNÿø₫¤₫E₫₫ăưÉư¦ư“ưZư)ưưàüÙüÉüÙüçü ưBưjư†ư”ưĐư₫s₫¿₫ÿaÿÿÍÿa�́�Gq²Ơ :]z²¸™„lO+đ¹l"Í��_�!�ßÿ¯ÿyÿÿµ₫b₫₫Ưư•ưƒư}ưeưBư*ưưư)ưOư^ưTưpưư£ưÈưñư'₫]₫₫₫Í₫ÿ₫5ÿWÿ„ÿ›ÿÇÿîÿ%�A�>�V�T�t�°�º�œ�…�i�_�c�J�?�B�6�2�3�#�ûÿÜÿ°ÿ³ÿºÿªÿ›ÿ’ÿŒÿ‚ÿ‘ÿÿºÿÄÿÎÿíÿ�C�S�y��­�Å�æ�ç� $Hda_T[LW>ö�ç�Ü�´�¡�~�j�M� �êÿÅÿ²ÿ’ÿsÿJÿ8ÿÿú₫â₫Ø₫¸₫•₫œ₫₫—₫–₫ª₫Đ₫Ç₫ă₫í₫ó₫ù₫ø₫ ÿ ÿÿ,ÿ/ÿSÿ„ÿ ÿæÿ�K�q�€�‰�|�t�n�‡�™�¼�̉�Ç�œ�w�g�U�I�8�,�Üÿuÿ_ÿ<ÿ ÿÿù₫÷₫å₫Ư₫Ú₫Í₫©₫¡₫£₫œ₫₫Ÿ₫«₫®₫¯₫£₫•₫«₫´₫Ø₫́₫ù₫ÿÿ ÿÿ<ÿZÿ{ÿ¬ÿØÿ�"�'�G�b�w�¦�Ç�À�Ë�æ�ü� ơ�ÿ�ø�ë�đ�ú�-9XimAû�ë� ø�ö�ê�Ñ�Æ�±�¹�¤�‹�p�8��âÿØÿàÿéÿ×ÿÇÿÿyÿbÿNÿ$ÿ ÿ,ÿ*ÿ4ÿ,ÿ:ÿFÿ?ÿDÿOÿcÿdÿlÿbÿoÿtÿvÿŒÿ«ÿºÿÑÿóÿ��ưÿûÿ́ÿÜÿăÿóÿÿÿ������ � � �6� �%� �&��� �� �� �����đÿàÿ̃ÿÖÿÓÿ������������gnu-octave-octave-audio-125c0f5/inst/erb2hz.m�������������������������������������������������������0000664�0000000�0000000�00000003110�15135415131�0021010�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2023 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {@var{hz} =} erb2hz (@var{erb}) ## Convert equivalent rectangular bandwidth (ERB) to Hz. ## ## @subsubheading Inputs ## @var{erb} - input frequency in erb. ## ## @subsubheading Outputs ## @var{hz} - Output frequency in Hz. ## ## @subsubheading References ## Glasberg and Moore. @cite{Derivation of Auditory Filter Shapes from Notched-Noise Data. ## Hearing Research. Vol. 47, 1990} ## ## @seealso {hz2erb} ## @end deftypefn function hz = erb2hz (erb) persistent A; if nargin < 1 show_usage() endif if ! (isnumeric(erb) && isreal(erb)) error ("Expected real scalar or vector"); endif if isempty (A) A = 1000 * log(10.0) / (24.7*4.37); endif hz = (10^(erb/A) - 1) / 0.00437; endfunction %!error erb2hz() %!error erb2hz('a') %!error erb2hz(2i) %!test %! erb = hz2erb(10); %! hz = erb2hz(erb); %! assert(hz, 10, 100*eps) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/hz2bark.m������������������������������������������������������0000664�0000000�0000000�00000003415�15135415131�0021167�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2023 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {@var{bark} =} hz2bark (@var{hz}) ## Convert hz to equivalent bark frequency ## ## @subsubheading Inputs ## @var{hz} - input frequency in Hz. ## ## @subsubheading Outputs ## @var{bark} - Output frequency as a bark value ## ## @subsubheading Examples ## Convert 4000 Hz to erb ## @example ## @code{erb = hz2erb(4000)} ## @end example ## ## @subsubheading References ## TraunmĂ¼ller, Hartmut. @cite{Analytical Expressions for the Tonotopic Sensory Scale. ## Journal of the Acoustical Society of America. Vol. 88, Issue 1, 1990} ## ## @seealso {bark2hz} ## @end deftypefn function bark = hz2bark(hz) if nargin < 1 show_usage() endif if ! (isnumeric(hz) && isreal(hz)) error ("Expected real scalar or vector"); endif bark = ((26.81 * hz) / (1960 + hz)) - 0.53; idx1 = find(bark<2); idx2 = find(bark>20.1); bark(idx1) = bark(idx1) + 0.15 * (2 - bark(idx1)); bark(idx2) = bark(idx2) + 0.22 * (bark(idx2) - 20.1); endfunction %!error hz2bark() %!error hz2bark('a') %!error hz2bark(2i) %!assert(hz2bark(100), 0.9557, 10^-4) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/hz2erb.m�������������������������������������������������������0000664�0000000�0000000�00000003513�15135415131�0021017�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2023 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {@var{erb} =} hz2erb (@var{hz}) ## Convert hz to equivalent rectangular bandwidth (ERB) ## ## @subsubheading Inputs ## @var{hz} - input frequency in Hz. ## ## @subsubheading Outputs ## @var{erb} - Output frequency as a erb value ## ## @subsubheading Examples ## Convert 4000 Hz to erb ## @example ## @code{erb = hz2erb(4000)} ## @end example ## ## Convert a range of Hz to erb ## @example ## @code {erb = hz2erb(4000:100:5000)} ## @end example ## ## @subsubheading References ## Glasberg and Moore. @cite{Derivation of Auditory Filter Shapes from Notched-Noise Data. ## Hearing Research. Vol. 47, 1990} ## ## @seealso {erb2hz} ## @end deftypefn function erb = hz2erb(hz) persistent A; if nargin < 1 show_usage() endif if ! (isnumeric(hz) && isreal(hz)) error ("Expected real scalar or vector"); endif if isempty (A) A = 1000 * log(10.0) / (24.7*4.37); endif erb = A * log10 (1 + hz * 0.00437); endfunction %!error hz2erb() %!error hz2erb('a') %!error hz2erb(2i) %!assert(hz2erb(5500), 29.8342, 10^-4) %!test %! erb = hz2erb(10); %! hz = erb2hz(erb); %! assert(hz, 10, 100*eps) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/hz2mel.m�������������������������������������������������������0000664�0000000�0000000�00000003241�15135415131�0021022�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2023 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {@var{mel} =} hz2mel (@var{hz}) ## Convert hz to equivalent mel frequency. ## ## @subsubheading Inputs ## @var{hz} - input frequency in Hz. ## ## @subsubheading Outputs ## @var{mel} - Output frequency as a mel value ## ## @subsubheading Examples ## Convert 4000 Hz to mel ## @example ## @code{mel = hz2mel(4000)} ## @end example ## ## Convert a range of Hz to mel ## @example ## @code {mel = hz2erb(4000:100:5000)} ## @end example ## ## @subsubheading References ## O'Shaghnessy, Douglas. @cite{Speech Communication: Human and Machine. Reading, MA: ## Addison-Wesley Publishing Company, 1987} ## ## @seealso {mel2hz} ## @end deftypefn function mel = hz2mel (hz) if nargin < 1 show_usage() endif if ! (isnumeric(hz) && isreal(hz)) error ("Expected real scalar or vector"); endif mel = 2595 * log10 (1 + hz/700); endfunction %!error hz2mel() %!error hz2mel('a') %!error hz2mel(2i) %!assert(hz2mel(440), 549.6387, 10^-4) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/ismidifile.m���������������������������������������������������0000664�0000000�0000000�00000003764�15135415131�0021751�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2019 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {@var{ismidi} =} ismidifile (@var{filename}) ## Check if @var{filename} is a midi file. ## ## The function only checks whether it is an existing file and the ## file starts with a valid 'MThd' header. ## ## Non existing files, or files that do not meet the header criteria will return false. ## ## @subsubheading Inputs ## @var{filename} - filename of file to check.@* ## ## @subsubheading Outputs ## @var{ismidi} - true if it is a midi file, false otherwise ## ## @seealso{midifileread, midifilewrite} ## @end deftypefn function ismidi = ismidifile(filename) ismidi = false; if nargin < 1 error ("Expected filename"); endif fd = -1; try fd = fopen (filename, "rb"); unwind_protect blockhdr = readheader (fd); if !isempty(blockhdr) if strcmp (blockhdr.blocktype, "MThd") ismidi = true; endif endif unwind_protect_cleanup fclose (fd); end_unwind_protect catch # do nothing end_try_catch endfunction %!test %! testname = file_in_loadpath("data/c_maj_melody.mid"); %! assert (ismidifile(testname), true); %!test %! testname = file_in_loadpath("data/sample.wav"); %! assert (ismidifile(testname), false); %!test %! testname = "X_DOES_NOT_EXIST_X"; %! assert (ismidifile(testname), false); ������������gnu-octave-octave-audio-125c0f5/inst/mel2hz.m�������������������������������������������������������0000664�0000000�0000000�00000002776�15135415131�0021036�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2023 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {@var{hz} =} mel2hz (@var{mel}) ## Convert equivalent mel frequency to Hz. ## ## @subsubheading Inputs ## @var{mel} - input frequency in mel. ## ## @subsubheading Outputs ## @var{hz} - Output frequency in Hz. ## ## @subsubheading References ## O'Shaghnessy, Douglas. @cite{Speech Communication: Human and Machine. Reading, MA: ## Addison-Wesley Publishing Company, 1987} ## ## @seealso {hz2mel} ## @end deftypefn function hz = mel2hz (mel) persistent A; if nargin < 1 show_usage() endif if ! (isnumeric(mel) && isreal(mel)) error ("Expected real scalar or vector"); endif hz = 700 * ((10^(mel/2595)) - 1); endfunction %!error mel2hz() %!error mel2hz('a') %!error mel2hz(2i) %!test %! mel = hz2mel(220); %! hz = mel2hz(mel); %! assert(hz, 220, 100*eps) ��gnu-octave-octave-audio-125c0f5/inst/midicallback.m�������������������������������������������������0000664�0000000�0000000�00000006302�15135415131�0022221�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2022 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {@var{oldhandle} =} midicallback (@var{midicontrolsObj}, @var{functionHandle}) ## @deftypefnx {} {@var{oldhandle} =} midicallback (@var{midicontrolsObj}, []) ## @deftypefnx {} {@var{currhandle} =} midicallback (@var{midicontrolsObj}) ## Get, set or clear the midicontrol object callback. ## ## @subsubheading Inputs ## @var{midicontrolObj} - control object created using midicontrols. ## ## @var{functionHandle} - function handle to set for call back. If it is [], ## the callback function will be cleared. ## ## @strong{NOTE}: currently anonymous functions will not work. ## ## @strong{NOTE}: callbacks should be cleared before losing all references to the midicontrols ## object. ## ## @subsubheading Outputs ## @var{oldhandle} The previously set midicallback function handle when setting a new callback. ## ## @var{currhandle} The current set midicallback function handle. ## ## @subsubheading Examples ## Set a callback on a midicontrols object ## @example ## ctrl = midicontrols(2001) ## function dispCallback(ctrl),disp(midiread(ctrl)),endfunction; ## midicallback(ctrl, @@dispCallback); ## @end example ## ## Clear the callback on a midicontrols object ## @example ## ctrl = midicontrols(2001) ## midicallback(ctrl, []); ## @end example ## ## Get the current callback on a midicontrols object ## @example ## ctrl = midicontrols(2001) ## cb = midicallback(ctrl); ## @end example ## ## @seealso{midicontrols, midisync, midiread} ## @end deftypefn function ret = midicallback (ctrlobj, varargin) if nargin < 1 || !isa (ctrlobj, "midicontrols") error ("Expected midicontrols object"); endif if nargin > 1 cb = varargin{1}; if isempty(cb) callback = ""; elseif strcmp(class(cb), "function_handle") info = functions(cb); if strcmp(info.type, "anonymous") error ("anonymous are currently not supported"); endif callback = func2str(cb); elseif ischar (cb) callback = cb; else error ("Callback should be a string or function handle or []") endif ret = ctrlobj.callback(callback); else ret = ctrlobj.callback(); endif endfunction %!function testcallback(ctrl) %! # do nothing %!endfunction %!test %! a = midicontrols(); %! assert(isa(a, "midicontrols")); %! assert(midicallback(a), []); %! assert(midicallback(a, @testcallback), []); %! assert(midicallback(a), func2str(@testcallback)); %! midicallback(a, []); %! assert(midicallback(a), []); %!error <Expected midicontrols object> midicallback(0); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/midicontrols.m�������������������������������������������������0000664�0000000�0000000�00000017423�15135415131�0022336�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2019-2021 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. classdef midicontrols < handle ## -*- texinfo -*- ## @deftypefn {} {@var{obj} =} midicontrols () ## @deftypefnx {} {@var{obj} =} midicontrols (@var{ctrlid}) ## @deftypefnx {} {@var{obj} =} midicontrols (@var{ctrlid}, @var{initialvalues}) ## @deftypefnx {} {@var{obj} =} midicontrols (__, @var{propertyname}, @var{propertyvalue}) ## Create a midi controls object ## ## @subsubheading Inputs ## @var{ctrlid} - single control id or array of control ids to monitor, or [] to use any controller.@* ## @var{initialvalues} - initial values to use for controls. It should be the same size as @var{ctrlid}@* ## @var{propertyname}, @var{propertyvalue} - properties to set on the controller. If a device is not specified ## the value from getpref("midi", "DefaultDevice", 0) will be used.@* ## ## ## Known properties are: ## @table @asis ## @item mididevice ## name of the mididevice to monitor. ## @item outputmode ## the scaling mode for values: 'rawmidi' will return values between 0 .. 127, ## 'normalized' will use values between 0 .. 1. ## @end table ## ## @subsubheading Outputs ## @var{obj} - returns a midicontrols object ## ## @subsubheading Examples ## Create a midicontrols object monitoring control id 2001 on the default midi device ## @example ## ctrl = midicontrols(2001) ## @end example ## ## Create a midicontrols object monitoring control id 2001 on a a non default device ## @example ## ctrl = midicontrols(2001, 'mididevice', 1) ## @end example ## ## @seealso{midiread, midisync} ## @end deftypefn properties (Access = private) controls = []; initialvalue = 0; currentvalue = []; device = []; outscale = 1; midiscale = 127; endproperties methods function this = midicontrols (varargin) devicename = ""; if nargin > 0 controls = varargin{1}; if !isnumeric(controls) error ("Expected numeric controls ids"); endif if isscalar(controls) this.controls = [controls]; else this.controls = controls; endif endif if nargin > 1 if ischar (varargin{2}) propstart = 2; initvals = [0]; else propstart = 3; initvals = varargin{2}; if !isnumeric (initvals) error ("Expected numeric initial values"); endif if isscalar (initvals) initvals = [initvals]; endif endif if mod (nargin-propstart + 1, 2) != 0 error ("midicontrols: expected property name, value pairs"); endif if !iscellstr (varargin (propstart:2:nargin)) error ("midicontrols: expected property names to be strings"); endif for i = propstart:2:nargin propname = tolower (varargin{i}); propvalue = varargin{i+1}; if strcmp (propname, "outputmode") if !ischar (propvalue) error ("output mode should be 'normalized' or 'rawmidi'") elseif strcmpi (propvalue, "normalized") this.outscale = 1; elseif strcmpi (propvalue, "rawmidi") this.outscale = 127; else error ("output mode should be 'normalized' or 'rawmidi'") endif elseif strcmp (propname, "mididevice") devicename = propvalue; else error ("unknown property '%s'", propname) endif endfor this.initialvalue = initvals/this.outscale; endif if length (this.controls) > 0 this.currentvalue = zeros (length(this.controls), 1); else this.currentvalue = zeros (1, 1); endif for i = 1:length (this.currentvalue) this.currentvalue(i) = this.get_value (i, this.initialvalue); endfor if isempty(devicename) devicename = getpref ("midi", "DefaultDevice", 0); endif this.device = mididevice (devicename); endfunction function delete (this) try this.callback(""); catch # do nothing end_try_catch endfunction function send (this, values) if nargin < 2 values = this.initialvalue; else if isscalar(values) values = [values]; endif values = values/this.outscale; endif if isempty(this.controls) warning ('Can not send control values when no specific controller ids were provided.') val = this.get_value(1, values); this.currentvalue(1) = val; else for i =1:length(this.controls) ctrl = this.controls(i); ch = int32(ctrl/1000); id = mod(ctrl, 1000); val = this.get_value(i, values); this.currentvalue(i) = val; midisend(this.device, midimsg("controlchange", ch, id, val*this.midiscale)); endfor endif endfunction function val = recv(this) mx = midireceive(this.device); while !isempty(mx) for j = 1:length(mx) m = mx(j); if strcmp(m.type, "ControlChange") if isempty(this.controls) idx = 1; else ctrlid = m.channel*1000 + double(m.msgbytes(2)); idx = find(this.controls==ctrlid, 1); endif if !isempty(idx) val = double(m.msgbytes(3))/this.midiscale; this.currentvalue(idx) = val; endif endif endfor mx = midireceive(this.device); endwhile val = zeros(length(this.currentvalue)); for i = 1:length(this.currentvalue) val(i) = this.get_value(i, this.currentvalue)*this.outscale; endfor endfunction function val = callback(this, cb=[]) # set/unset callback if nargin < 2 val = __midicallback__(this.device); else if isempty(cb) val = __midicallback__(this.device, cb, []); else val = __midicallback__(this.device, cb, this); endif endif if ischar(val) && isempty(val) val = []; endif endfunction function val = get_value(this, ch, values) if isscalar(values) val = values; else if i > length(values) val = values(i); else val = 0; endif endif val = double(val); endfunction function out = disp (this) if nargout == 0 disp(sprintf (" midicontrols object: listening for events on %s", this.device.Input)); else out = sprintf ("midicontrols object: listening for events on %s\n", this.device.Input); endif if ( isempty(this.controls)) if nargout == 0 disp (" any control"); % any control on {devname} else out = [out " any control\n"]; endif else if nargout == 0 disp ([" controls " sprintf("%d ", this.controls)]); else out = [out " controls " sprintf("%d ", this.controls) "\n"]; endif endif endfunction endmethods endclassdef %!test %! a = midicontrols(); %! assert(isa(a, "midicontrols")); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/mididevice.m���������������������������������������������������0000664�0000000�0000000�00000012726�15135415131�0021733�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2019 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {@var{dev} =} mididevice (@var{mididev}) ## @deftypefnx {} {@var{dev} =} mididevice (@var{mididir}, @var{mididev}) ## @deftypefnx {} {@var{dev} =} mididevice ("input", @var{midiindev}, "output", @var{midioutdev}) ## Create a midi device using the input parameters. ## ## When a single device name or id is provided, attempt to create the midi device using the same name for both input and output. ## ## Otherwise, use the name or device id for the given input or output direction. ## ## @subsubheading Inputs ## @var{mididev} - name or id of device to load.@* ## @var{mididir} - midi direction of "input" or "output"@* ## @var{midiindev} - midi input name or id@* ## @var{midioutdev} - midi output name or id ## ## @subsubheading Outputs ## @var{dev} - octave_midi class for opened device ## ## @subsubheading Properties ## @var{Input} - Input device name (read only).@* ## @var{Output} - Output device name (read only).@* ## @var{InputID} - Input device id (read only).@* ## @var{OutputID} - Output device id (read only).@* ## ## @subsubheading Examples ## Open midi device with ID of 0. ## @example ## @command{>} dev = mididevice(0); ## ## mididevice connected to ## input: "SparkFun Pro Micro:SparkFun Pro Micro MIDI 1 20:0" (1) ## output: "SparkFun Pro Micro:SparkFun Pro Micro MIDI 1 20:0" (0) ## @end example ## ## Open a named midi device: ## @example ## @command{>} dev = mididevice("SparkFun Pro Micro:SparkFun Pro Micro MIDI 1 20:0"); ## ## mididevice connected to ## input: "SparkFun Pro Micro:SparkFun Pro Micro MIDI 1 20:0" (1) ## output: "SparkFun Pro Micro:SparkFun Pro Micro MIDI 1 20:0" (0) ## @end example ## ## @seealso{mididevinfo} ## @end deftypefn function dev = mididevice (varargin) inname = ""; outname = ""; if nargin != 1 && nargin != 2 && nargin != 4 error ("Expected device name, or device type/value pair"); endif # dev list devs = __mididevinfo__ (); if nargin == 1 if isscalar (varargin{1}) name = devs (varargin{1}+1).Name; elseif ischar (varargin{1}) name = varargin{1}; endif # get in and out info idx = find (arrayfun(@(x) match_name_and_type(x, name, "input"), devs), 1); if !isempty (idx) indev = devs (idx); inname = indev.Name; endif idx = find (arrayfun(@(x) match_name_and_type(x, name,"output"), devs), 1); if !isempty (idx) outdev = devs (idx); outname = outdev.Name; endif elseif nargin == 2 # type device (input, output) # dev num or name if isscalar (varargin{2}) name = devs (varargin{2}+1).Name; elseif ischar (varargin{2}) name = varargin{2}; endif inname = ""; outname = ""; if strcmpi (varargin{1}, "input") inname = name; elseif strcmpi (varargin{1}, "output") outname = name; else error ("expected input or output"); endif if !isempty(inname) idx = find (arrayfun(@(x) match_name_and_type(x, name,"input"), devs), 1); if !isempty (idx) indev = devs (idx); inname = indev.Name; else error ("unknown name %s", inname); endif endif if !isempty(outname) idx = find (arrayfun(@(x) match_name_and_type(x, name,"output"), devs), 1); if !isempty (idx) outdev = devs (idx); outname = outdev.Name; else error ("unknown name %s", outname); endif endif else # nargin == 4 # an input and output device specified if isscalar (varargin{2}) name = devs (varargin{2}+1).Name; elseif ischar (varargin{2}) name = varargin{2}; endif if strcmpi (varargin{1}, "input") inname = name; elseif strcmpi (varargin{1}, "output") outname = name; else error ("expected input or output"); endif if isscalar (varargin{4}) name = devs (varargin{4}+1).Name; elseif ischar (varargin{4}) name = varargin{4}; endif if strcmpi (varargin{3}, "input") inname = name; elseif strcmpi (varargin{3}, "output") outname = name; else error ("expected input or output"); endif idx = find (arrayfun(@(x) match_name_and_type(x, outname,"output"), devs), 1); if !isempty (idx) outdev = devs (idx); outname = outdev.Name; else error ("unknown name %s", outname); endif idx = find (arrayfun(@(x) match_name_and_type(x, inname,"input"), devs), 1); if !isempty (idx) indev = devs(idx); inname = indev.Name; else error ("unknown name %s", inname); endif endif dev = __mididevice__ (inname, outname); endfunction function t = match_name_and_type(x, name, type) t = (strncmpi(x.Name, name, length(name)) && strcmpi(x.Direction,type)); endfunction %!test %! a = mididevice(0); %! assert(isa(a, "octave_midi")); ������������������������������������������gnu-octave-octave-audio-125c0f5/inst/mididevinfo.m��������������������������������������������������0000664�0000000�0000000�00000006410�15135415131�0022117�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2019-2021 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {@var{devlist} =} mididevinfo () ## @deftypefnx {} {} mididevinfo () ## Retrieve the midi devices detected within the system. ## ## The list will be stored with variable @var{devlist} as either a input or output device. ## If no output variable is provided, the devices will be displayed. ## ## @subsubheading Inputs ## None ## ## @subsubheading Outputs ## @var{devlist} - a structure containing the midi device information ## ## @subsubheading Examples ## Display the known devices of the system. ## @example ## @command{>} mididevinfo ## ## MIDI devices available ## ID Direction Interface Name ## 0 output Alsa Midi Through:Midi Through Port-0 14:0 ## 1 output Alsa Ensoniq AudioPCI:ES1371 16:0 ## 2 output Alsa SparkFun Pro Micro:SparkFun Pro Micro MIDI 1 20:0 ## 3 input Alsa Midi Through:Midi Through Port-0 14:0 ## 4 input Alsa Ensoniq AudioPCI:ES1371 16:0 ## 5 input Alsa SparkFun Pro Micro:SparkFun Pro Micro MIDI 1 20:0 ## @end example ## ## Assign variable @var{mididevices} with the values from the known devices ## @example ## @command{>} mididevices = mididevinfo ## ## mididevices = ## scalar structure containing the fields: ## input = ## @{ ## [1,1] = ## scalar structure containing the fields: ## Name = SparkFun Pro Micro:SparkFun Pro Micro MIDI 1 20:0 ## Interface = Alsa ## ID = 0 ## @} ## output = ## @{ ## [1,1] = ## scalar structure containing the fields: ## Name = SparkFun Pro Micro:SparkFun Pro Micro MIDI 1 20:0 ## Interface = Alsa ## ID = 1 ## @} ## @end example ## ## @seealso{mididevice} ## @end deftypefn function out = mididevinfo () # get dev list data = __mididevinfo__(); # output variable to store to - so assign devices to it if nargout > 0 out = {}; out.input = {}; out.output = {}; for i=1:length(data) val = {}; val.Name = data(i).Name; val.Interface = data(i).Interface; val.ID = data(i).ID; if strcmp (data(i).Direction, "input") out.input{end+1} = val; else out.output{end+1} = val; endif endfor # no output - just display the devices else printf ("MIDI devices available\n"); printf ("ID Direction Interface Name\n"); for i=1:length(data) printf ("%2d %-9s %-10s %s\n", data(i).ID, data(i).Direction, data(i).Interface, data(i).Name); endfor endif endfunction %!test %! a = mididevinfo; %! assert(length(a) > 0); %! x = a.input; %! x = a.output; ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/midifileinfo.m�������������������������������������������������0000664�0000000�0000000�00000012702�15135415131�0022261�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2019-2021 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {@var{info} =} midifileinfo (@var{filename}) ## Read MIDI file and display information about the tracks and data ## ## @subsubheading Inputs ## @var{filename} - filename of file to open.@* ## ## @subsubheading Outputs ## @var{info} - structure of the midi file data ## with the following fields:@* ## @table @asis ## @item filename ## the name of the file ## @item header ## The header block information ## @item track ## An array of tracks read from the file ## @item other ## An array of non-track midi blocks read from the file ## @end table ## @seealso{midifileread} ## @end deftypefn function mi = midifileinfo(filename) if nargin < 1 error ("Expected filename"); endif mi = {}; mi.filename = filename; mi.header = {}; mi.track = {}; mi.other = {}; fd = fopen(filename, "rb"); blockidx = 0; unwind_protect # read file while !feof(fd) blockhdr = readheader (fd); if !isempty (blockhdr) nextpos = ftell (fd) + blockhdr.blocksize; if strcmp (blockhdr.blocktype, "MThd") hdr = {}; hdr.format = fread (fd, 1, "uint16", 0, "ieee-be"); hdr.tracks = fread (fd, 1, "uint16", 0, "ieee-be"); frames = fread (fd, 1, "uint8"); ticks = fread (fd, 1, "uint8"); if frames > 127 hdr.tick_resolution = double(256-frames) * ticks; else hdr.ticks_per_qtr = polyval(double([frames ticks]), 256); endif hdr.ticks = ticks; hdr.frames = frames; mi.header = hdr; elseif strcmp (blockhdr.blocktype, "MTrk") cmd = 0; track = {}; track.number = length (mi.track) + 1; track.blockindex = blockidx; track.blocksize = blockhdr.blocksize; track.blockstart = ftell(fd); while ftell (fd) < nextpos t = getvariable(fd); tcmd = fread (fd,1, "uint8"); if tcmd >= 0x80 cmd = tcmd; else # repeat same command, so with is a data byte fseek (fd,-1,'cof'); endif if cmd >= 0xf0 subcmd = cmd; else subcmd = bitand (cmd, 0xF0); endif switch subcmd case 0xff ctype = fread (fd, 1, "uint8"); ct = getvariable (fd); data = fread (fd, [1 ct], "uint8"); if ctype == 0 [ "seq: " char(data) ] elseif ctype == 1 track.text{end+1} = char(data); elseif ctype == 2 track.copyright = char(data); elseif ctype == 3 track.trackname = char(data); elseif ctype == 4 track.instrument = char(data); elseif ctype == 5 track.lyric{end+1} = char(data); elseif ctype == 6 #[ "marker: " char(data) ] elseif ctype == 7 #[ "cue: " char(data) ] else #[ num2str (ctype) ": " data ] endif case {0xf1, 0xf3} sz = 1; data = fread(fd, [1 sz], "uint8"); case {0xf2} sz = 2; data = fread(fd, [1 sz], "uint8"); case {0xf6, 0xf7, 0xf8, 0xfa, 0xfb, 0xfc, 0xfe} # nothing additional to get case {0xf0} ct = getvariable (fd); data = fread (fd, [1 ct], "uint8"); case { 0x80, 0x90, 0xB0, 0xE0} sz = 2; data = fread (fd, [1 sz], "uint8"); case { 0xC0, 0xD0} sz = 1; data = fread (fd, [1 sz], "uint8"); otherwise error ("unknown command now %2X", cmd); endswitch endwhile mi.track{end+1} = track; else track = {}; track.blockindex = blockidx; track.blocksize = blockhdr.blocksize; track.blockstart = ftell(fd); track.blocktype = blockhdr.blocktype mi.other{end+1} = track; endif blockidx = blockidx + 1; fseek (fd, nextpos, 'bof'); endif endwhile unwind_protect_cleanup fclose (fd); end_unwind_protect endfunction %!shared testname %! testname = file_in_loadpath("data/c_maj_melody.mid"); %!test %! info = midifileinfo(testname); %! t = info.header; %! assert(info.header.format, 1); %! assert(info.header.tracks, 2); %! assert(info.header.ticks_per_qtr, 480); %! assert(info.header.ticks, 224); %! assert(info.header.frames, 1); %! assert(length(info.track), 2); %! assert(length(info.other), 0); ��������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/midifileread.m�������������������������������������������������0000664�0000000�0000000�00000020377�15135415131�0022250�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2019-2021 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {@var{msg} =} midifileread (@var{filename}, [propertyname, propertyvalue @dots{}]) ## Read MIDI file into a midimsg ## ## @subsubheading Inputs ## @var{filename} - filename of file to open.@* ## @var{propertyname}, @var{properyvalue} - optional propertyname/value pairs.@* ## ## Known property values are: ## @table @asis ## @item includemetaevents ## A True/False value to include MetaEvents in the out message list. ## @end table ## ## @subsubheading Outputs ## @var{msg} - a midimsg struct containing the messages read from the file@* ## @seealso{midifileinfo, midimsg} ## @end deftypefn function msg = midifileread(filename, varargin) if nargin < 1 error ("Expected filename"); endif debug = 0; includemetaevents = 0; abstime = 0; format = 0; tempo = 6e7/120; msg = midimsg(0); if mod (nargin + 1, 2) != 0 error ("midifileread: expected property name, value pairs"); endif if !iscellstr (varargin (1:2:nargin-1)) error ("midicontrols: expected property names to be strings"); endif for i = 1:2:nargin-1 propname = tolower (varargin{i}); propvalue = varargin{i+1}; if strcmp (propname, "debug") if !(isnumeric (propvalue) || islogical(propvalue)) || !isscalar(propvalue) error ("debug should be boolean") else debug = propvalue; endif elseif strcmp (propname, "includemetaevents") if !(isnumeric (propvalue) || islogical(propvalue))|| !isscalar(propvalue) error ("includemetaevents should be boolean") else includemetaevents = propvalue; endif else error ("unknown property '%s'", propname) endif endfor # TODO: handle time stamp AND fact that different formats offset time stamp differently between tracks fd = fopen (filename, "rb"); unwind_protect # read file while !feof (fd) blockhdr = readheader (fd); if !isempty(blockhdr) nextpos = ftell (fd) + blockhdr.blocksize; if strcmp (blockhdr.blocktype, "MThd") format = fread (fd, 1, "uint16", 0, "ieee-be"); tracks = fread (fd, 1, "uint16", 0, "ieee-be"); frames = fread (fd, 1, "uint8"); ticks = fread (fd, 1, "uint8"); if frames > 127 tick_resolution = double(256-frames) * ticks; else ticks_per_qtr = polyval(double([frames ticks]), 256); endif endif if strcmp (blockhdr.blocktype, "MTrk") if format == 1 abstime = 0; endif cmd = 0; while ftell (fd) < nextpos t = getvariable(fd); if frames > 127 t = t / tick_resolution; else t = t * (tempo/ticks_per_qtr)/1e6; endif abstime = abstime + t; tcmd = fread (fd,1, "uint8"); if tcmd >= 0x80 cmd = tcmd; else # repeat same command, so with is a data byte fseek (fd,-1,'cof'); endif if cmd >= 0xf0 subcmd = cmd; else subcmd = bitand (cmd, 0xF0); endif switch subcmd # TODO: convert to midi messages case 0xff # example # ff00 1003 7741 7961 6920 0000020 206e 2061 614d 676e 7265 ctype = fread (fd, 1, "uint8"); ct = getvariable (fd); data = fread (fd, [1 ct], "uint8"); if debug if ctype == 0 [ "seq: " char(data) ] elseif ctype == 1 [ "text: " char(data) ] elseif ctype == 2 [ "copyright: " char(data) ] elseif ctype == 3 [ "track name: " char(data) ] elseif ctype == 4 [ "instrument: " char(data) ] elseif ctype == 5 [ "lyric: " char(data) ] elseif ctype == 6 [ "marker: " char(data) ] elseif ctype == 7 [ "cue: " char(data) ] elseif ctype == 0x21 [ "midiport: " sprintf("%02X ", data) ] elseif ctype == 0x51 t = polyval(double(data), 256); [ "tempo: " num2str(t) ] elseif ctype == 0x54 [ "smtpe: " sprintf("%02X ", data) ] elseif ctype == 0x58 [ "timesig: " sprintf("%02X ", data) ] elseif ctype == 0x2f [ "eot:" ] elseif ctype == 0x59 [ "keysig: " sprintf("%02X ", data) ] else [ "unknown: " sprintf("%d (%02X): ", ctype, ctype) sprintf("%02X ", data) ] endif endif if ctype == 0x51 tempo = polyval(double(data), 256); endif if includemetaevents msg = [msg midimsg.createMessage(uint8([cmd ctype midimsg.makevariable(ct) data]), abstime)]; endif case {0xf1, 0xf3} sz = 1; data = fread(fd, [1 sz], "uint8"); msg = [msg midimsg.createMessage(uint8([cmd data]), abstime)]; case {0xf2} sz = 2; data = fread(fd, [1 sz], "uint8"); msg = [msg midimsg.createMessage(uint8([cmd data]), abstime)]; case {0xf6, 0xf7, 0xf8, 0xfa, 0xfb, 0xfc, 0xfe} msg = [msg midimsg.createMessage(uint8([cmd]), abstime)]; case {0xf0} ct = getvariable (fd); data = fread (fd, [1 (ct-1)], "uint8"); eox = fread (fd, [1 1], "uint8"); msg = [msg midimsg.createMessage(uint8([cmd]), abstime) ... midimsg.createMessage(uint8([data]), abstime) ... midimsg.createMessage(uint8([eox]), abstime)]; case { 0x80, 0x90, 0xA0, 0xB0, 0xE0} sz = 2; data = fread (fd, [1 sz], "uint8"); msg = [msg midimsg.createMessage(uint8([cmd data]), abstime)]; case { 0xC0, 0xD0} sz = 1; data = fread(fd, [1 sz], "uint8"); msg = [msg midimsg.createMessage(uint8([cmd data]), abstime)]; otherwise # now what err = dec2hex (fread(fd,5, "uint8")); error ("unknown command now %2X", cmd) endswitch endwhile endif fseek (fd, nextpos, 'bof'); endif endwhile # so now should have list of midi data using absolute time in secs # with all channels concated together # so sort into time order msg = sort(msg); unwind_protect_cleanup fclose (fd); end_unwind_protect endfunction %!shared testname %! testname = file_in_loadpath("data/c_maj_melody.mid"); %!test %! msg = midifileread(testname); %! assert(length(msg), 70); %! assert(msg(1).type == "ResetAllControllers"); %! assert(msg(1).timestamp, 0); %! assert(msg(length(msg)).type == "NoteOn"); %! assert(msg(length(msg)).timestamp, 7.9739583, 5e-7); %!test %! msg = midifileread(testname, 'includemetaevents', true); %! assert(length(msg), 77); %! assert(msg(1).type == "MetaEvent"); %! assert(msg(1).timestamp, 0); %! assert(msg(length(msg)).type == "MetaEvent"); %! assert(msg(length(msg)).timestamp, 7.975, 5e-7); %!fail midifileread(testname, "1name"); %!fail midifileread(); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/midifilewrite.m������������������������������������������������0000664�0000000�0000000�00000017362�15135415131�0022467�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2019-2021 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {} midifilewrite (@var{filename}, @var{msgs}) ## @deftypefnx {} {} midifilewrite (@var{filename}, @var{msgs}, @var{optionname}, @var{optionvalue}) ## Write a midifile ## ## @subsubheading Inputs ## @var{filename} - filename of file to open.@* ## @var{msg} - a midimsg struct or a cell array of midimsg containing data to write to file@* ## @var{optionname}, @var{optionvalue} - option value/name pairs@* ## ## Known options are: ## @table @asis ## @item format ## MIDI file format number. (0 (default), 1, 2) ## @end table ## ## Where format is 0, if a cell array is passed to midifilewrite, the midimsg values will ## be concatenated together before saving. ## ## Were format is not 0, the cell array is treated as tracks of misimsg. ## ## @subsubheading Outputs ## None ## @seealso{midifileread, midimsg} ## @end deftypefn function midifilewrite(varargin) if nargin < 2 error ("Expected filename and messages"); endif filename = varargin{1}; msg = varargin{2}; if iscell(msg) for idx=1:length(msg) if !isa(msg{idx}, "midimsg") error ("Expected midimsg type messages in cell array"); endif endfor elseif !isa(msg, "midimsg") error ("Expected midimsg type messages"); endif if mod (nargin, 2) != 0 error ("midifilewrite: expected property name, value pairs"); endif if !iscellstr (varargin (3:2:nargin)) error ("midifilewrite: expected property names to be strings"); endif format = 0; for idx = 3:2:nargin propname = tolower (varargin{idx}); propvalue = varargin{idx+1}; if strcmp(propname, "format") if isnumeric(propvalue) format = int16(propvalue); else format = -1; endif if format != 1 && format != 2 && format != 0 error ("format must be one of 0,1,2"); endif else warning("Unknown option '%s' ignored", propname) endif endfor if format == 0 trackcnt = 1; # if we had a cell string, make a single track list if iscell(msg) cellmsg = msg; msg = midimsg(0); for idx=1:length(cellmsg) msg = [msg cellmsg{idx}]; endfor endif else # multi track mode, so make us a cell array if ! iscell(msg) msg = {msg}; endif trackcnt = length(msg); endif fd = fopen (filename, "wb"); unwind_protect # block hdr hdr = {}; hdr.blocksize = 6; hdr.blocktype = "MThd"; writeheader (fd, hdr); # info ticks_per_qtr = 1e3; frames = floor(ticks_per_qtr/256); ticks = mod(ticks_per_qtr, 256); fwrite (fd, format, "uint16", 0, "ieee-be"); fwrite (fd, trackcnt, "uint16", 0, "ieee-be"); fwrite (fd, frames, "uint8"); fwrite (fd, ticks, "uint8"); tempo = 6e7/120; if format == 0 # the tracks fixpos = ftell (fd); hdr.blocksize = 0; hdr.blocktype = "MTrk"; writeheader (fd, hdr); lasttime = []; la = []; for idx=1:length(msg) a = msg(idx); # on first time, set lasttime if isempty(lasttime) lasttime = a.timestamp; endif if a.timestamp >= lasttime ts = (a.timestamp - lasttime); else ts = a.timestamp; endif lasttime = lasttime + ts; ts = (ts*1e6)/(tempo/ticks_per_qtr); if !isempty(la) && la.msgbytes(1) == 0xF0 # sysex msg previously started sz = length(a.msgbytes) + 1; setvariable (fd, sz); fwrite (fd, a.msgbytes); fwrite (fd, uint8([0xF7])); elseif !isempty(a) && a.msgbytes(1) != 0xF7 setvariable (fd, ts); fwrite (fd, a.msgbytes); # tempo meta event if a.msgbytes(1) == 0xFF && a.msgbytes(2) == 0x51 # FF 51 3 TT TT TT tempo = polyval(double(a.msgbytes(4:end)), 256); endif endif la = a; endfor # write eot and fix the header fwrite (fd, uint8([0x01 0xff 0x2f 0x00])); # fix the size of the track cpos = ftell (fd); len = cpos - fixpos - 8; fseek (fd, fixpos, SEEK_SET); hdr.blocksize = len; hdr.blocktype = "MTrk"; writeheader (fd, hdr); fseek (fd, cpos, SEEK_SET); else # the tracks for t=1:length(msg) fixpos = ftell (fd); hdr.blocksize = 0; hdr.blocktype = "MTrk"; writeheader (fd, hdr); lasttime = []; m = msg{t}; la = []; for idx=1:length(m) a = m(idx); # on first time, set lasttime if isempty(lasttime) lasttime = a.timestamp; endif if a.timestamp >= lasttime ts = (a.timestamp - lasttime); else ts = a.timestamp; endif lasttime = lasttime + ts; ts = (ts*1e6)/(tempo/ticks_per_qtr); if !isempty(la) && la.msgbytes(1) == 0xF0 # sysex msg previously started sz = length(a.msgbytes) + 1; setvariable (fd, sz); fwrite (fd, a.msgbytes); fwrite (fd, uint8([0xF7])); elseif !isempty(a) && a.msgbytes(1) != 0xF7 setvariable (fd, ts); fwrite (fd, a.msgbytes); endif la = a; endfor # write eot and fix the header fwrite (fd, uint8([0x01 0xff 0x2f 0x00])); # fix the size of the track cpos = ftell (fd); len = cpos - fixpos - 8; fseek (fd, fixpos, SEEK_SET); hdr.blocksize = len; hdr.blocktype = "MTrk"; writeheader (fd, hdr); fseek (fd, cpos, SEEK_SET); endfor endif unwind_protect_cleanup fclose (fd); end_unwind_protect endfunction %!shared testname %! testname = tempname; %!test %! data = midimsg("note", 1, 60, 100, 2); %! midifilewrite(testname, data); %! info = midifileinfo(testname); %! t = info.header; %! assert(info.header.format, 0); %! assert(info.header.tracks, 1); %! msg = midifileread(testname); %! assert(msg(1).msgbytes, uint8([0x90 0x3C 0x64])); %! assert(msg(2).msgbytes, uint8([0x90 0x3C 0x00])); %! assert(msg(2).timestamp, 2); %!test %! data = midimsg("note", 1, 60, 100, 2); %! %! midifilewrite(testname, data, 'format', 0); %! info = midifileinfo(testname); %! assert(info.header.format, 0); %! assert(info.header.tracks, 1); %! msg = midifileread(testname); %! assert(length(msg), 2); %! %! midifilewrite(testname, data, 'format', 1); %! info = midifileinfo(testname); %! assert(info.header.format, 1); %! assert(info.header.tracks, 1); %! msg = midifileread(testname); %! assert(length(msg), 2); %! %! midifilewrite(testname, {data, data}, 'format', 0); %! info = midifileinfo(testname); %! assert(info.header.format, 0); %! assert(info.header.tracks, 1); %! msg = midifileread(testname); %! assert(length(msg), 4); %! %! midifilewrite(testname, {data, data}, 'format', 1); %! info = midifileinfo(testname); %! assert(info.header.format, 1); %! assert(info.header.tracks, 2); %! msg = midifileread(testname); %! assert(length(msg), 4); %!test %! if exist (testname, 'file'); %! delete (testname); %! end ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/midiflush.m����������������������������������������������������0000664�0000000�0000000�00000002663�15135415131�0021614�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2022 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {} midiflush (@var{dev}) ## Flush the receive buffers on a midi device ## ## @subsubheading Inputs ## @var{dev} - midi device opened using mididevice@* ## ## @subsubheading Outputs ## None ## ## @subsubheading Examples ## Flush a midi device ## @example ## midiflush(dev); ## @end example ## ## @seealso{mididevice, midireceive} ## @end deftypefn function midiflush (dev) if nargin != 1 error ("Expected midi device"); endif if !isobject(dev) || !strcmp(typeinfo(dev), "octave_midi") error ("Expected midi device"); endif __midiflush__(dev); endfunction %!test %! a = mididevice(0); %! assert(isa(a, "octave_midi")); %! midiflush(a); %!error <Expected midi device> midiflush(0) �����������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/midiid.m�������������������������������������������������������0000664�0000000�0000000�00000005052�15135415131�0021062�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2019-2021 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {[@var{ctrlid}, @var{devname}] =} midiid () ## Scan for control messages from midi devices to get the id of the device ## ## Function will display a prompt for the user to move the midi control and return when ## a control messages is detected or ctrl-C is pressed. ## ## @subsubheading Inputs ## None ## ## @subsubheading Outputs ## @var{ctrlid} - control id made from the controller channel * 1000 + controller number.@* ## @var{devname} = name of the midi device the controller was detected on. ## ## @subsubheading Examples ## Monitor midi devices for first moving controller ## @example ## [ctrlid, devname] = midiid() ## @end example ## ## @seealso{mididevinfo, midicontrols} ## @end deftypefn function [ctrlid, devname] = midiid () ctrlid = 0; devname = ""; # get the input devices devs = __mididevinfo__ (); idx = find (arrayfun(@(x) strcmpi(x.Direction, "input"), devs)); devices = {}; unwind_protect # open input devs for i = idx di = devs(i); di.device = mididevice("input", di.Name); devices{end+1} = di; endfor # clear pending data for i = 1:length(devices) m = midireceive(devices{i}.device); m = midireceive(devices{i}.device); endfor printf("Move the control you wish to identify; Press Ctrl-C to abort\n"); printf("Waiting for control message...\n"); # poll looking for control messages while ctrlid == 0 for i = 1:length(devices) mx = midireceive(devices{i}.device); for j = 1:length(mx) m = mx(j); if strcmp(m.type, "ControlChange") ctrlid = m.channel*1000 + double(m.msgbytes(2)); devname = devices{i}.Name; endif endfor endfor pause (0.1) endwhile unwind_protect_cleanup clear devices end_unwind_protect endfunction ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/midimsg.m������������������������������������������������������0000664�0000000�0000000�00000212701�15135415131�0021255�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2019-2021 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. classdef midimsg ## -*- texinfo -*- ## @deftypefn {} {@var{msg} =} midimsg (0) ## @deftypefnx {} {@var{msg} =} midimsg () ## @deftypefnx {} {@var{msg} =} midimsg (@var{type} ....) ## @deftypefnx {} {@var{msg} =} midimsg ("note", @var{channel}, @var{note}, @var{velocity}, @var{duration}, @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("noteon", @var{channel}, @var{note}, @var{velocity}, @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("noteoff", @var{channel}, @var{note}, @var{velocity}, @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("programchange", @var{channel}, @var{prog}, @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("controlchange", @var{channel}, @var{ccnum}, @var{ccval}, @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("polykeypressure", @var{channel}, @var{note}, @var{keypressure}, @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("channelpressure", @var{channel}, @var{chanpressure}, @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("localcontrol", @var{channel}, @var{localcontrol}, @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("pitchbend", @var{channel}, @var{pitchchange}, @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("polyon", @var{channel}, @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("monoon", @var{channel}, @var{monochannels}, @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("omnion", @var{channel}, @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("omnioff", @var{channel}, @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("allsoundoff", @var{channel}, @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("allnotesoff", @var{channel}, @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("resetallcontrollers", @var{channel}, @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("start", @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("stop", @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("continue", @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("systemreset", @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("activesensing", @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("timingclock", @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("systemexclusive", @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("systemexclusive", @var{bytes}, @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("eox", @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("data", @var{bytes}, @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("songselect", @var{song}, @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("songpositionpointer", @var{songposition}, @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("tunerequest", @var{timestamp}) ## @deftypefnx {} {@var{msg} =} midimsg ("miditimecodequarterframe", @var{timeseq}, @var{timevalue}, @var{timestamp}) ## Create a midimsg object ## ## If the input parameter is 0, create an empty midi message object ## Otherwise the first variable is the type of message to create, followed by the additional ## parameters for the message. ## ## For each message type, the timestamp value is optional. ## ## @subsubheading Inputs ## @var{type} - string message type or a midimsgtype.@* ## @var{timestamp} - optional seconds time stamp for the event@* ## @var{channel} - the channel to use for the message (1..16)@* ## @var{note} - the value of the note to play/stop@* ## @var{velocity} - the velocity value for a note on/off, with 0 stopping a note from sounding.@* ## @var{duration} - seconds between starting and stopping a note when created a 'note' message.@* ## @var{prog} - program number when doing a program change message.@* ## @var{ccnum} - control change control number.@* ## @var{ccval} - control change control value.@* ## @var{keypressure} - key pressure value when creating a key pressure message.@* ## @var{chanpressure} - channel pressure value when creating a channelpressure message.@* ## @var{pitchchange} - pitch change value when creating a pitch bend message.@* ## @var{localcontrol} - boolean value when creating a localcontrol message.@* ## @var{monochannels} - channels specified for a mono on message.@* ## @var{bytes} - array of data in range of 0 to 127 specified as part of a data message or ## system exclusive message.@* ## @var{song} - song selection number for a song selection message.@* ## @var{songposition} - song position value for a song position message.@* ## @var{timeseq} - timecode sequence number for a miditimecodequarterframe message.@* ## @var{timevalue} - timecode value number for a miditimecodequarterframe message.@* ## ## In the case where no inputs are provides, a midimsg 'data' message is created. ## ## @subsubheading Outputs ## @var{msg} - a midimsg object containing the midi data of the message ## ## @subsubheading Properties ## @var{timestamp} - timestamp of the message, or an array or timestamps if the the message is a ## compound message.@* ## @var{msgbytes} - the raw message bytes that make up the MIDI message.@* ## @var{nummsgbytes} - the number of message bytes that make up the MIDI message.@* ## @var{type} - string or midimsgtype that represents the message type.@* ## @var{channel} - the channel number for message.@* ## @var{note} - the note value for message (Only valid for noteon/off and polykeypressure).@* ## @var{velocity} - the velocity value for message (Only valid for noteon/off).@* ## @var{keypressure} - the keypressure value for message (Only valid for polykeypressure).@* ## @var{channelpressure} - the chanpressure value for message (Only valid for channelpressure).@* ## @var{localcontrol} - the localcontrol value for message (Only valid for localcontrol messages).@* ## @var{monochannels} - channels specified for a mono on message.@* ## @var{program} - program number specified for a program change message.@* ## @var{ccnumber} - control change number specified for a control change message.@* ## @var{ccvalue} - control change value specified for a control change message.@* ## @var{song} - song number for a song selection message.@* ## @var{songposition} - song position value for a song position message.@* ## @var{pitchchange} - pitch change value for a pitch bend message.@* ## @var{timecodesequence} - timecode sequence number for a miditimecodequarterframe message.@* ## @var{timecodevalue} - timecode value number for a miditimecodequarterframe message.@* ## ## @subsubheading Examples ## Create a note on/off pair with a duration of 1.5 seconds ## @example ## msg = midimsg('note', 1, 60, 100, 1.5) ## @end example ## ## Create a separate note on/off pair with a time between them of 1.5 seconds ## @example ## msg = [midimsg('noteon', 1, 60, 100, 0), midimsg('noteoff', 1, 60, 0, 1.5)] ## @end example ## ## Create a system reset message ## @example ## msg = midimsg('systemreset') ## @end example ## ## @seealso{midifileread, midisend, midireceive, midimsgtype} ## @end deftypefn properties (SetAccess = private, GetAccess = public) data = {}; timestamp = {}; endproperties properties (SetAccess = private, GetAccess = public) type; endproperties methods function this = midimsg (typev, varargin) this.data = {}; this.timestamp = {}; if nargin == 0 this.timestamp{end+1} = 0; this.data{end+1} = uint8([0 0 0 0 0 0 0 0]); return elif nargin < 1 || (! ischar (typev) && !isscalar (typev) && ! (class(typev) == "midimsgtype")) error ("Expected midi type or size"); endif if strcmp (class(typev), "midimsgtype") typev = char(typev); elseif isscalar (typev) if typev == 0 return; else error ("Non zero size not supported yet"); endif endif typev = lower (typev); switch typev case "noteon" # channel,note,velocity,timestamp if nargin < 4 error ('noteon expects at least channel,note,velocity') endif # TODO: change channel to be 1 indexed chan = this.check_channel(varargin{1})-1; note = this.check_value127("note", varargin{2}); vel = this.check_value127("velocity", varargin{3}); timestamp = 0; if nargin > 4 timestamp = this.check_timestamp(varargin{4}); endif this.data{end+1} = uint8 ([bitor(0x90, chan), note, vel]); this.timestamp{end+1} = timestamp; case "noteoff" # channel,note,velocity,timestamp if nargin < 4 error ('noteoff expects at least channel,note,velocity') endif chan = this.check_channel(varargin{1})-1; note = this.check_value127("note", varargin{2}); vel = this.check_value127("velocity", varargin{3}); timestamp = 0; if nargin > 4 timestamp = this.check_timestamp(varargin{4}); endif this.data{end+1} = uint8 ([bitor(0x80, chan), note, vel]); this.timestamp{end+1} = timestamp; case "note" # channel,note,velocity,duration, timestamp if nargin < 5 error ('note expects at least channel,note,velocity,duration') endif chan = this.check_channel(varargin{1})-1; note = this.check_value127("note", varargin{2}); vel = this.check_value127("velocity", varargin{3}); dur = varargin{4}; if !isscalar(dur) || !isnumeric(dur) || dur < 0 error ('note expects at least duration to be a number >= 0') endif timestamp = 0; if nargin > 5 timestamp = this.check_timestamp(varargin{5}); endif this.data{end+1} = uint8 ([bitor(0x90, chan), note, vel]); this.timestamp{end+1} = timestamp; timestamp = timestamp + dur; this.data{end+1} = uint8 ([bitor(0x90, chan), note, 0]); this.timestamp{end+1} = timestamp; case "programchange" # channel,prog, timestamp if nargin < 3 error ('programchange expects at least channel,program') endif chan = this.check_channel(varargin{1})-1; prog = this.check_value127("program", varargin{2}); timestamp = 0; if nargin > 3 timestamp = this.check_timestamp(varargin{3}); endif this.data{end+1} = uint8([bitor(0xc0, chan), prog]); this.timestamp{end+1} = timestamp; case "controlchange" # channel,ccnum, ccval,timestamp if nargin < 4 error ('controlchange expects at least channel,ccnum,ccval') endif chan = this.check_channel(varargin{1})-1; ccnum = this.check_value119("ccnum", varargin{2}); ccval = this.check_value127("ccval", varargin{3}); timestamp = 0; if nargin > 4 timestamp = this.check_timestamp(varargin{4}); endif this.data{end+1} = uint8([bitor(0xb0, chan), ccnum, ccval]); this.timestamp{end+1} = timestamp; case "polykeypressure" # channel, note, pressure, timestamp if nargin < 4 error ('polykeypressure expects at least channel,note,keypressure') endif chan = this.check_channel(varargin{1})-1; note = this.check_value127("note", varargin{2}); pres = this.check_value127("pressure", varargin{3}); timestamp = 0; if nargin > 4 timestamp = this.check_timestamp(varargin{4}); endif this.data{end+1} = uint8([bitor(0xa0, chan), note pres]); this.timestamp{end+1} = timestamp; case "channelpressure" # channel, pressure, timestamp if nargin < 3 error ('channelpressure expects at least channel,keypressure') endif chan = this.check_channel(varargin{1})-1; pres = this.check_value127("pressure", varargin{2}); timestamp = 0; if nargin > 3 timestamp = this.check_timestamp(varargin{3}); endif this.data{end+1} = uint8([bitor(0xd0, chan), pres]); this.timestamp{end+1} = timestamp; case "localcontrol" # channel, localcontrol, timestamp if nargin < 3 error ('localcontrol expects at least channel,localcontrol') endif chan = this.check_channel(varargin{1})-1; local = this.check_value1("localcontrol", varargin{2}); timestamp = 0; if nargin > 3 timestamp = this.check_timestamp(varargin{3}); endif this.data{end+1} = uint8([bitor(0xb0, chan), 122, local]); this.timestamp{end+1} = timestamp; case "pitchbend" # channel, pitchchange, timestamp if nargin < 3 error ('pitchbend expects at least channel,pitchchange') endif chan = this.check_channel(varargin{1})-1; # pitch is 0 .. 16383 where 8120 is no change # pitch = uint16(varargin{2} + 0x2000); pitch = uint16(this.check_value16383("pitchchange", varargin{2})); pitchlo = bitand(pitch, uint16(0x7F)); pitchhi = bitand(bitshift(pitch, -7), uint16(0x7f)); timestamp = 0; if nargin > 3 timestamp = this.check_timestamp(varargin{3}); endif this.data{end+1} = uint8([bitor(0xe0, chan), pitchlo pitchhi]); this.timestamp{end+1} = timestamp; case "polyon" # channel, timestamp if nargin < 2 error ('polyon expects at least channel') endif chan = this.check_channel(varargin{1})-1; timestamp = 0; if nargin > 2 timestamp = this.check_timestamp(varargin{2}); endif this.data{end+1} = uint8([bitor(0xb0, chan), 127]); this.timestamp{end+1} = timestamp; case "monoon" # channel, monochan, timestamp if nargin < 3 error ('monoon expects at least channel and monochannels') endif chan = this.check_channel(varargin{1})-1; mono = this.check_value16("monochannels", varargin{2}); timestamp = 0; if nargin > 3 timestamp = this.check_timestamp(varargin{3}); endif this.data{end+1} = uint8([bitor(0xb0, chan), 126, mono]); this.timestamp{end+1} = timestamp; case "omnion" # channel, timestamp if nargin < 2 error ('omnion expects at least channel') endif chan = this.check_channel(varargin{1})-1; timestamp = 0; if nargin > 2 timestamp = this.check_timestamp(varargin{2}); endif this.data{end+1} = uint8([bitor(0xb0, chan), 125]); this.timestamp{end+1} = timestamp; case "omnioff" # channel, timestamp if nargin < 2 error ('omnioff expects at least channel') endif chan = this.check_channel(varargin{1})-1; timestamp = 0; if nargin > 2 timestamp = this.check_timestamp(varargin{2}); endif this.data{end+1} = uint8([bitor(0xb0, chan), 124]); this.timestamp{end+1} = timestamp; case "allsoundoff" # channel, timestamp if nargin < 2 error ('allsoundoff expects at least channel') endif chan = this.check_channel(varargin{1})-1; timestamp = 0; if nargin > 2 timestamp = this.check_timestamp(varargin{2}); endif this.data{end+1} = uint8([bitor(0xb0, chan), 120]); this.timestamp{end+1} = timestamp; case "allnotesoff" # channel, timestamp if nargin < 2 error ('allnotesoff expects at least channel') endif chan = this.check_channel(varargin{1})-1; timestamp = 0; if nargin > 2 timestamp = this.check_timestamp(varargin{2}); endif this.data{end+1} = uint8([bitor(0xb0, chan), 123]); this.timestamp{end+1} = timestamp; case "resetallcontrollers" # channel, timestamp if nargin < 2 error ('resetallcontrollers expects at least channel') endif chan = this.check_channel(varargin{1})-1; timestamp = 0; if nargin > 2 timestamp = this.check_timestamp(varargin{2}); endif this.data{end+1} = uint8([bitor(0xb0, chan), 121]); this.timestamp{end+1} = timestamp; case "songselect" if nargin < 2 error ('songselect expects at least song number') endif timestamp = 0; song = this.check_value127("songnumber", varargin{1}); if nargin > 2 timestamp = this.check_timestamp(varargin{2}); endif this.data{end+1} = uint8([0xF3 song]); this.timestamp{end+1} = timestamp; case "songpositionpointer" if nargin < 2 error ('song expects at least song position') endif timestamp = 0; songpos = uint16(this.check_value16383("songposiition", varargin{1})); songlo = bitand(songpos, uint16(0x7F)); songhi = bitand(bitshift(songpos, -7), uint16(0x7f)); if nargin > 2 timestamp = this.check_timestamp(varargin{2}); endif this.data{end+1} = uint8([0xF2 songlo songhi]); this.timestamp{end+1} = timestamp; case "miditimecodequarterframe" # timeseq, timeval, timestamp if nargin < 3 error ('miditimecodequarterframe expects at least timeseq and value') endif seq = this.check_value7("timeseq", varargin{1}); val = this.check_value15("timeval", varargin{2}); seq = bitand(uint8(seq), 3); val = bitand(uint8(val), 7); data = bitshift(seq, 3) + val; timestamp = 0; if nargin > 3 timestamp = this.check_timestamp(varargin{3}); endif this.data{end+1} = uint8([0xF1 data]); this.timestamp{end+1} = timestamp; case "start" timestamp = 0; if nargin > 1 timestamp = this.check_timestamp(varargin{1}); endif this.data{end+1} = uint8([0xFA]); this.timestamp{end+1} = timestamp; case "stop" timestamp = 0; if nargin > 1 timestamp = this.check_timestamp(varargin{1}); endif this.data{end+1} = uint8([0xFC]); this.timestamp{end+1} = timestamp; case "continue" timestamp = 0; if nargin > 1 timestamp = this.check_timestamp(varargin{1}); endif this.data{end+1} = uint8([0xFB]); this.timestamp{end+1} = timestamp; case "systemreset" timestamp = 0; if nargin > 1 timestamp = this.check_timestamp(varargin{1}); endif this.data{end+1} = uint8([0xFF]); this.timestamp{end+1} = timestamp; case "activesensing" timestamp = 0; if nargin > 1 timestamp = this.check_timestamp(varargin{1}); endif this.data{end+1} = uint8([0xFE]); this.timestamp{end+1} = timestamp; case "timingclock" timestamp = 0; if nargin > 1 timestamp = this.check_timestamp(varargin{1}); endif this.data{end+1} = uint8([0xF8]); this.timestamp{end+1} = timestamp; case "tunerequest" timestamp = 0; if nargin > 1 timestamp = this.check_timestamp(varargin{1}); endif this.data{end+1} = uint8([0xF6]); this.timestamp{end+1} = timestamp; case "data" # data, timestamp if nargin < 2 error ('data type expects at least data') endif timestamp = 0; if nargin > 2 timestamp = this.check_timestamp(varargin{2}); endif this.data{end+1} = uint8(varargin{1}); this.timestamp{end+1} = timestamp; case "eox" timestamp = 0; if nargin > 1 timestamp = this.check_timestamp(varargin{1}); endif this.data{end+1} = uint8([0xF7]); this.timestamp{end+1} = timestamp; case "systemexclusive" # timestamp # or data + timestamp if nargin == 1 timestamp = 0; data = []; elseif nargin == 2 if !isscalar(varargin{1}) && isvector(varargin{1}) data = uint8(varargin{1}); timestamp = 0; else data = []; timestamp = this.check_timestamp(varargin{1}); endif elseif nargin == 3 data = uint8(varargin{1}); timestamp = this.check_timestamp(varargin{2}); else error ("systemexclusive expects optional data and timestamp only"); endif this.data{end+1} = uint8([0xF0]); this.timestamp{end+1} = timestamp; # want to build a full SOX data EOX if !isempty(data) this.data{end+1} = data; this.timestamp{end+1} = timestamp; this.data{end+1} = uint8([0xF7]); this.timestamp{end+1} = timestamp; endif case "metaevent" if nargin < 3 error ('metaevent expects at least metatype and data') endif timestamp = 0; if nargin > 3 timestamp = this.check_timestamp(varargin{3}); endif # TODO: could be a integer or char type for metatype event = this.check_value127("metatype", varargin{1}); data = uint8(varargin{2}); # TODO: check validity of the data <= 127 datasize = midimsg.makevariable(length(data)); this.data{end+1} = uint8([0xFF event datasize data]); this.timestamp{end+1} = timestamp; otherwise error ("Unknown midi type '%s", typev); endswitch endfunction function a = horzcat (a, varargin) if !isa(a, 'midimsg') error ("Cannot concatenate non midimsg elements"); endif for i = 1:nargin-1 b = varargin{i}; if !isa(b, 'midimsg') error ("Cannot concatenate non midimsg elements"); endif for idx=1:length (b.data) a.data{end+1} = b.data{idx}; a.timestamp{end+1} = b.timestamp{idx}; endfor endfor endfunction function e = isempty (this) e = isempty(this.data); endfunction function e = length (this) e = length(this.data); endfunction function e = size (this) e = size(this.data); endfunction function this = subsasgn (this, s, rhs) if isempty(s) error ("midimsg.subsref missing index"); endif switch (s(1).type) case "." if length(this.timestamp) > 1 error ("Can not set %s on mutiple messages yet", s(1).subs); endif switch tolower(s(1).subs) case "timestamp" this.timestamp{1} = this.check_timestamp(rhs); case "channel" chan = this.check_channel(rhs); data = this.data{1}; data(1) = bitor(bitand(data(1), 0xF0), (chan-1)); this.data{1} = data; case "note" data = this.data{1}; cmd = bitand(data(1), 0xF0); if !(cmd == 0x80 || cmd == 0x90 || cmd == 0xA0) error ("note property only valid for noteon/off and polykeypressure"); endif data(2) = this.check_value127("note", rhs); this.data{1} = data; case "velocity" data = this.data{1}; cmd = bitand(data(1), 0xF0); if !(cmd == 0x80 || cmd == 0x90) error ("velocity property only valid for noteon/off"); endif data(3) = this.check_value127("velocity", rhs); this.data{1} = data; case "channelpressure" data = this.data{1}; cmd = bitand(data(1), 0xF0); if !(cmd == 0xD0) error ("channel property only valid for channelpressure messages"); endif data(2) = this.check_value127("channelpressure", rhs); this.data{1} = data; case "keypressure" data = this.data{1}; cmd = bitand(data(1), 0xF0); if !(cmd == 0xA0) error ("keypressure property only valid for polykeypressure messages"); endif data(3) = this.check_value127("keypressure", rhs); this.data{1} = data; case "ccnumber" data = this.data{1}; cmd = bitand(data(1), 0xF0); if cmd != 0xB0 || data(2) > 119 error ("ccnumber property only valid for controlchange messages"); endif data(2) = this.check_value119("ccnumber", rhs); this.data{1} = data; case "ccvalue" data = this.data{1}; cmd = bitand(data(1), 0xF0); if cmd != 0xB0 || data(2) > 119 error ("ccnumber property only valid for controlchange messages"); endif data(3) = this.check_value127("ccvalue", rhs); this.data{1} = data; case "song" data = this.data{1}; cmd = data(1); if cmd != 0xF3 error ("song property only valid for song select messages"); endif data(2) = this.check_value127("song", rhs); this.data{1} = data; case "songposition" data = this.data{1}; cmd = data(1); if cmd != 0xF2 error ("songposition property only valid for songpositionpointer messages"); endif songpos = uint16(this.check_value16383("songposition", rhs)); songlo = bitand(songpos, uint16(0x7F)); songhi = bitand(bitshift(songpos, -7), uint16(0x7f)); data(2) = songlo; data(3) = songhi; this.data{1} = data; case "pitchchange" data = this.data{1}; cmd = bitand(data(1), 0xF0); if cmd != 0xE0 error ("pitchchange property only valid for pitchbend messages"); endif pitchchange = uint16(this.check_value16383("pitchchange", rhs)); pitchlo = bitand(pitchchange, uint16(0x7F)); pitchhi = bitand(bitshift(pitchchange, -7), uint16(0x7f)); data(2) = pitchlo; data(3) = pitchhi; this.data{1} = data; case "timecodesequence" data = this.data{1}; cmd = data(1); if cmd != 0xF1 error ("timecodesequence property only valid for miditimecodequaterframe messages"); endif seq = bitshift(data(2), -3); val = bitand(data(2), 7); seq = this.check_value7("timecodesequence", rhs); data(2) = bitshift(seq, 3) + val; this.data{1} = data; case "timecodevalue" data = this.data{1}; cmd = data(1); if cmd != 0xF1 error ("value property only valid for miditimecodequaterframe messages"); endif seq = bitshift(data(2), -3); val = bitand(data(2), 7); val = this.check_value15("timecodevalue", rhs); val = bitand(uint8(val), 7); data(2) = bitshift(seq, 3) + val; this.data{1} = data; otherwise error("unimplemented midimsg.subsasgn property '%s'", s(1).subs); endswitch case "()" idx = s(1).subs; if (numel (idx) != 1) error ("@midimsg/subsasgn: needs exactly one index"); endif if numel (s) == 1 # assign a value to here - so verify is a midimsg if !isa(rhs, "midimsg") error ("midimsg.subsasgn rhs of indexed value must be a midimsg"); endif val = rhs; else # extract out midimsg value and do assign on it val = midimsg.createMessage(this.data{idx{1}}, this.timestamp{idx{1}}); val = subsasgn (val, s(2:end), rhs); endif # store the modded data back in our object this.data{idx{1}} = val.data{1}; this.timestamp{idx{1}} = val.timestamp{1}; otherwise error("unimplemented midimsg.subsasgn type"); endswitch endfunction function val = subsref (this, s) if isempty(s) error ("midimsg.subsref missing index"); endif switch (s(1).type) case "()" idx = s(1).subs; if (numel (idx) != 1) error ("@midimsg/subsref: need exactly one index"); endif off=[idx{1}]; val = midimsg(0); for ix=off a = midimsg.createMessage(this.data{ix}, this.timestamp{ix}); val = [val a]; endfor case "." switch tolower(s(1).subs) case "timestamp" if length(this.timestamp) == 1 val = this.timestamp{1}; else val = cell2mat(this.timestamp); endif case "msgbytes" if length(this.data) == 1 val = this.data{1}; else val = this.data; endif case "nummsgbytes" if length(this.data) > 0 val = length(this.data{1}); if length(this.data) > 1 for idx = 2:length(this.data) val = [val length(this.data{idx})]; endfor endif else val = 0; endif case "type" if length(this.data) > 0 data = this.data{1}; val = this.type_enum(this.data{1}); if length(this.data) > 1 # we cant override cellstr yes, so just use strings for multiples val = {char(val)}; for idx = 2:length(this.data) val{end+1} = this.type_str(this.data{idx}); endfor endif else val = midimsgtype.Undefined; endif case "channel" if length(this.data) > 0 data = this.data{1}; val = bitand(data(1), 0x0F) + 1; if length(this.data) > 1 for idx = 2:length(this.data) data = this.data{idx}; val = [val (bitand(data(1), 0x0F)+1)]; endfor endif val = double(val); endif case "note" if length(this.data) > 0 data = this.data{1}; cmd = bitand(data(1), 0xF0); if cmd == 0x80 || cmd == 0x90 || cmd == 0xA0 val = data(2); else error ("note property only valid for noteon/off and polykeypressure"); endif if length(this.data) > 1 for idx = 2:length(this.data) data = this.data{idx}; cmd = bitand(data(1), 0xF0); if cmd == 0x80 || cmd == 0x90 || cmd == 0xA0 val = [val data(2)]; else error ("note property only valid for noteon/off and polykeypressure"); endif endfor endif val = double(val); endif case "velocity" if length(this.data) > 0 data = this.data{1}; cmd = bitand(data(1), 0xF0); if cmd == 0x80 || cmd == 0x90 val = data(3); else error ("velocity property only valid for noteon/off"); endif if length(this.data) > 1 for idx = 2:length(this.data) data = this.data{idx}; cmd = bitand(data(1), 0xF0); if cmd == 0x80 || cmd == 0x90 val = [val data(3)]; else error ("velocity property only valid for noteon/off"); endif endfor endif val = double(val); endif case "keypressure" if length(this.data) > 0 data = this.data{1}; cmd = bitand(data(1), 0xF0); if cmd == 0xA0 val = data(3); else error ("keypressure property only valid for polykeypressure"); endif if length(this.data) > 1 for idx = 2:length(this.data) data = this.data{idx}; cmd = bitand(data(1), 0xF0); if cmd == 0xA0 val = [val data(3)]; else error ("keypressure property only valid for polykeypressure"); endif endfor endif val = double(val); endif case "channelpressure" if length(this.data) > 0 data = this.data{1}; cmd = bitand(data(1), 0xF0); if cmd == 0xD0 val = data(2); else error ("channelpressure property only valid for channelpressure"); endif if length(this.data) > 1 for idx = 2:length(this.data) data = this.data{idx}; cmd = bitand(data(1), 0xF0); if cmd == 0xD0 val = [val data(2)]; else error ("keypressure property only valid for channelpressure"); endif endfor endif val = double(val); endif case "localcontrol" if length(this.data) > 0 data = this.data{1}; cmd = bitand(data(1), 0xF0); if cmd == 0xB0 && data(2) == 122 val = data(3); else error ("localcontrol property only valid for localcontrol messages"); endif if length(this.data) > 1 for idx = 2:length(this.data) data = this.data{idx}; cmd = bitand(data(1), 0xF0); if cmd == 0xB0 && data(2) == 122 val = [val data(3)]; else error ("localcontrol property only valid for localcontrol messages"); endif endfor endif val = double(val); endif case "monochannels" if length(this.data) > 0 data = this.data{1}; cmd = bitand(data(1), 0xF0); if cmd == 0xB0 && data(2) == 126 val = data(3); else error ("monochannels property only valid for monoon messages"); endif if length(this.data) > 1 for idx = 2:length(this.data) data = this.data{idx}; cmd = bitand(data(1), 0xF0); if cmd == 0xB0 && data(2) == 126 val = [val data(3)]; else error ("monochannels property only valid for monoon messages"); endif endfor endif val = double(val); endif case "program" if length(this.data) > 0 data = this.data{1}; cmd = bitand(data(1), 0xF0); if cmd == 0xC0 val = data(2); else error ("program property only valid for programchange messages"); endif if length(this.data) > 1 for idx = 2:length(this.data) data = this.data{idx}; cmd = bitand(data(1), 0xF0); if cmd == 0xC0 val = [val data(2)]; else error ("program property only valid for programchange messages"); endif endfor endif val = double(val); endif case "ccnumber" if length(this.data) > 0 data = this.data{1}; cmd = bitand(data(1), 0xF0); if cmd == 0xB0 && data(2) <= 119 val = data(2); else error ("ccnumber property only valid for controlchange messages"); endif if length(this.data) > 1 for idx = 2:length(this.data) data = this.data{idx}; cmd = bitand(data(1), 0xF0); if cmd == 0xB0 && data(2) <= 119 val = [val data(2)]; else error ("ccnumber property only valid for controlchange messages"); endif endfor endif val = double(val); endif case "ccvalue" if length(this.data) > 0 data = this.data{1}; cmd = bitand(data(1), 0xF0); if cmd == 0xB0 && data(2) <= 119 val = data(3); else error ("ccvalue property only valid for controlchange messages"); endif if length(this.data) > 1 for idx = 2:length(this.data) data = this.data{idx}; cmd = bitand(data(1), 0xF0); if cmd == 0xB0 && data(2) <= 119 val = [val data(3)]; else error ("ccvalue property only valid for controlchange messages"); endif endfor endif val = double(val); endif case "song" if length(this.data) > 0 data = this.data{1}; cmd = data(1); if cmd == 0xF3 val = data(2); else error ("song property only valid for songselect messages"); endif if length(this.data) > 1 for idx = 2:length(this.data) data = this.data{idx}; cmd = data(1); if cmd == 0xF3 val = [val data(2)]; else error ("song property only valid for songselect messages"); endif endfor endif val = double(val); endif case "songposition" if length(this.data) > 0 data = this.data{1}; cmd = data(1); if cmd == 0xF2 val = bitshift(int16(data(3)), 7) + int16(data(2)); else error ("songpostion property only valid for songpositionpointer messages"); endif if length(this.data) > 1 for idx = 2:length(this.data) data = this.data{idx}; cmd = data(1); if cmd == 0xF2 v = bitshift(int16(data(3)), 7) + int16(data(2)); val = [val v]; else error ("songposition property only valid for songpositionpointer messages"); endif endfor endif val = double(val); endif case "pitchchange" if length(this.data) > 0 data = this.data{1}; cmd = bitand(data(1), 0xF0); if cmd == 0xE0 val = bitshift(int16(data(3)), 7) + int16(data(2)); else error ("pitchchange property only valid for pitchbend messages"); endif if length(this.data) > 1 for idx = 2:length(this.data) data = this.data{idx}; cmd = bitand(data(1), 0xF0); if cmd == 0xF2 v = bitshift(int16(data(3)), 7) + int16(data(2)); val = [val v]; else error ("picthchange property only valid for pitchbend messages"); endif endfor endif val = double(val); endif case "timecodesequence" if length(this.data) > 0 data = this.data{1}; cmd = data(1); if cmd == 0xF1 val = bitshift(data(2), -3); else error ("timecodesequence property only valid for miditimecodequarterframe messages"); endif if length(this.data) > 1 for idx = 2:length(this.data) data = this.data{idx}; cmd = data(1); if cmd == 0xF1 v = bitshift(data(2), -3); val = [val v]; else error ("timecodesequence property only valid for miditimecodequaterframe messages"); endif endfor endif val = double(val); endif case "timecodevalue" if length(this.data) > 0 data = this.data{1}; cmd = data(1); if cmd == 0xF1 val = bitand(data(2), 7); else error ("timecodevalue property only valid for miditimecodequarterframe messages"); endif if length(this.data) > 1 for idx = 2:length(this.data) data = this.data{idx}; cmd = data(1); if cmd == 0xF1 v = bitand(data(2), 7); val = [val v]; else error ("timecodevalue property only valid for miditimecodequaterframe messages"); endif endfor endif val = double(val); endif case "metatype" if length(this.data) > 0 data = this.data{1}; cmd = data(1); if cmd == 0xFF && length(data) > 1 val = data(2); else error ("metatype property only valid for metaevent messages"); endif if length(this.data) > 1 for idx = 2:length(this.data) data = this.data{idx}; cmd = data(1); if cmd == 0xFF && length(data) > 1 val = data(2); val = [val v]; else error ("metatype property only valid for metaevent messages"); endif endfor endif val = double(val); endif case "metadata" if length(this.data) > 0 data = this.data{1}; cmd = data(1); len = length(data); if cmd == 0xFF && len > 1 if len < 128 val = data(4:len); elseif len < 128*128 val = data(5:len); elseif len < 128*128*128 val = data(6:len); else val = data(7:len); endif else error ("metadata property only valid for metaevent messages"); endif if length(this.data) > 1 for idx = 2:length(this.data) data = this.data{idx}; cmd = data(1); len = length(data); if cmd == 0xFF && len > 1 if len < 128 v = data(4:len); elseif len < 128*128 v = data(5:len); elseif len < 128*128*128 v = data(6:len); else v = data(7:len); endif val = [val v]; else error ("metadata property only valid for metaevent messages"); endif endfor endif endif otherwise error("unimplemented midimsg.subsref property '%s'", s(1).subs); endswitch otherwise error("unimplemented midimsg.subsref type"); endswitch if (numel (s) > 1) val = subsref (val, s(2:end)); endif endfunction function msg = sort (this) msg = midimsg(0); # TODO: store timestamp as matrix not a cell # then could just use sort, and no swaps ? [~, s_idx] = sort(cell2mat(this.timestamp')); s_idx = s_idx'; for idx = 1:numel(s_idx) msg.timestamp{end+1} = this.timestamp{s_idx(idx)}; msg.data{end+1} = this.data{s_idx(idx)}; endfor endfunction function out = disp (this) if nargout == 0 disp(" MIDI message:"); else out = ""; endif for idx=1:length(this.data) data = this.data{idx}; cmd = data(1); types = this.type_str(data); if bitand(cmd, 0xF0) != 0xF0 && bitand(cmd, 0x80) != 0 chan = bitand(cmd, 0x0F) + 1; msgtext = sprintf ("%-10s Channel: %2d", types, chan); else msgtext = sprintf ("%-10s", types); endif if strcmp(types, "NoteOn") || strcmp(types, "NoteOff") msgtext = [msgtext sprintf(" Note: %3d Velocity: %3d", data(2), data(3))]; endif if strcmp(types, "ProgramChange") msgtext = [msgtext sprintf(" Program: %3d", data(2))]; endif if strcmp(types, "ControlChange") msgtext = [msgtext sprintf(" CCNumber: %3d CCValue: %3d", data(2), data(3))]; endif if strcmp(types, "PitchBend") v = bitshift(int16(data(3)), 7) + int16(data(2)); msgtext = [msgtext sprintf(" PitchChange: %d", v)]; endif if strcmp(types, "ChannelPressure") msgtext = [msgtext sprintf(" ChannelPressure: %3d", data(2))]; endif if strcmp(types, "PolyKeyPressure") msgtext = [msgtext sprintf(" Note: %3d KeyPressure: %3d", data(2), data(3))]; endif if strcmp(types, "LocalControl") msgtext = [msgtext sprintf(" LocalControl: %3d", data(3))]; endif if strcmp(types, "MonoOn") msgtext = [msgtext sprintf(" MonoChannels: %3d", data(3))]; endif if strcmp(types, "SongSelect") msgtext = [msgtext sprintf(" Song: %3d", data(2))]; endif if strcmp(types, "SongPositionPointer") v = bitshift(int16(data(3)), 7) + int16(data(2)); msgtext = [msgtext sprintf(" SongPosition: %d", v)]; endif if strcmp(types, "MIDITimeCodeQuarterFrame") seq = bitshift(data(2), -3); val = bitand(data(2), 7); msgtext = [msgtext sprintf(" TimeCodeSequence: %d TimeCodeValue: %d", seq, val)]; endif if strcmp(types, "MetaEvent") metatype = data(2); msgtext = [msgtext sprintf(" MetaType: %d", metatype)]; endif msgtext = [msgtext sprintf(" Timestamp: %f", this.timestamp{idx})]; msgtext = [msgtext sprintf(" [")]; msgtext = [msgtext sprintf(" 0x%02X", data)]; msgtext = [msgtext sprintf(" ]")]; if nargout == 0 disp([" " msgtext]); else out = [out msgtext "\n"]; endif endfor endfunction function d = uint8 (this) d = this.data; endfunction endmethods methods (Access = private) function t = check_timestamp(this, ts) if !isscalar (ts) || !isnumeric(ts) || ts < 0 error ("expected timestamp to be a number >= 0"); endif t = ts; endfunction function c = check_channel(this, chan) if !isscalar (chan) || !isnumeric(chan) || chan < 1 || chan > 16 error ("expected channel to be a number between 1..16"); endif c = chan; endfunction function v = check_value127(this, name, value) if !isscalar (value) || !isnumeric(value) || value < 0 || value > 127 error ("expected %s to be a number between 0..127", name); endif v = value; endfunction function v = check_value1(this, name, value) if !isscalar (value) || !(islogical(value) || isnumeric(value)) || value < 0 || value > 1 error ("expected %s to be a number between 0..1", name); endif v = value; endfunction function v = check_value7(this, name, value) if !isscalar (value) || !isnumeric(value) || value < 0 || value > 7 error ("expected %s to be a number between 0..7", name); endif v = value; endfunction function v = check_value15(this, name, value) if !isscalar (value) || !isnumeric(value) || value < 0 || value > 7 error ("expected %s to be a number between 0..15", name); endif v = value; endfunction function v = check_value16(this, name, value) if !isscalar (value) || !isnumeric(value) || value < 0 || value > 16 error ("expected %s to be a number between 0..16", name); endif v = value; endfunction function v = check_value119(this, name, value) if !isscalar (value) || !isnumeric(value) || value < 0 || value > 119 error ("expected %s to be a number between 0..119", name); endif v = value; endfunction function v = check_value16383(this, name, value) if !isscalar (value) || !isnumeric(value) || value < 0 || value > 16383 error ("expected %s to be a number between 0..16386", name); endif v = value; endfunction function v = type_enum (this, data) cmd = 0; b1 = 0; if length(data) > 0 cmd = data(1); endif if length(data) > 1 b1 = data(2); endif cmdgrp = bitand(cmd, 0xF0); switch (cmdgrp) case 0x80 v = midimsgtype.NoteOff; case 0x90 v = midimsgtype.NoteOn; case 0xA0 v = midimsgtype.PolyKeyPressure; case 0xB0 # depends on next byte for actual msg if b1 == 120 v = midimsgtype.AllSoundOff; elseif b1 == 121 v = midimsgtype.ResetAllControllers; elseif b1 == 122 v = midimsgtype.LocalControl; elseif b1 == 123 v = midimsgtype.AllNotesOff; elseif b1 == 124 v = midimsgtype.OmniOff; elseif b1 == 125 v = midimsgtype.OmniOn; elseif b1 == 126 v = midimsgtype.MonoOn; elseif b1 == 127 v = midimsgtype.PolyOn; else v = midimsgtype.ControlChange; endif case 0xC0 v = midimsgtype.ProgramChange; case 0xD0 v = midimsgtype.ChannelPressure; case 0xE0 v = midimsgtype.PitchBend; case 0xF0 if cmd == 0xF0 v = midimsgtype.SystemExclusive; elseif cmd == 0xF1 v = midimsgtype.MIDITimeCodeQuarterFrame; elseif cmd == 0xF2 v = midimsgtype.SongPositionPointer; elseif cmd == 0xF3 v = midimsgtype.SongSelect; elseif cmd == 0xF4 v = midimsgtype.Reserved; elseif cmd == 0xF5 v = midimsgtype.Reserved; elseif cmd == 0xF6 v = midimsgtype.TuneRequest; elseif cmd == 0xF7 v = midimsgtype.EOX; elseif cmd == 0xF8 v = midimsgtype.TimingClock; elseif cmd == 0xF9 v = midimsgtype.Reserved; elseif cmd == 0xFA v = midimsgtype.Start; elseif cmd == 0xFB v = midimsgtype.Continue; elseif cmd == 0xFC v = midimsgtype.Stop; elseif cmd == 0xFD v = midimsgtype.Reserved; elseif cmd == 0xFE v = midimsgtype.ActiveSensing; elseif cmd == 0xFF v = midimsgtype.SystemReset; if length(data) > 1 v = midimsgtype.MetaEvent; endif endif # depend on other bytes ? otherwise if length(data) < 1 v = midimsgtype.Undefined; else v = midimsgtype.Data; endif endswitch endfunction function v = type_str (this, data) v = char(this.type_enum(data)); endfunction function props = __properties__(this) # all have timestamp and type props{1} = "Timestamp"; props{2} = "Type"; props{3} = "MsgBytes"; props{4} = "NumMsgBytes"; # props based on type if length(this.timestamp) > 0 data = this.data{1}; cmd = bitand(data(1), 0xF0); if cmd == 0xF0 cmd = data(1); endif if cmd != 0x00 && cmd < 0xF0 props{end+1} = "Channel"; endif if cmd == 0x80 || cmd == 0x90 || cmd == 0xA0 props{end+1} = "Note"; endif if cmd == 0x80 || cmd == 0x90 props{end+1} = "Velocity"; endif if cmd == 0xA0 props{end+1} = "KeyPressure"; endif if cmd == 0xD0 props{end+1} = "ChannelPressure"; endif if cmd == 0xB0 && data(2) == 122 props{end+1} = "LocalControl"; endif if cmd == 0xB0 && data(2) == 126 props{end+1} = "MonoChannel"; endif if cmd == 0xC0 props{end+1} = "Program"; endif if cmd == 0xB0 && data(2) <= 119 props{end+1} = "CCNumber"; props{end+1} = "CCValue"; endif if cmd == 0xF3 props{end+1} = "Song"; endif if cmd == 0xF2 props{end+1} = "SongPosition"; endif if cmd == 0xE0 props{end+1} = "PitchChange"; endif if cmd == 0xF1 props{end+1} = "TimeCodeSequence"; props{end+1} = "TimeCodeValue"; endif if cmd == 0xFF && length(data) > 1 props{end+1} = "MetaType"; props{end+1} = "MetaData"; endif endif endfunction endmethods methods (Static=true) function msg = createMessage (data, ts) if nargin < 1 || !isa (data, 'uint8') || !ismatrix (data) error ("Expected matrix of uint8 data") endif if nargin < 2 ts = 0; elif !isnumeric(ts) error ("Expected Timestamp as a number") endif msg = midimsg(0); msg.data{end+1} = data; msg.timestamp{end+1} = ts; endfunction function msg = fromStruct (msgstruct) # expects 'RawBytes' and 'Timestamp' in a struct if !isstruct (msgstruct) || !isfield (msgstruct, "RawBytes") || !isfield (msgstruct, "Timestamp") error ("Expected struct with RawBytes and Timestamp field"); endif msg = midimsg.createMessage(uint8(msgstruct.RawBytes), msgstruct.Timestamp); endfunction endmethods methods (Static = true) # octave 5 wont allow us to call private funcs from the class # so a copy of private/makevariable is here function data = makevariable (value) t = uint64(value); if t < 128 v = uint8(t); data = [v]; else tmp = dec2bin(t); while mod(length(tmp), 7) != 0 tmp = [ "0" tmp ]; endwhile data = []; for i=1:7:length(tmp) v = tmp(i:i+6); v = uint8(bin2dec(v)); if i < length(tmp) -7 v = 128 + v; endif data = [data v]; endfor endif endfunction endmethods endclassdef %!fail midimsg('badtype') %!test %! a = midimsg; %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "Data"); %! assert(a.nummsgbytes, 8); %! assert(a.msgbytes, uint8([0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00])); %!test %! a = midimsg(0); %! assert(isa(a, "midimsg")); %! assert(length(a) == 0); %! assert(isempty(a)); %!fail midimsg("note", 0, 60, 127, 2) %!fail midimsg("note", 17, 60, 127, 2) %!fail midimsg("note", 1, 128, 127, 2) %!fail midimsg("note", 1, -1, 127, 2) %!fail midimsg("note", 1, 60, 128, 2) %!fail midimsg("note", 1, 60, -1, 2) %!fail midimsg("note", 1, 60, 127, -1) %!fail midimsg("note", 1, 60, 127, 2, -1) %!test %! a = midimsg("note", 1, 60, 127, 2); %! assert(isa(a, "midimsg")); %! assert(length(a) == 2); %! assert(!isempty(a)); %! assert(a.channel, [1 1]); %! a = midimsg("note", 2, 60, 127, 1.2); %! t = a.type; %! assert(length(t) == 2); %! assert(strcmp(t{1}, "NoteOn")) %! assert(strcmp(t{2}, "NoteOn")) %! assert(a.timestamp, [0.0 1.2]); %! assert(a.channel, [2 2]); %!test %! a = midimsg("noteon", 1, 60, 20); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "NoteOn"); %! assert(a.channel, 1); %! assert(a.msgbytes, uint8([0x90 0x3C 0x14])); %! assert(!isempty(a)); %! a = midimsg("noteon", 2, 60, 20); %! assert(a.channel, 2); %! assert(a.msgbytes, uint8([0x91 0x3C 0x14])); %!test %! % using midimsgtype enum %! a = midimsg(midimsgtype.NoteOn, 1, 60, 20); %! assert(isa(a, "midimsg")); %! assert(a.type == "NoteOn"); %!test %! a = midimsg("noteoff", 1, 60, 20); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "NoteOff"); %! assert(a.nummsgbytes, 3); %! assert(!isempty(a)); %! assert(a.msgbytes, uint8([0x80 0x3C 0x14])); %!test %! a = midimsg("programchange", 1, 60); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "ProgramChange"); %! assert(a.program, 60); %! assert(a.channel, 1); %! assert(a.nummsgbytes, 2); %! assert(a.msgbytes, uint8([0xC0 60])); %! assert(!isempty(a)); %!test %! a = midimsg("controlchange", 1, 60, 65); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "ControlChange"); %! assert(a.nummsgbytes, 3); %! assert(!isempty(a)); %! assert(a.ccnumber, 60) %! assert(a.ccvalue, 65) %! a.ccnumber = 0; %! a.ccvalue = 4; %! assert(a.ccnumber, 0) %! assert(a.ccvalue, 4) %!test %! a = midimsg("polykeypressure", 1, 60, 65); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "PolyKeyPressure"); %! assert(a.nummsgbytes, 3); %! assert(a.note, 60); %! assert(a.keypressure, 65); %! assert(!isempty(a)); %! %! a.keypressure = 40; %! assert(a.keypressure, 40); %!test %! a = midimsg("pitchbend", 1, 8192); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "PitchBend"); %! assert(a.nummsgbytes, 3); %! assert(!isempty(a)); %! assert(a.msgbytes, uint8([0xE0 0x00 0x40])); %! assert(a.pitchchange, 8192); %! assert(a.channel, 1); %! a.pitchchange = 8200; %! assert(a.pitchchange, 8200); %!test %! a = midimsg("channelpressure", 1, 60); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "ChannelPressure"); %! assert(a.nummsgbytes, 2); %! assert(!isempty(a)); %! assert(a.channelpressure, 60); %! %! a.channelpressure = 40; %! assert(a.channelpressure, 40); %!test %! a = midimsg("localcontrol", 1, 1); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "LocalControl"); %! assert(a.nummsgbytes, 3); %! assert(a.localcontrol, 1); %! assert(!isempty(a)); %! assert(a.msgbytes, uint8([0xB0 122 0x01])); %! %! a = midimsg("localcontrol", 2, 0); %! assert(a.msgbytes, uint8([0xB1 122 0x00])); %! assert(a.localcontrol, 0); %! assert(a.channel, 2); %!test %! a = midimsg("polyon", 1); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "PolyOn"); %! assert(a.nummsgbytes, 2); %! assert(!isempty(a)); %!test %! a = midimsg("monoon", 1, 0); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "MonoOn"); %! assert(a.monochannels, 0); %! assert(a.nummsgbytes, 3); %! assert(!isempty(a)); %!test %! a = midimsg("omnion", 1); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "OmniOn"); %! assert(a.nummsgbytes, 2); %! assert(!isempty(a)); %!test %! a = midimsg("omnioff", 1); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "OmniOff"); %! assert(a.nummsgbytes, 2); %! assert(!isempty(a)); %!test %! a = midimsg("allsoundoff", 1); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "AllSoundOff"); %! assert(a.nummsgbytes, 2); %! assert(!isempty(a)); %!test %! a = midimsg("allnotesoff", 1); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "AllNotesOff"); %! assert(a.nummsgbytes, 2); %! assert(!isempty(a)); %!test %! a = midimsg("resetallcontrollers", 1); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "ResetAllControllers"); %! assert(a.nummsgbytes, 2); %! assert(!isempty(a)); %!test %! a = midimsg("systemreset"); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "SystemReset"); %! assert(a.nummsgbytes, 1); %! assert(!isempty(a)); %! assert(a.msgbytes, uint8([0xFF])); %!test %! a = midimsg("start"); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "Start"); %! assert(a.nummsgbytes, 1); %! assert(!isempty(a)); %! assert(a.msgbytes, uint8([0xFA])); %!test %! a = midimsg("stop"); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "Stop"); %! assert(a.nummsgbytes, 1); %! assert(!isempty(a)); %! assert(a.msgbytes, uint8([0xFC])); %!test %! a = midimsg("continue"); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "Continue"); %! assert(a.nummsgbytes, 1); %! assert(!isempty(a)); %! assert(a.msgbytes, uint8([0xFB])); %!test %! a = midimsg("activesensing"); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "ActiveSensing"); %! assert(a.nummsgbytes, 1); %! assert(!isempty(a)); %! assert(a.msgbytes, uint8([0xFE])); %!test %! a = midimsg("timingclock"); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "TimingClock"); %! assert(a.nummsgbytes, 1); %! assert(!isempty(a)); %! assert(a.msgbytes, uint8([0xF8])); %!test %! a = midimsg("eox"); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "EOX"); %! assert(a.nummsgbytes, 1); %! assert(!isempty(a)); %! assert(a.msgbytes, uint8([0xF7])); %!test %! a = midimsg("data", [1 2 3]); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "Data"); %! assert(a.nummsgbytes, 3); %! assert(!isempty(a)); %! assert(a.msgbytes, uint8([1 2 3])); %!test %! a = midimsg("songselect", 1); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "SongSelect"); %! assert(a.nummsgbytes, 2); %! assert(!isempty(a)); %! assert(a.msgbytes, uint8([0xF3 1])); %! assert(a.song, 1); %! a.song = 2; %! assert(a.song, 2); %! assert(a.msgbytes, uint8([0xF3 2])); %!test %! a = midimsg("songpositionpointer", 0); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "SongPositionPointer"); %! assert(a.nummsgbytes, 3); %! assert(!isempty(a)); %! assert(a.msgbytes, uint8([0xF2 0 0])); %! assert(a.songposition, 0); %! a.songposition = 1000; %! assert(a.songposition, 1000); %!test %! a = midimsg("tunerequest"); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "TuneRequest"); %! assert(a.nummsgbytes, 1); %! assert(!isempty(a)); %! assert(a.msgbytes, uint8([0xF6])); %!test %! a = midimsg("miditimecodequarterframe", 1, 1); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "MIDITimeCodeQuarterFrame"); %! assert(a.nummsgbytes, 2); %! assert(!isempty(a)); %! assert(a.msgbytes, uint8([0xF1 9])); %! assert(a.timecodesequence, 1); %! assert(a.timecodevalue, 1); %! a.timecodesequence = 5; %! assert(a.timecodesequence, 5); %! assert(a.timecodevalue, 1); %! a.timecodevalue = 2; %! assert(a.timecodesequence, 5); %! assert(a.timecodevalue, 2); %!test %! a = midimsg("systemexclusive"); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "SystemExclusive"); %! assert(a.nummsgbytes, 1); %! assert(!isempty(a)); %! assert(a.msgbytes, uint8([0xF0])); %! %! a = midimsg("systemexclusive", 1.0); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "SystemExclusive"); %! assert(a.nummsgbytes, 1); %! assert(!isempty(a)); %! assert(a.msgbytes, uint8([0xF0])); %! assert(a.timestamp, 1.0); %! %! a = midimsg("systemexclusive", [1 2 3]); %! assert(isa(a, "midimsg")); %! assert(length(a) == 3); %! assert(a.type, {"SystemExclusive", "Data", "EOX"}); %! assert(a.nummsgbytes, [1 3 1]); %! assert(!isempty(a)); %! assert(a(1).msgbytes, uint8([0xF0])); %! assert(a(1).timestamp, 0.0); %! assert(a(2).msgbytes, uint8([1 2 3])); %! assert(a(2).timestamp, 0.0); %! assert(a(3).msgbytes, uint8([0xF7])); %! assert(a(3).timestamp, 0.0); %! %! a = midimsg("systemexclusive", [1 2 3], 5); %! assert(isa(a, "midimsg")); %! assert(length(a) == 3); %! assert(a.type, {"SystemExclusive", "Data", "EOX"}); %! assert(a.nummsgbytes, [1 3 1]); %! assert(!isempty(a)); %! assert(a(1).msgbytes, uint8([0xF0])); %! assert(a(1).timestamp, 5.0); %! assert(a(2).msgbytes, uint8([1 2 3])); %! assert(a(2).timestamp, 5.0); %! assert(a(3).msgbytes, uint8([0xF7])); %! assert(a(3).timestamp, 5.0); %!test %! a = midimsg("noteon", 1, 60, 20); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "NoteOn"); %! assert(a.note, 60); %! assert(a.velocity, 20); %! b = midimsg("noteoff", 2, 60, 10, 5.0); %! assert(isa(b, "midimsg")); %! assert(length(b) == 1); %! assert(b.type == "NoteOff"); %! assert(b.note, 60); %! assert(b.velocity, 10); %! c = [a b]; %! assert(isa(c, "midimsg")); %! assert(length(c) == 2); %! assert(c.nummsgbytes, [3 3]); %! assert(c.channel, [1 2]); %! assert(c.note, [60 60]); %! assert(c.velocity, [20 10]); %! assert(c(1).type == "NoteOn"); %! assert(c(1).channel, 1); %! assert(c(1).note, 60); %! assert(c(1).velocity, 20); %! assert(c(2).type == "NoteOff"); %! assert(c(2).timestamp, 5.0); %! assert(c(2).channel, 2); %! assert(c(2).note, 60); %! assert(c(2).velocity, 10); %!test %! a = midimsg("metaevent", 1, "hello"); %! assert(isa(a, "midimsg")); %! assert(length(a) == 1); %! assert(a.type == "MetaEvent"); %! assert(a.metatype, 1); %! assert(a.metadata, uint8([0x68 0x65 0x6C 0x6C 0x6F])); %! assert(a.msgbytes, uint8([0xFF 0x01 0x05 0x68 0x65 0x6C 0x6C 0x6F])) %!test %! # basic assign operations %! %! a = midimsg("noteon", 1, 60, 127, 0); %! assert(length(a) == 1); %! assert(a.type == "NoteOn"); %! assert(a.channel, 1); %! assert(a.note, 60); %! assert(a.velocity, 127); %! assert(a.timestamp, 0); %! %! a.timestamp = 10; %! a.channel = 2; %! a.note = 61; %! a.velocity = 100; %! assert(a.timestamp, 10); %! assert(a.channel, 2); %! assert(a.note, 61); %! assert(a.velocity, 100); %! %! fail ("a.channel = 0;"); %! fail ("a.note = -1;"); %! fail ("a.velocity = -1;"); % %! a = midimsg("note", 1, 60, 127, 2); %! assert(length(a) == 2); %! assert(a(1).timestamp, 0); %! assert(a(2).timestamp, 2); %! assert(a(1).note, 60); %! assert(a(2).note, 60); %! assert(a(1).channel, 1); %! assert(a(2).channel, 1); %! %! a(1).timestamp = 10; %! a(2).timestamp = 20; %! fail ("a(3).timestamp = 1;"); %! a(1).channel = 11; %! a(2).channel = 12; %! a(1).note = 71; %! %! assert(a(1).timestamp, 10); %! assert(a(2).timestamp, 20); %! assert(a(1).channel, 11); %! assert(a(2).channel, 12); %! assert(a(1).note, 71); %! %! fail ("a(1) = 1;"); %! a(1) = midimsg("noteon", 1, 80, 100, 50); %! assert(length(a) == 2); %! assert(a(1).timestamp, 50); %! assert(a(1).channel, 1); %! assert(a(1).note, 80); %! assert(a(1).velocity, 100); %! %! # 2nd index still same as was %! assert(a(2).timestamp, 20); %! assert(a(2).channel, 12); %! assert(a(2).note, 60); %!test %! as = struct("RawBytes", [0x90 0x3C 0x14], "Timestamp", 10); %! a = midimsg.fromStruct(as); %! assert(length(a) == 1); %! assert(a.type == "NoteOn"); %! assert(a.channel, 1); %! assert(a.timestamp, 10); %! assert(a.msgbytes, uint8([0x90 0x3C 0x14])); %!test %! a1 = midimsg("noteon", 1, 80, 100, 5); %! a2 = midimsg("noteon", 1, 81, 100, 1); %! a3 = midimsg("noteon", 1, 82, 100, 10); %! msgs = [a1 a2 a3]; %! ts = msgs.Timestamp; %! [~, idx] = sort(ts); %! smsgs = msgs(idx); %! assert(smsgs(1).Timestamp, 1) %! assert(smsgs(2).Timestamp, 5) %! assert(smsgs(3).Timestamp, 10) %! assert(smsgs(1).Note, 81) %! assert(smsgs(2).Note, 80) %! assert(smsgs(3).Note, 82) %!test %! # Propertes function %! msg = midimsg('SongPositionPointer',1); %! props = {'Timestamp', 'Type', 'MsgBytes', 'NumMsgBytes', 'SongPosition'}; %! assert(properties(msg), props); %! %! msg = midimsg('PitchBend',1,7192,4.01); %! props = {'Timestamp', 'Type', 'MsgBytes', 'NumMsgBytes', 'Channel', 'PitchChange'}; %! assert(properties(msg), props); ���������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/midimsgtype.m��������������������������������������������������0000664�0000000�0000000�00000021771�15135415131�0022164�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2020-2021 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. classdef midimsgtype ## -*- texinfo -*- ## @deftypefn {} {} midimsgtype ## A midimsg type enumeration for values of the midimsg type. ## ## Enumeration values are: ## @multitable @columnfractions .2 .4 .3 ## @item Data @tab Stop @tab SongPositionPointer ## @item PolyOn @tab PolyKeyPressure @tab NoteOff ## @item EOX @tab ActiveSensing @tab SongSelect ## @item MonoOn @tab ChannelPressure @tab ControlChange ## @item TimingClock @tab SystemReset @tab AllSoundOff ## @item OmniOn @tab PitchBend @tab ProgramChange ## @item Start @tab TuneRequest @tab ResetAllControllers ## @item OmniOff @tab Undefined @tab SystemExclusive ## @item Continue @tab MIDITimeCodeQuarterFrame @tab LocalControl ## @item AllNotesOff @tab MetaEvent @tab ## @end multitable ## ## ## The enumeration value can be used instead of a string in midimsg creation. ## ## @subsubheading Examples ## Use both a string and a midimsgtype for the type parameter of a midimsg. ## @example ## @code { ## # both statements are equivalent ## msg = midimsg('NoteOn', 1, 60, 100); ## msg = midimsg(midimsgtype.NoteOn, 1, 60, 100); ## } ## @end example ## ## @seealso{midimsg} ## @end deftypefn # enumeration doesnt work yet in octave #enumeration # Stop ("Stop") #endenumeration properties (Access = private) value = ""; endproperties # dont allow external creation of objects methods (Access = public, Hidden = true) function this = midimsgtype(value) if nargin < 1 value = "Undefined"; endif enums = this.enum_names(); idx = find( cellfun(@(x) strcmpi(x, value), enums), 1); if isempty (idx) error ("Unknown enum string value"); endif this.value = enums{idx}; endfunction endmethods methods function tf = isenum(this) tf = true; endfunction function results = ismember(this, cmpvals) if nargin < 2 || !iscell(cmpvals) error ("expected cell array to check against"); endif results = 0; for idx = 1:length(cmpvals) if this == cmpvals{idx} results = 1; endif endfor endfunction function tf = eq(this, val) if isa(val, "midimsgtype") val = val.value; endif if ischar(val) == false tf = false; else tf = strcmpi(this.value, val); endif endfunction function tf = ne(this, val) tf = ! eq(this, val); endfunction function tf = strcmp(this, val) if isa(val, "midimsgtype") val = val.value; endif tf = strcmp(this.value, val); endfunction function tf = strcmpi(this, val) if isa(val, "midimsgtype") val = val.value; endif tf = strcmpi(this.value, val); endfunction function tf = strncmp(this, val) if isa(val, "midimsgtype") val = val.value; endif tf = strncmp(this.value, val); endfunction function tf = strncmpi(this, val) if isa(val, "midimsgtype") val = val.value; endif tf = strncmpi(this.value, val); endfunction function s = char(this) s = this.value; endfunction function a = disp(this) if nargout == 0 disp(this.value); else a = [this.value "\n"]; endif endfunction function display(this) printf("%s = %s\n", inputname(1), this.value); endfunction endmethods # methods we will use to fake as readonly enum values methods (Static = true) function outlst = enum_names () persistent lst = {}; if isempty(lst) #classinfo = metaclass(this) classinfo = meta.class.fromName('midimsgtype'); for i = 1:length(classinfo.MethodList) x = classinfo.MethodList{i}; # assuming captital letter static funcs are the enum values if x.Static && !x.Hidden && x.Name(1) <= 'Z' lst{end+1} = x.Name; endif endfor endif outlst = lst; endfunction function outlst = enum_values () persistent lst = {}; if isempty(lst) names = midimsgtype.enum_names(); for i = 1:length(names) lst{end+1} = eval(sprintf("midimsgtype.%s;", names{i})); endfor endif outlst = lst; endfunction function c = NoteOn() persistent v = midimsgtype("NoteOn"); c = v; endfunction function c = NoteOff() persistent v = midimsgtype("NoteOff"); c = v; endfunction function c = ControlChange() persistent v = midimsgtype("ControlChange"); c = v; endfunction function c = ProgramChange() persistent v = midimsgtype("ProgramChange"); c = v; endfunction function c = SystemExclusive() persistent v = midimsgtype("SystemExclusive"); c = v; endfunction function c = Data() persistent v = midimsgtype("Data"); c = v; endfunction function c = EOX() persistent v = midimsgtype("EOX"); c = v; endfunction function c = TimingClock() persistent v = midimsgtype("TimingClock"); c = v; endfunction function c = Start() persistent v = midimsgtype("Start"); c = v; endfunction function c = Continue() persistent v = midimsgtype("Continue"); c = v; endfunction function c = Stop() persistent v = midimsgtype("Stop"); c = v; endfunction function c = ActiveSensing() persistent v = midimsgtype("ActiveSensing"); c = v; endfunction function c = SystemReset() persistent v = midimsgtype("SystemReset"); c = v; endfunction function c = TuneRequest() persistent v = midimsgtype("TuneRequest"); c = v; endfunction function c = MIDITimeCodeQuarterFrame() persistent v = midimsgtype("MIDITimeCodeQuarterFrame"); c = v; endfunction function c = SongPositionPointer() persistent v = midimsgtype("SongPositionPointer"); c = v; endfunction function c = SongSelect() persistent v = midimsgtype("SongSelect"); c = v; endfunction function c = AllSoundOff() persistent v = midimsgtype("AllSoundOff"); c = v; endfunction function c = ResetAllControllers() persistent v = midimsgtype("ResetAllControllers"); c = v; endfunction function c = LocalControl() persistent v = midimsgtype("LocalControl"); c = v; endfunction function c = PolyOn() persistent v = midimsgtype("PolyOn"); c = v; endfunction function c = MonoOn() persistent v = midimsgtype("MonoOn"); c = v; endfunction function c = OmniOff() persistent v = midimsgtype("OmniOff"); c = v; endfunction function c = OmniOn() persistent v = midimsgtype("OmniOn"); c = v; endfunction function c = AllNotesOff() persistent v = midimsgtype("AllNotesOff"); c = v; endfunction function c = PolyKeyPressure() persistent v = midimsgtype("PolyKeyPressure"); c = v; endfunction function c = ChannelPressure() persistent v = midimsgtype("ChannelPressure"); c = v; endfunction function c = PitchBend() persistent v = midimsgtype("PitchBend"); c = v; endfunction function c = MetaEvent() persistent v = midimsgtype("MetaEvent"); c = v; endfunction function c = Undefined() persistent v = midimsgtype("Undefined"); c = v; endfunction function c = Reserved() persistent v = midimsgtype("Reserved"); c = v; endfunction endmethods endclassdef %!fail midimsg.InvalidEnumValue %!test %! t = midimsgtype.NoteOn; %! assert (class(t) == "midimsgtype"); %! c = char (t); %! assert (class(c) == "char"); %! assert (c == "NoteOn"); %!test %! t = midimsgtype.NoteOff; %! assert (isenum(t)); %!test %! t = midimsgtype.NoteOn; %! assert (t == "NoteOn"); %! assert (t == midimsgtype.NoteOn); %! assert (t != midimsgtype.NoteOff); %! assert (strcmp(midimsgtype.NoteOn, "NoteOn")); %! assert (strcmp(midimsgtype.NoteOn, midimsgtype.NoteOn)); %!test %! t = midimsgtype.NoteOn; %! assert(ismember(t, {midimsgtype.NoteOn}), 1); %! assert(ismember(t, {midimsgtype.NoteOff}), 0); %! assert(ismember(t, {midimsgtype.NoteOn, midimsgtype.NoteOff}), 1); �������gnu-octave-octave-audio-125c0f5/inst/midiread.m�����������������������������������������������������0000664�0000000�0000000�00000003202�15135415131�0021374�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2019 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {@var{val} =} midiread (@var{midicontrolsObj}) ## Read current values of midi controls ## ## @subsubheading Inputs ## @var{midicontrolObj} - control object created using midicontrols@* ## ## @subsubheading Outputs ## @var{val} single value or array of current values from the midi device. ## ## @subsubheading Examples ## Read current value of midicontrols with a ctrlid 2001 on the default midi device. ## @example ## ctrl = midicontrols(2001) ## val = midiread(ctrl); ## @end example ## ## Read current value of midicontrols with a ctrlid 2001 on a non default midi device. ## @example ## ctrl = midicontrols(2001, 'mididevice', 1) ## val = midiread(ctrl); ## @end example ## ## @seealso{midicontrols, midisync} ## @end deftypefn function ret = midiread (ctrlobj) if nargin < 1 || !isa (ctrlobj, "midicontrols") error ("Expected midi controls object"); endif ret = ctrlobj.recv(); endfunction ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/midireceive.m��������������������������������������������������0000664�0000000�0000000�00000004121�15135415131�0022104�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2019 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {@var{midimsg} =} midireceive (@var{dev}) ## @deftypefnx {} {@var{midimsg} =} midireceive (@var{dev}, @var{maxmsg}) ## Attempt to receive midi messages from a midi device. ## ## @subsubheading Inputs ## @var{dev} - a octave midi device opened using mididevice.@* ## @var{maxmsg} - Maximum number of messages to retrieve. If not specified, the function will attempt to get all pending.@* ## ## @subsubheading Outputs ## @var{midimsg} - a midimsg containing the messages retrieved from the device.@* ## If no messages are available, @var{midimsg} will be empty. ## ## @subsubheading Examples ## Open device 0, and poll and display read messages ## @example ## dev = mididevice(0); ## while true ## mx = midireceive(dev); ## if !isempty(mx) ## % display message ## mx ## endif ## endwhile ## @end example ## ## @seealso{mididevice, midisend} ## @end deftypefn function msg = midireceive (dev, maxmsg=0) if nargin < 1 || !isobject(dev) || !strcmp(typeinfo(dev), "octave_midi") error ("Expected midi device"); endif if nargin < 2 maxmsg = 0; endif msg = midimsg (0); [ts, data] = __midirecv__(dev); while !isempty(data) msg = [ msg midimsg.createMessage(data, ts) ]; if maxmsg > 0 maxmsg = maxmsg - 1; if maxmsg == 0 break; endif endif [ts, data] = __midirecv__(dev); endwhile endfunction �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/midisend.m�����������������������������������������������������0000664�0000000�0000000�00000005161�15135415131�0021420�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2019 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {} midisend (@var{dev}, @var{msg}) ## @deftypefnx {} {} midisend (@var{dev}, ...) ## Send a midimsg to a midi device ## ## @subsubheading Inputs ## @var{dev} - midi device opened using mididevice@* ## @var{msg} - a midi message class with messages to send to the midi device@* ## If the msg isn't a midimsg class, the input data is expected to be in same format as the inputs to a midimsg object. ## ## @subsubheading Outputs ## None ## ## @subsubheading Examples ## Send a note on/off command to a opened midi device @var{dev} ## @example ## midisend(dev, midimsg("note", 1, 60, 100, 2.0)); ## @end example ## ## @seealso{midimsg, mididevice, midireceive} ## @end deftypefn function midisend (dev, varargin) if nargin < 2 error ("Expected midi device and midi message"); endif if !isobject(dev) || !strcmp(typeinfo(dev), "octave_midi") error ("Expected midi device"); endif msg = varargin{1}; # NOTE: can be an array or cell of messages too if isa (msg, "midimsg") if nargin > 2 error ("additional parameters provided after the message"); endif else # have data to make a message msg = midimsg(varargin{2:end}); endif # TODO: determine if is 'recent' or not for what timestamp to use # currently, we 'assume' that the 1st midi msg must go NOW if length(msg) > 0 timestamp = msg(1).timestamp; else timestamp = 0; endif # loop thru data and send each message for i=1:length(msg) m = msg(i); ts = m.timestamp; data = m.msgbytes; if ts < timestamp ts = timestamp - ts; endif delta = (ts - timestamp); if delta < 0 delta = 0; endif pause(delta); # if we have metaevents, dont send them length would be FF type encodedsize data if length(data) < 3 || data(1) != 0xff __midisend__(dev, ts, data); endif timestamp = timestamp + delta; endfor endfunction ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/midisync.m�����������������������������������������������������0000664�0000000�0000000�00000003160�15135415131�0021440�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2019 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {} midisync (@var{midicontrolsObj}) ## @deftypefnx {} {} midisync (@var{midicontrolsObj}, @var{ctrlvalues}) ## Send the values of control object to the control, using @var{ctrlvalues} values ## if specified instead ## ## @subsubheading Inputs ## @var{midicontrolObj} - control object created using midicontrols@* ## @var{ctrlvalues} - values to send to the controls instead of initial values ## ## @subsubheading Outputs ## None ## ## @subsubheading Examples ## Send sync command to a midicontrols with a ctrlid 2001 to set a value of 1 ## @example ## ctrl = midicontrols(2001) ## midisync(ctrl, 1); ## @end example ## ## @seealso{midicontrols} ## @end deftypefn function midisync (ctrlobj, values) if nargin < 1 || !isa (ctrlobj, "midicontrols") error ("Expected midi controls object"); endif if nargin < 2 ctrlobj.send() else ctrlobj.send(values) endif endfunction ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/phon2sone.m����������������������������������������������������0000664�0000000�0000000�00000006416�15135415131�0021543�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2024 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {@var{sone} =} phon2sone (@var{phon}) ## @deftypefnx {} {@var{sone} =} phon2sone (@var{phon}, @var{standard}) ## Convert from phon to sone ## ## @subsubheading Inputs ## @var{phon} - Loudness level in phon ## ## @var{standard} - Standard to use in conversion. Options are ## 'ISO 532-1' or 'ISO 532-2'. ## ## 'ISO 532-1' is used if no standard is provided. ## ## @subsubheading Outputs ## @var{sone} - Loudness level in sone ## ## @subsubheading Examples ## Convert 100 phon to sone ## @example ## @code{sone = phon2sone(100)} ## @end example ## ## @subsubheading References ## International Organization for Standardization., @cite{ISO 532-1 Acoustics – Methods for calculating loudness – Part 1: Zwicker method.} ## ## International Organization for Standardization., @cite{ISO 532-2 Acoustics – Methods for calculating loudness – Part 2: Moore-Glasberg method.} ## ## https://sengpielaudio.com/calculatorSonephon.htm ## ## @seealso {sone2phon} ## @end deftypefn function sone = phon2sone(phon, standard='ISO 532-1') if nargin < 1 show_usage() endif if ! (isnumeric(phon) && isreal(phon)) error ("Expected phon as a real scalar or vector"); endif if ! ischar(standard) error ("Expected standard as a string"); endif standard = lower(standard); if standard != 'iso 532-1' && standard != 'iso 532-2' error ("Uknown standard specified - expected 'iso 532-1' or 'iso 532-2'"); endif if standard == 'iso 532-1' idx1 = find(phon<40); idx2 = find(phon>=40); sone(idx1) = (phon(idx1) / 40) .^ 2.642; sone(idx2) = 2 .^ ((phon(idx2) - 40) / 10); else lookup_tbl = [ 0.0 0.001; 2.2 0.004; 4.0 0.008; 5.0 0.010; 7.5 0.019; 10.0 0.031; 15.0 0.073; 20.0 0.146; 25.0 0.26; 30.0 0.43; 35.0 0.67; 40.0 1.00; 45.0 1.46; 50.0 2.09; 55.0 2.96; 60.0 4.14; 65.0 5.77; 70.0 8.04; 75.0 11.2; 80.0 15.8; 85.0 22.7; 90.0 32.9; 95.0 47.7; 100.0 69.6; 105.0 102.0; 110.0 151.0; 115.0 225.0; 120.0 337.6; ]; idx1 = find(phon<0.0); idx2 = find(phon>=0 & phon<120); idx3 = find(phon>=120); sone(idx1) = 0.0; sone(idx2) = interp1(lookup_tbl(:,1), lookup_tbl(:,2), phon(idx2), 'linear'); sone(idx3) = 337.6; endif endfunction %!error phon2sone() %!error phon2sone('a') %!error phon2sone([100], 'invalid') %!assert(phon2sone(80), 16, 100*eps) %!assert(phon2sone(80, 'ISO 532-1'), 16, 100*eps) %!assert(phon2sone(80, 'ISO 532-2'), 15.8, 100*eps) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/private/�������������������������������������������������������0000775�0000000�0000000�00000000000�15135415131�0021115�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/private/getvariable.m������������������������������������������0000664�0000000�0000000�00000002035�15135415131�0023560�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2019 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {@var{t} =} getvariable (@var{fd}) ## Private function ## @end deftypefn function t = getvariable (fd) t = uint64(0); while !feof(fd) b = fread(fd, 1, "uint8"); t = bitshift(t, 7) + bitand(b, uint64(0x7f)); if b < 128 break; endif endwhile t = double(t); endfunction ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/private/readheader.m�������������������������������������������0000664�0000000�0000000�00000002050�15135415131�0023354�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2019 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {@var{h} =} readheader (@var{fd}) ## Private function ## @end deftypefn function h = readheader (fd) blocktype = char(fread(fd,[1 4],"char")); blocksize = fread(fd,1,"uint32",0, 'ieee-be'); h = {}; if !isempty(blocksize) h.blocksize = blocksize; h.blocktype = blocktype; endif endfunction ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/private/setvariable.m������������������������������������������0000664�0000000�0000000�00000002356�15135415131�0023602�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2019 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {} setvariable (@var{fd}, @var{value}) ## Private function ## @end deftypefn function setvariable (fd, value) t = uint64(value); data = []; if t < 128 v = uint8(t); fwrite(fd, v, 'uint8'); else tmp = dec2bin(t); while mod(length(tmp), 7) != 0 tmp = [ "0" tmp ]; endwhile for i=1:7:length(tmp) v = tmp(i:i+6); v = uint8(bin2dec(v)); if i < length(tmp) -7 v = 128 + v; endif fwrite(fd, v, 'uint8'); endfor endif endfunction ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/private/writeheader.m������������������������������������������0000664�0000000�0000000�00000001707�15135415131�0023603�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2019 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {} writeheader (@var{fd}, @var{hdr}) ## Private function ## @end deftypefn function writeheader (fd, hdr) fwrite (fd, hdr.blocktype, 'char'); fwrite (fd, hdr.blocksize, 'uint32', 0, 'ieee-be'); endfunction ���������������������������������������������������������gnu-octave-octave-audio-125c0f5/inst/sone2phon.m����������������������������������������������������0000664�0000000�0000000�00000006424�15135415131�0021542�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Copyright (C) 2024 John Donoghue <john.donoghue@ieee.org> ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program. If not, see ## <https://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {} {@var{phon} =} sone2phon (@var{sone}) ## @deftypefnx {} {@var{phon} =} sone2phon (@var{sone}, @var{standard}) ## Convert from sone to phon. ## ## @subsubheading Inputs ## @var{sone} - Loudness level in sone ## ## @var{standard} - Standard to use in conversion. Options are ## 'ISO 532-1' or 'ISO 532-2'. ## ## 'ISO 532-1' is used if no standard is provided. ## ## @subsubheading Outputs ## @var{sone} - Loudness level in sone ## ## @subsubheading Examples ## Convert 100 sone to phon ## @example ## @code{phon = sone2phon(100)} ## @end example ## ## @subsubheading References ## International Organization for Standardization., @cite{ISO 532-1 Acoustics – Methods for calculating loudness – Part 1: Zwicker method.} ## ## International Organization for Standardization., @cite{ISO 532-2 Acoustics – Methods for calculating loudness – Part 2: Moore-Glasberg method.} ## ## https://sengpielaudio.com/calculatorSonephon.htm ## ## @seealso {sone2phon} ## @end deftypefn function phon = sone2phon(sone, standard='ISO 532-1') if nargin < 1 show_usage() endif if ! (isnumeric(sone) && isreal(sone)) error ("Expected sone as a real scalar or vector"); endif if ! ischar(standard) error ("Expected standard as a string"); endif standard = lower(standard); if standard != 'iso 532-1' && standard != 'iso 532-2' error ("Uknown standard specified - expected 'iso 532-1' or 'iso 532-2'"); endif if standard == 'iso 532-1' idx1 = find(sone<1); idx2 = find(sone>=1); phon(idx1) = 40 * (sone(idx1) .^ 0.35); phon(idx2) = 40 + (10 * log2(sone(idx2))); else lookup_tbl = [ 0.0 0.001; 2.2 0.004; 4.0 0.008; 5.0 0.010; 7.5 0.019; 10.0 0.031; 15.0 0.073; 20.0 0.146; 25.0 0.26; 30.0 0.43; 35.0 0.67; 40.0 1.00; 45.0 1.46; 50.0 2.09; 55.0 2.96; 60.0 4.14; 65.0 5.77; 70.0 8.04; 75.0 11.2; 80.0 15.8; 85.0 22.7; 90.0 32.9; 95.0 47.7; 100.0 69.6; 105.0 102.0; 110.0 151.0; 115.0 225.0; 120.0 337.6; ]; idx1 = find(sone<0.001); idx2 = find(sone>0.001 & sone<337.6); idx3 = find(sone>=337.6); phon(idx1) = 0.0; phon(idx2) = interp1(lookup_tbl(:,2), lookup_tbl(:,1), sone(idx2), 'linear'); phon(idx3) = 120.0; endif endfunction %!error sone2phon() %!error sone2phon('a') %!error sone2phon([100], 'invalid') %!assert(sone2phon(16), 80, 100*eps) %!assert(sone2phon(16, 'ISO 532-1'), 80, 100*eps) %!assert(sone2phon(15.8, 'ISO 532-2'), 80, 100*eps) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/octave-audio.metainfo.xml�������������������������������������������0000664�0000000�0000000�00000002045�15135415131�0023372�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright 2023 John Donoghue Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty. --> <component type="addon"> <id>octave-audio</id> <extends>www.octave.org-octave.desktop</extends> <name>Audio Toolkit</name> <summary>Octave Audio toolkit</summary> <description> <p>Toolkit for MIDI and additional audio functions</p> </description> <keywords> <keyword>audio</keyword> <keyword>MIDI</keyword> <keyword>scientific</keyword> </keywords> <url type="homepage">https://gnu-octave.github.io/octave-audio/</url> <url type="bugtracker">https://github.com/gnu-octave/octave-audio/issues</url> <project_license>GPL-3.0+</project_license> <developer_name>Octave-Forge Community</developer_name> <update_contact>octave-maintainers@gnu.org</update_contact> <metadata_license>FSFAP</metadata_license> </component> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/src/����������������������������������������������������������������0000775�0000000�0000000�00000000000�15135415131�0017255�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/src/.svnignore������������������������������������������������������0000664�0000000�0000000�00000000031�15135415131�0021262�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������autom4te.cache configure �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/src/Makefile.in�����������������������������������������������������0000664�0000000�0000000�00000001235�15135415131�0021323�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������MKOCTFILE := @MKOCTFILE@ CXXFLAGS := @CXXFLAGS@ @RTMIDI_CFLAGS@ @PTHREAD_CFLAGS@ @DEFS@ LIBS := @LIBS@ @RTMIDI_LIBS@ @PTHREAD_LIBS@ LDFLAGS := @LDFLAGS@ SRC := mididevinfo.cc mididevice.cc midi.cc midi_object.cc midisend.cc midirecv.cc \ midistat.cc midiflush.cc midicallback.cc pkglock.cc OBJ := $(SRC:.cc=.o) all: __midi__.oct %.o: %.cc $(MKOCTFILE) -c $< $(CXXFLAGS) __midi__.oct: $(OBJ) $(MKOCTFILE) -o __midi__.oct $(OBJ) $(LDFLAGS) $(LIBS) .PHONY: clean .PHONY: distclean .PHONY: all clean: rm -f *.o rm -f *.oct distclean: clean rm -rf autom4te.cache rm -r oct-alt-includes.h rm -f config.status config.log config.h rm -f Makefile �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/src/bootstrap�������������������������������������������������������0000775�0000000�0000000�00000000344�15135415131�0021221�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/bash ## Octave-Forge: video package bootstrap script ## Run this to generate the configure script set -e # halt if unhandled error aclocal autoconf # generate configure script autoheader -f rm -rf autom4te.cache ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/src/config.guess����������������������������������������������������0000775�0000000�0000000�00000123672�15135415131�0021610�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2015 Free Software Foundation, Inc. timestamp='2015-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see <http://www.gnu.org/licenses/>. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches to <config-patches@gnu.org>. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to <config-patches@gnu.org>." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include <features.h> #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include <stdio.h> /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include <sys/systemcfg.h> main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include <stdlib.h> #include <unistd.h> int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include <unistd.h> int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` echo ${UNAME_MACHINE}-pc-isc$UNAME_REL elif /bin/uname -X 2>/dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says <Richard.M.Bartel@ccMail.Census.GOV> echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes <hewes@openmarket.com>. # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac cat >&2 <<EOF $0: unable to guess system type This script, last modified $timestamp, has failed to recognize the operating system you are using. It is advised that you download the most up to date version of the config scripts from http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD and http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD If the version you run ($0) is already up to date, please send the following data and any information you think might be pertinent to <config-patches@gnu.org> in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ����������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/src/config.sub������������������������������������������������������0000775�0000000�0000000�00000106246�15135415131�0021251�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2015 Free Software Foundation, Inc. timestamp='2015-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see <http://www.gnu.org/licenses/>. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to <config-patches@gnu.org>. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to <config-patches@gnu.org>." version="\ GNU config.sub ($timestamp) Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/src/configure.ac����������������������������������������������������0000664�0000000�0000000�00000014552�15135415131�0021552�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. # ### Copyright (C) 2019-2026 John Donoghue <john.donoghue@ieee.org> ### ### This program is free software; you can redistribute it and/or ### modify it under the terms of the GNU General Public License as ### published by the Free Software Foundation; either version 3 of the ### License, or (at your option) any later version. ### ### This program is distributed in the hope that it will be useful, ### but WITHOUT ANY WARRANTY; without even the implied warranty of ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ### General Public License for more details. ### ### You should have received a copy of the GNU General Public License ### along with this program; if not, see ### <http://www.gnu.org/licenses/>. AC_PREREQ([2.67]) AC_INIT([octave audio package], [2.0.10]) AC_CONFIG_HEADERS([config.h]) # Avoid warnings for redefining AH-generated preprocessor symbols of # Octave. AH_TOP([#include "undef-ah-octave.h"]) AC_CONFIG_MACRO_DIRS([m4]) AC_CANONICAL_HOST AC_CANONICAL_TARGET # Checks for programs. AC_PROG_SED AC_PROG_CXX AC_LANG(C++) AC_CHECK_TOOL([MKOCTFILE], [mkoctfile], [none]) if [ test "$MKOCTFILE" = "none" ]; then AC_MSG_ERROR([mkoctfile required to install $PACKAGE_NAME]) fi # try get around possible spaces in the path if test "X${IGNORE_MINGW_PATH_MODIFICATION}" == "X"; then case $host_os in mingw*) # try demangle spaces in escaped input strings MKOCTFILE=`echo $MKOCTFILE | $SED "s,\\\\\ ,?,g"` ;; *) ;; esac fi # Check for RTMIDI save_CXXFLAGS="$CXXFLAGS" save_LIBS="$LIBS" PKG_CHECK_MODULES(RTMIDI,rtmidi,[have_rtmidi=yes],[have_rtmidi=no]) if test "$have_rtmidi" = "yes"; then AC_DEFINE(HAVE_RTMIDI, 1, [Define to 1 to use the rtmidi library.]) CXXFLAGS="$CXXFLAGS $RTMIDI_CFLAGS" LIBS="$LIBS $RTMIDI_LIBS" else AC_MSG_ERROR([RTMIDI required to install $PACKAGE_NAME]) fi # Check for RtMidi::getApiName AC_MSG_CHECKING([RtMidi::getApiName]) have_get_api_name=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <RtMidi.h> #include <string> ]], [ std::string n = RtMidi::getApiName(RtMidi::LINUX_ALSA); ])], [AC_MSG_RESULT([yes]) have_api_name=yes], [AC_MSG_RESULT([no])] ) CXXFLAGS=$save_CXXFLAGS LIBS=$save_LIBS if test $have_get_api_name = yes; then AC_DEFINE([HAVE_RTMIDI_GETAPINAME], [1], [have the RtMidi::getApiName function]) fi # Check for pthreads AX_PTHREAD([],[AC_MSG_ERROR([thread library is needed to install $PACKAGE_NAME])]) # Checks for octave depreciated symbols ## Simple symbol alternatives of different Octave versions. save_altsyms_CXX="$CXX" save_altsyms_CXXFLAGS="$CXXFLAGS" save_altsyms_LDFLAGS="$LDFLAGS" save_altsyms_LIBS="$LIBS" OCTINCLUDEDIR="${OCTINCLUDEDIR:-`$MKOCTFILE -p OCTINCLUDEDIR`}/.." OCTLIBDIR=${OCTLIBDIR:-`$MKOCTFILE -p OCTLIBDIR`} if test "X${IGNORE_MINGW_PATH_MODIFICATION}" == "X"; then MSYSTEM="${MSYSTEM}" else MSYSTEM="none" fi case X$MSYSTEM in XMINGW64*) OCTAVE_HOME=`${MKOCTFILE} -p OCTAVE_HOME | $SED 's,\\\\,/,g'` # change \ to / and replace octave home part with mingw part OCTINCLUDEDIR=`echo $OCTINCLUDEDIR | $SED -e 's,\\\\,/,g' -e "s,${OCTAVE_HOME},/mingw64,g"` OCTLIBDIR=`echo $OCTLIBDIR | $SED -e 's,\\\\,/,g' -e "s,${OCTAVE_HOME},/mingw64,g"` ;; XMINGW32*) OCTAVE_HOME=`${MKOCTFILE} -p OCTAVE_HOME | $SED 's,\\\\,/,g'` # change \ to / and replace octave home part with mingw part OCTINCLUDEDIR=`echo $OCTINCLUDEDIR | $SED -e 's,\\\\,/,g' -e "s,${OCTAVE_HOME},/mingw32,g"` OCTLIBDIR=`echo $OCTLIBDIR | $SED -e 's,\\\\,/,g -e "s,${OCTAVE_HOME},/mingw32,g"'` ;; *) ;; esac CXX=`${MKOCTFILE} -p CXX` CXXFLAGS="-I$OCTINCLUDEDIR $CXXFLAGS" LDFLAGS="-L$OCTLIBDIR $LDFLAGS" LIBS="-loctinterp $LIBS" OF_OCTAVE_LIST_ALT_SYMS([ [dnl [feval], [octave::feval], [[octave::feval ("date");]], [OCTAVE__FEVAL], [[#include <octave/parse.h>]], [[#include <octave/parse.h>]] ], [dnl [is_float_type], [isfloat], [[octave_value ().isfloat ();]], [OV_ISFLOAT], [], [] ], [dnl [is_integer_type], [isinteger], [[octave_value ().isinteger ();]], [OV_ISINTEGER], [], [] ], [dnl [is_cell], [iscell], [[octave_value ().iscell ();]], [OV_ISCELL], [], [] ], [dnl [octave_execution_exception], [octave::execution_exception], [[octave::execution_exception err;]], [OCTAVE_EXECUTION_EXCEPTION], [#include <octave/quit.h>], [#include <octave/quit.h>] ], [dnl [octave_base_value], [octave_base_dld_value], [[octave_base_dld_value tmp;]], [OCTAVE_BASE_CLASS], [], [] ] ],[oct-alt-includes.h]) # check if method of getting execution exception message AC_MSG_CHECKING([for execution_exception message field]) octave_execution_field=none AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <octave/oct.h> #include <octave/quit.h> ]], [ OCTAVE_EXECUTION_EXCEPTION err; err.message(); ])], [octave_execution_field=message], [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <octave/oct.h> #include <octave/quit.h> ]], [ OCTAVE_EXECUTION_EXCEPTION err; err.info(); ])], [octave_execution_field=info], []) ] ) AC_MSG_RESULT([$octave_execution_field]) AC_DEFINE_UNQUOTED([OCTAVE_EXCEPTION_MESSAGE],$octave_execution_field,[execution_exception message field]) if test $octave_execution_field != none; then AC_DEFINE([HAS_OCTAVE_EXCEPTION_MESSAGE],[1],[has some kid of execution_exception message field]) fi AC_MSG_CHECKING([for octave_base_value count field]) octave_count_field=count AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <octave/oct.h> #ifdef HAVE_CONFIG_H # include "config.h" #endif class test_base_class : public octave_base_value { public: test_base_class() {} ~test_base_class() {} void test() { m_count ++; } bool is_object (void) const { return true; } }; ]], [ test_base_class t; t.is_object(); ])], [octave_count_field=m_count], [octave_count_field=count] ) AC_MSG_RESULT([$octave_count_field]) AC_DEFINE_UNQUOTED([OV_COUNT],$octave_count_field,[octave_base_value ref count field]) CXX=$save_altsyms_CXX CXXFLAGS=$save_altsyms_CXXFLAGS LDFLAGS=$save_altsyms_LDFLAGS LIBS=$save_altsyms_LIBS AC_CONFIG_FILES([Makefile]) AC_OUTPUT AC_MSG_NOTICE([ $PACKAGE_NAME is configured with: LIBS: $LIBS $RTMIDI_LIBS $PTHREAD_LIBS CXXFLAGS: $CXXFLAGS $RTMIDI_CFLAGS $PTHREAD_CFLAGS $DEFS ]) ������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/src/m4/�������������������������������������������������������������0000775�0000000�0000000�00000000000�15135415131�0017575�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/src/m4/ax_pthread.m4������������������������������������������������0000664�0000000�0000000�00000054035�15135415131�0022165�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_pthread.html # =========================================================================== # # SYNOPSIS # # AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) # # DESCRIPTION # # This macro figures out how to build C programs using POSIX threads. It # sets the PTHREAD_LIBS output variable to the threads library and linker # flags, and the PTHREAD_CFLAGS output variable to any special C compiler # flags that are needed. (The user can also force certain compiler # flags/libs to be tested by setting these environment variables.) # # Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is # needed for multi-threaded programs (defaults to the value of CC # respectively CXX otherwise). (This is necessary on e.g. AIX to use the # special cc_r/CC_r compiler alias.) # # NOTE: You are assumed to not only compile your program with these flags, # but also to link with them as well. For example, you might link with # $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS # $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS # # If you are only building threaded programs, you may wish to use these # variables in your default LIBS, CFLAGS, and CC: # # LIBS="$PTHREAD_LIBS $LIBS" # CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" # CC="$PTHREAD_CC" # CXX="$PTHREAD_CXX" # # In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant # has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to # that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). # # Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the # PTHREAD_PRIO_INHERIT symbol is defined when compiling with # PTHREAD_CFLAGS. # # ACTION-IF-FOUND is a list of shell commands to run if a threads library # is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it # is not found. If ACTION-IF-FOUND is not specified, the default action # will define HAVE_PTHREAD. # # Please let the authors know if this macro fails on any platform, or if # you have any other suggestions or comments. This macro was based on work # by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help # from M. Frigo), as well as ac_pthread and hb_pthread macros posted by # Alejandro Forero Cuervo to the autoconf macro repository. We are also # grateful for the helpful feedback of numerous users. # # Updated for Autoconf 2.68 by Daniel Richard G. # # LICENSE # # Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> # Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG> # Copyright (c) 2019 Marc Stevens <marc.stevens@cwi.nl> # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see <https://www.gnu.org/licenses/>. # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 31 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_SED]) AC_LANG_PUSH([C]) ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on Tru64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then ax_pthread_save_CC="$CC" ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"]) CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes]) AC_MSG_RESULT([$ax_pthread_ok]) if test "x$ax_pthread_ok" = "xno"; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi CC="$ax_pthread_save_CC" CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items with a "," contain both # C compiler flags (before ",") and linker flags (after ","). Other items # starting with a "-" are C compiler flags, and remaining items are # library names, except for "none" which indicates that we try without # any flags at all, and "pthread-config" which is a program returning # the flags for the Pth emulation library. ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 # (Note: HP C rejects this with "bad form for `-t' option") # -pthreads: Solaris/gcc (Note: HP C also rejects) # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads and # -D_REENTRANT too), HP C (must be checked before -lpthread, which # is present but should not be used directly; and before -mthreads, # because the compiler interprets this as "-mt" + "-hreads") # -mthreads: Mingw32/gcc, Lynx/gcc # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case $host_os in freebsd*) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) ax_pthread_flags="-kthread lthread $ax_pthread_flags" ;; hpux*) # From the cc(1) man page: "[-mt] Sets various -D flags to enable # multi-threading and also sets -lpthread." ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" ;; openedition*) # IBM z/OS requires a feature-test macro to be defined in order to # enable POSIX threads at all, so give the user a hint if this is # not set. (We don't define these ourselves, as they can affect # other portions of the system API in unpredictable ways.) AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING], [ # if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) AX_PTHREAD_ZOS_MISSING # endif ], [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])]) ;; solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (N.B.: The stubs are missing # pthread_cleanup_push, or rather a function called by this macro, # so we could check for that, but who knows whether they'll stub # that too in a future libc.) So we'll check first for the # standard Solaris way of linking pthreads (-mt -lpthread). ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags" ;; esac # Are we compiling with Clang? AC_CACHE_CHECK([whether $CC is Clang], [ax_cv_PTHREAD_CLANG], [ax_cv_PTHREAD_CLANG=no # Note that Autoconf sets GCC=yes for Clang as well as GCC if test "x$GCC" = "xyes"; then AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG], [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ # if defined(__clang__) && defined(__llvm__) AX_PTHREAD_CC_IS_CLANG # endif ], [ax_cv_PTHREAD_CLANG=yes]) fi ]) ax_pthread_clang="$ax_cv_PTHREAD_CLANG" # GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) # Note that for GCC and Clang -pthread generally implies -lpthread, # except when -nostdlib is passed. # This is problematic using libtool to build C++ shared libraries with pthread: # [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 # [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333 # [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555 # To solve this, first try -pthread together with -lpthread for GCC AS_IF([test "x$GCC" = "xyes"], [ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"]) # Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first AS_IF([test "x$ax_pthread_clang" = "xyes"], [ax_pthread_flags="-pthread,-lpthread -pthread"]) # The presence of a feature test macro requesting re-entrant function # definitions is, on some systems, a strong hint that pthreads support is # correctly enabled case $host_os in darwin* | hpux* | linux* | osf* | solaris*) ax_pthread_check_macro="_REENTRANT" ;; aix*) ax_pthread_check_macro="_THREAD_SAFE" ;; *) ax_pthread_check_macro="--" ;; esac AS_IF([test "x$ax_pthread_check_macro" = "x--"], [ax_pthread_check_cond=0], [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"]) if test "x$ax_pthread_ok" = "xno"; then for ax_pthread_try_flag in $ax_pthread_flags; do case $ax_pthread_try_flag in none) AC_MSG_CHECKING([whether pthreads work without any flags]) ;; *,*) PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"` PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"` AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"]) ;; -*) AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) PTHREAD_CFLAGS="$ax_pthread_try_flag" ;; pthread-config) AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) AS_IF([test "x$ax_pthread_config" = "xno"], [continue]) PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag]) PTHREAD_LIBS="-l$ax_pthread_try_flag" ;; esac ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h> # if $ax_pthread_check_cond # error "$ax_pthread_check_macro must be defined" # endif static void *some_global = NULL; static void routine(void *a) { /* To avoid any unused-parameter or unused-but-set-parameter warning. */ some_global = a; } static void *start_routine(void *a) { return a; }], [pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); pthread_join(th, 0); pthread_attr_init(&attr); pthread_cleanup_push(routine, 0); pthread_cleanup_pop(0) /* ; */])], [ax_pthread_ok=yes], []) CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" AC_MSG_RESULT([$ax_pthread_ok]) AS_IF([test "x$ax_pthread_ok" = "xyes"], [break]) PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Clang needs special handling, because older versions handle the -pthread # option in a rather... idiosyncratic way if test "x$ax_pthread_clang" = "xyes"; then # Clang takes -pthread; it has never supported any other flag # (Note 1: This will need to be revisited if a system that Clang # supports has POSIX threads in a separate library. This tends not # to be the way of modern systems, but it's conceivable.) # (Note 2: On some systems, notably Darwin, -pthread is not needed # to get POSIX threads support; the API is always present and # active. We could reasonably leave PTHREAD_CFLAGS empty. But # -pthread does define _REENTRANT, and while the Darwin headers # ignore this macro, third-party headers might not.) # However, older versions of Clang make a point of warning the user # that, in an invocation where only linking and no compilation is # taking place, the -pthread option has no effect ("argument unused # during compilation"). They expect -pthread to be passed in only # when source code is being compiled. # # Problem is, this is at odds with the way Automake and most other # C build frameworks function, which is that the same flags used in # compilation (CFLAGS) are also used in linking. Many systems # supported by AX_PTHREAD require exactly this for POSIX threads # support, and in fact it is often not straightforward to specify a # flag that is used only in the compilation phase and not in # linking. Such a scenario is extremely rare in practice. # # Even though use of the -pthread flag in linking would only print # a warning, this can be a nuisance for well-run software projects # that build with -Werror. So if the active version of Clang has # this misfeature, we search for an option to squash it. AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread], [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG], [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown # Create an alternate version of $ac_link that compiles and # links in two steps (.c -> .o, .o -> exe) instead of one # (.c -> exe), because the warning occurs only in the second # step ax_pthread_save_ac_link="$ac_link" ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' ax_pthread_link_step=`AS_ECHO(["$ac_link"]) | sed "$ax_pthread_sed"` ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" ax_pthread_save_CFLAGS="$CFLAGS" for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do AS_IF([test "x$ax_pthread_try" = "xunknown"], [break]) CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" ac_link="$ax_pthread_save_ac_link" AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], [ac_link="$ax_pthread_2step_ac_link" AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], [break]) ]) done ac_link="$ax_pthread_save_ac_link" CFLAGS="$ax_pthread_save_CFLAGS" AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no]) ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" ]) case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in no | unknown) ;; *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; esac fi # $ax_pthread_clang = yes # Various other checks: if test "x$ax_pthread_ok" = "xyes"; then ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. AC_CACHE_CHECK([for joinable pthread attribute], [ax_cv_PTHREAD_JOINABLE_ATTR], [ax_cv_PTHREAD_JOINABLE_ATTR=unknown for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>], [int attr = $ax_pthread_attr; return attr /* ; */])], [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break], []) done ]) AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ test "x$ax_pthread_joinable_attr_defined" != "xyes"], [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$ax_cv_PTHREAD_JOINABLE_ATTR], [Define to necessary symbol if this constant uses a non-standard name on your system.]) ax_pthread_joinable_attr_defined=yes ]) AC_CACHE_CHECK([whether more special flags are required for pthreads], [ax_cv_PTHREAD_SPECIAL_FLAGS], [ax_cv_PTHREAD_SPECIAL_FLAGS=no case $host_os in solaris*) ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" ;; esac ]) AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ test "x$ax_pthread_special_flags_added" != "xyes"], [PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" ax_pthread_special_flags_added=yes]) AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], [ax_cv_PTHREAD_PRIO_INHERIT], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], [[int i = PTHREAD_PRIO_INHERIT; return i;]])], [ax_cv_PTHREAD_PRIO_INHERIT=yes], [ax_cv_PTHREAD_PRIO_INHERIT=no]) ]) AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ test "x$ax_pthread_prio_inherit_defined" != "xyes"], [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.]) ax_pthread_prio_inherit_defined=yes ]) CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" # More AIX lossage: compile with *_r variant if test "x$GCC" != "xyes"; then case $host_os in aix*) AS_CASE(["x/$CC"], [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], [#handle absolute path differently from PATH based program lookup AS_CASE(["x$CC"], [x/*], [ AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"]) AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])]) ], [ AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC]) AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])]) ] ) ]) ;; esac fi fi test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" AC_SUBST([PTHREAD_LIBS]) AC_SUBST([PTHREAD_CFLAGS]) AC_SUBST([PTHREAD_CC]) AC_SUBST([PTHREAD_CXX]) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test "x$ax_pthread_ok" = "xyes"; then ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) : else ax_pthread_ok=no $2 fi AC_LANG_POP ])dnl AX_PTHREAD ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/src/m4/octave-forge.m4����������������������������������������������0000664�0000000�0000000�00000005760�15135415131�0022430�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Copyright (C) 2017-2018 Olaf Till <i7tiol@t-online.de> # Modifications to print what is searching for by JohnD # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see <http://www.gnu.org/licenses/>. # arguments of OF_OCTAVE_ALT_SYMS (see also description of # OF_OCTAVE_LIST_ALT_SYMS below): # # $1: symbol version 1 # $2: symbol version 2 # $3: test for symbol version 2 # $4: macro name to access alternative symbols # $5: include directives for symbol version 1 # $6: include directives for symbol version 2 # (a list of lists of args 1--6 is $1 of OF_OCTAVE_LIST_ALT_SYMS) # $7: name of generated include file with alternatives of Octave headers # (arg7 is $2 of OF_OCTAVE_LIST_ALT_SYMS) AC_DEFUN([OF_OCTAVE_ALT_SYMS], [ AC_MSG_CHECKING([$1 or $2]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include <octave/oct.h>] $6], [$3])], [AC_DEFINE($4, [[$2]], [macro for alternative Octave symbols]) AC_MSG_RESULT([$2]) echo '$6' >> $7], [AC_DEFINE($4, [[$1]], [macro for alternative Octave symbols]) AC_MSG_RESULT([$1]) echo '$5' >> $7] ) ]) # OF_OCTAVE_LIST_ALT_SYMS is called in the following way: # # OF_OCTAVE_LIST_ALT_SYMS([ # [dnl # [old_octave_symbol], # [new_octave_symbol], # [[compilation test] # [for new_octave_symbol]], # [NAME_OF_GENERATED_MACRO____WILL_EXPAND_TO_OLD_OR_NEW_SYMBOL], # [[include directives] # [except #include <octave/oct.h>] # [necessary to compile with old_octave_symbol]], # [[include directives] # [except #include <octave/oct.h>] # [nessary to compile with new_octave_symbol] # [and to compile the test]] # ], # # ... further such lists as the above # # ], # # [name-of-header-file-for-alternative-octave-iclude-directives.h]) # # # This file should be put into src/m4/, and the line # # AC_CONFIG_MACRO_DIRS([m4]) # # should be put into src/configure.ac. The package should use # autoheader to generate config.h.in (src/bootstrap should contain the # lines 'aclocal', 'autoconf', and 'autoheader -f'). Package code # should include config.h and use the generated macros to access the # alternative symbols of Octave. An example of a call to # OF_OCTAVE_LIST_ALT_SYMS in src/configure.ac is available together # with this file. AC_DEFUN([OF_OCTAVE_LIST_ALT_SYMS], [ echo '/* generated by configure */' > $2 m4_foreach([it], [$1], [m4_apply([OF_OCTAVE_ALT_SYMS], [it, $2])]) AH_BOTTOM([#include "$2"]) ]) ����������������gnu-octave-octave-audio-125c0f5/src/midi.cc���������������������������������������������������������0000664�0000000�0000000�00000014706�15135415131�0020516�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (C) 2019 John Donoghue <john.donoghue@ieee.org> // // This program is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free Software // Foundation; either version 3 of the License, or (at your option) any later // version. // // This program is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // this program; if not, see <http://www.gnu.org/licenses/>. #include <octave/oct.h> #include <RtMidi.h> #include "midi.h" #include <deque> #if defined (HAVE_CONFIG_H) # include "config.h" #endif static std::string api_name(RtMidi::Api api) { std::string name; #ifdef HAVE_RTMIDI_GETAPINAME name = RtMidi::getApiName(api); #else switch(api) { case RtMidi::MACOSX_CORE: name = "MacOS Core"; break; case RtMidi::LINUX_ALSA: name = "Alsa"; break; case RtMidi::UNIX_JACK: name = "Jack"; break; case RtMidi::WINDOWS_MM: name = "MMSystem"; break; default: break; } #endif if (name.length() == 0) name = "Unknown"; return name; } class msg_info { public: std::vector<unsigned char> data; double timestamp; msg_info(const std::vector<unsigned char> &d, double dt = 0.0) { data = d; timestamp = dt; } }; #include <pthread.h> pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; class Locker { pthread_mutex_t mutex; public: Locker(pthread_mutex_t m) { mutex = m; pthread_mutex_lock(&mutex); } virtual ~Locker() { pthread_mutex_unlock(&mutex); } }; class midi_device { public: RtMidiIn *in; RtMidiOut *out; midi_device_info in_info; midi_device_info out_info; double tstamp; std::deque<msg_info> messages; MidiCallback callback; void *userdata; midi_device () { in = 0; out = 0; callback = 0; userdata = 0; tstamp = 0; out = new RtMidiOut(); in = new RtMidiIn(); } virtual ~midi_device () { if(in) delete in; if(out) delete out; callback = 0; } void push_message(const std::vector< unsigned char > &message, double deltatime) { Locker lock(mutex); tstamp = tstamp + deltatime; messages.push_back(msg_info(message, tstamp)); if(callback) callback(userdata); } private: midi_device (const midi_device &d) {} midi_device & operator== (const midi_device &d) { return *this; } }; static void mycallback( double deltatime, std::vector< unsigned char > *message, void *userData ) { midi_device *mididev = (midi_device *)userData; if (mididev &&message) { mididev->push_message(*message, deltatime); } } int set_midi_callback(midi_device * dev, MidiCallback cb, void *userdata) { Locker lock(mutex); dev->callback = cb; dev->userdata = userdata; return 0; } void close_midi (midi_device * dev) { if (dev) { delete dev; } } midi_device_info get_midi_info (midi_device * dev, bool output) { midi_device_info m; if (dev) { if (output) { m = dev->out_info; } else { m = dev->in_info; } } return m; } midi_device * open_midi (const std::string &inname, const std::string &outname) { midi_device * dev = new midi_device (); try { midi_device_list devs; get_midi_devices(devs); dev->in_info = devs.get_name (inname, false); dev->out_info = devs.get_name (outname, true); if (dev->in_info.isvalid ()) { dev->in->openPort (dev->in_info.devid); dev->in->setCallback( mycallback, (void *)dev ); // Don't ignore sysex, timing, or active sensing messages. dev->in->ignoreTypes( false, false, false ); } if (dev->out_info.isvalid ()) dev->out->openPort (dev->out_info.devid); } catch (RtMidiError &err) { error ("Error opening midi: '%s'", err.getMessage ().c_str ()); delete dev; dev = 0; } return dev; } bool send_midi (midi_device *dev, const unsigned char *data, size_t sz) { if (dev && dev->out) { try { std::vector<unsigned char> message (data, data+sz); dev->out->sendMessage (&message); return true; } catch (const RtMidiError &err) { error ("Error getting midi info: '%s'", err.getMessage ().c_str ()); } } return false; } int recv_midi (midi_device *dev, double *ts, unsigned char *data, size_t sz) { Locker lock(mutex); if (dev && dev->in) { if (dev->messages.size() > 0) { msg_info msg = dev->messages.front(); dev->messages.pop_front(); std::vector<unsigned char> message = msg.data; if (message.size() > 0) { for (size_t i=0;i<message.size() && i<sz; i++) data[i] = message[i]; *ts = msg.timestamp; return (int)message.size(); } } } return 0; } int stat_midi (midi_device *dev) { Locker lock(mutex); return dev->messages.size(); } int flush_midi (midi_device *dev) { Locker lock(mutex); dev->messages.erase(dev->messages.begin(), dev->messages.end()); return 1; } bool get_midi_devices (midi_device_list &devs) { bool ok = false; devs = midi_device_list(); RtMidiOut * midiout = 0; RtMidiIn * midiin = 0; try { midiout = new RtMidiOut(); midiin = new RtMidiIn(); size_t numinput = midiin->getPortCount(); size_t numoutput = midiout->getPortCount(); for (size_t i=0; i<numoutput; i++) { midi_device_info inf; inf.name = midiout->getPortName(i).c_str(); inf.driver = api_name(midiout->getCurrentApi()); inf.id = i; inf.devid = i; inf.output = true; devs.push_back(inf); } for (size_t i=0; i<numinput; i++) { midi_device_info inf; inf.name = midiin->getPortName(i).c_str(); inf.driver = api_name(midiin->getCurrentApi()); inf.id = numoutput + i; inf.devid = i; inf.output = false; devs.push_back(inf); } ok = true; } catch (const RtMidiError &err) { error ("Error getting midi info: '%s'", err.getMessage ().c_str ()); } if(midiout) delete midiout; if(midiin) delete midiin; return ok; } ����������������������������������������������������������gnu-octave-octave-audio-125c0f5/src/midi.h����������������������������������������������������������0000664�0000000�0000000�00000004123�15135415131�0020350�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (C) 2019 John Donoghue <john.donoghue@ieee.org> // // This program is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free Software // Foundation; either version 3 of the License, or (at your option) any later // version. // // This program is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // this program; if not, see <http://www.gnu.org/licenses/>. #ifndef MIDI_H #define MIDI_H #include <vector> class midi_device; class midi_device_info { public: midi_device_info() { id=-1; devid=-1; }; virtual ~midi_device_info() {} bool isvalid() const { return id!= -1; } int id; std::string name; bool output; std::string driver; int devid; }; class midi_device_list : public std::vector <midi_device_info> { public: midi_device_info get_id(int id) const { for(size_t i=0; i<size(); i++) { midi_device_info v = (*this)[i]; if (v.id == id) return v; } return midi_device_info(); } midi_device_info get_name(const std::string &n, bool output) const { for(size_t i=0; i<size(); i++) { midi_device_info v = (*this)[i]; if (v.name == n && v.output == output) return v; } return midi_device_info (); } }; bool get_midi_devices(midi_device_list &devs); midi_device * open_midi(const std::string &inname, const std::string &outname); void close_midi(midi_device *); midi_device_info get_midi_info(midi_device * dev, bool output); bool send_midi(midi_device * dev, const unsigned char *data, size_t sz); int recv_midi(midi_device * dev, double *ts, unsigned char *data, size_t sz); int stat_midi(midi_device * dev); int flush_midi(midi_device * dev); typedef void(* MidiCallback )(void *userData); int set_midi_callback(midi_device * dev, MidiCallback cb, void *userdata); #endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/src/midi_object.cc��������������������������������������������������0000664�0000000�0000000�00000011463�15135415131�0022041�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (C) 2019-2020 John Donoghue <john.donoghue@ieee.org> // // This program is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free Software // Foundation; either version 3 of the License, or (at your option) any later // version. // // This program is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // this program; if not, see <http://www.gnu.org/licenses/>. // Octave Includes #include <octave/oct.h> #ifdef HAVE_CONFIG_H # include "config.h" #endif #include <octave/quit.h> #include "midi_object.h" DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_midi, "octave_midi", "octave_midi"); void octave_midi::octave_midi_callback (void *userData) { octave_midi * dev = (octave_midi *)userData; if(dev && dev->callback.length() >0) { try { octave_value_list ret = OCTAVE__FEVAL (dev->callback, ovl (dev->callbackdata), 0); } catch (const OCTAVE_EXECUTION_EXCEPTION &e) { #ifdef HAS_OCTAVE_EXCEPTION_MESSAGE warning("midicallback: %s", e.OCTAVE_EXCEPTION_MESSAGE().c_str()); #else warning("midicallback: execution exception occured"); #endif } } } octave_midi::octave_midi () : fieldnames(4) { fieldnames[0] = "Input"; fieldnames[1] = "Output"; fieldnames[2] = "InputID"; fieldnames[3] = "OutputID"; callback = ""; callbackdata = ""; dev = 0; } octave_midi::octave_midi (const octave_midi &m) { fieldnames = m.fieldnames; } octave_midi::~octave_midi (void) { close (); } bool octave_midi::create (const std::string &inname, const std::string &outname) { close (); dev = open_midi (inname, outname); return dev != 0; } bool octave_midi::send (const unsigned char * data, int sz) { return send_midi (dev, data, sz); } int octave_midi::recv (double *ts, unsigned char * data, int sz) { return recv_midi (dev, ts, data, sz); } int octave_midi::set_callback(const std::string &cb, octave_value cbdata) { callback = cb; callbackdata = cbdata; set_midi_callback(dev, octave_midi_callback, this); return 1; } int octave_midi::flush () { return flush_midi (dev); } int octave_midi::stat () { return stat_midi (dev); } void octave_midi::close () { if(dev) close_midi(dev); } octave_base_value * octave_midi::empty_clone (void) const { return new octave_midi(); } octave_base_value * octave_midi::clone (void) const { return new octave_midi (*this); } octave_base_value * octave_midi::unique_clone (void) { OV_COUNT++; return this; } void octave_midi::print (std::ostream& os, bool pr_as_read_syntax) const { print_raw (os, pr_as_read_syntax); newline (os); } void octave_midi::print (std::ostream& os, bool pr_as_read_syntax) { print_raw (os, pr_as_read_syntax); newline (os); } void octave_midi::print_raw (std::ostream& os, bool pr_as_read_syntax) const { os << " mididevice connected to"; newline (os); midi_device_info in = get_midi_info(dev, false); midi_device_info out = get_midi_info(dev, true); if (in.isvalid ()) { os << " input: '" << in.name << "' (" << in.id << ")"; newline(os); } if (out.isvalid ()) { os << " output: '" << out.name << "' (" << out.id << ")"; newline(os); } } octave_value_list octave_midi::subsref (const std::string& type, const std::list<octave_value_list>& idx, int nargout) { octave_value_list retval; int skip = 1; switch (type[0]) { default: error ("octave_midi object cannot be indexed with %c", type[0]); break; case '.': { std::string propname = (((idx.front()) (0)).string_value ()); if (propname == "Input") retval(0) = get_midi_info(dev, false).name; else if (propname == "Output") retval(0) = get_midi_info(dev, true).name; else if (propname == "InputID") retval(0) = get_midi_info(dev, false).id; else if (propname == "OutputID") retval(0) = get_midi_info(dev, true).id; else error ("octave_midi object unknown property '%s'", propname.c_str()); } break; } if (idx.size () > 1 && type.length () > 1) retval = retval (0).next_subsref (nargout, type, idx, skip); return retval; } octave_value octave_midi::subsasgn (const std::string& type, const std::list<octave_value_list>& idx, const octave_value& rhs) { octave_value retval; error ("octave_midi object cannot be indexed with %c", type[0]); return retval; } static bool type_loaded = false; void init_types(void) { if (!type_loaded) { octave_midi::register_type (); type_loaded = true; } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/src/midi_object.h���������������������������������������������������0000664�0000000�0000000�00000005626�15135415131�0021707�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (C) 2019 John Donoghue <john.donoghue@ieee.org> // // This program is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free Software // Foundation; either version 3 of the License, or (at your option) any later // version. // // This program is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // this program; if not, see <http://www.gnu.org/licenses/>. #ifndef MIDI_OBJECT_H #define MIDI_OBJECT_H // Octave Includes #include <octave/oct.h> #ifdef HAVE_CONFIG_H # include "config.h" #endif #include <string> #include <iostream> #include <errno.h> #include "midi.h" void init_types(void); class octave_midi : public OCTAVE_BASE_CLASS { public: octave_midi(); ~octave_midi(); bool create(const std::string &inname, const std::string &outname); bool send(const unsigned char *data, int sz); int recv(double *ts, unsigned char *data, int sz); int stat(); int flush(); std::string get_callback() const { return callback; }; int set_callback(const std::string &cb, octave_value cbdata); static void octave_midi_callback(void *d); void close(); /** * Various properties of the octave_base_value datatype. */ bool is_constant (void) const { return true;} bool is_defined (void) const { return true;} bool is_object (void) const { return true; } bool isobject (void) const { return true; } // required to use subsasn string_vector map_keys (void) const { return fieldnames; } dim_vector dims (void) const { static dim_vector dv(1, 1); return dv; } octave_base_value * clone (void) const; octave_base_value * empty_clone (void) const; octave_base_value * unique_clone (void); /** * Overloaded methods to print sock as the zeromq id */ void print (std::ostream& os, bool pr_as_read_syntax = false) const; void print (std::ostream& os, bool pr_as_read_syntax = false); void print_raw (std::ostream& os, bool pr_as_read_syntax) const; /** * overloaded methods to get properties */ octave_value_list subsref (const std::string& type, const std::list<octave_value_list>& idx, int nargout); octave_value subsref (const std::string& type, const std::list<octave_value_list>& idx) { octave_value_list retval = subsref (type, idx, 1); return (retval.length () > 0 ? retval(0) : octave_value ()); } octave_value subsasgn (const std::string& type, const std::list<octave_value_list>& idx, const octave_value& rhs); private: octave_midi(const octave_midi &); midi_device * dev; string_vector fieldnames; std::string callback; octave_value callbackdata; DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA }; #endif // MIDI_OBJECT_H ����������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/src/midicallback.cc�������������������������������������������������0000664�0000000�0000000�00000003676�15135415131�0022177�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (C) 2022 John Donoghue <john.donoghue@ieee.org> // // This program is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free Software // Foundation; either version 3 of the License, or (at your option) any later // version. // // This program is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // this program; if not, see <http://www.gnu.org/licenses/>. // Octave Includes #include <octave/oct.h> #include <octave/defun-dld.h> #include <octave/ov.h> #include <iostream> #include <iomanip> #if defined (HAVE_CONFIG_H) # include "config.h" #endif #include "midi_object.h" #include "midi.h" // PKG_ADD: autoload ("__midicallback__", "__midi__.oct"); DEFUN_DLD (__midicallback__, args, nargout, "-*- texinfo -*-\n\ @deftypefn {Package} {} __midicallback__ ()\n \ Internal function for midicallback\n \ \n \ @end deftypefn") { octave_value_list retval; if (1 > args.length ()) { error ("Expected at least a midi device"); return retval; } if (args (0).type_id () != octave_midi::static_type_id ()) { error ("Expected midi device"); return retval; } octave_midi * dev = dynamic_cast<octave_midi*>(args (0).internal_rep ()); std::string callback = dev->get_callback(); if (args.length () > 2) { if (!args(1).is_string()) { error ("Expected callback as string"); return retval; } // set dev->set_callback(args(1).string_value(), args(2)); } else if (args.length () != 1) { error ("Expected mididevice with optional (callback, data)"); return retval; } retval(0) = callback; return retval; } ������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/src/mididevice.cc���������������������������������������������������0000664�0000000�0000000�00000004015�15135415131�0021666�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (C) 2019 John Donoghue <john.donoghue@ieee.org> // // This program is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free Software // Foundation; either version 3 of the License, or (at your option) any later // version. // // This program is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // this program; if not, see <http://www.gnu.org/licenses/>. // Octave Includes #include <octave/oct.h> #include <octave/defun-dld.h> #include <octave/ov.h> #include <iostream> #include <iomanip> #if defined (HAVE_CONFIG_H) # include "config.h" #endif #include "midi_object.h" #include "midi.h" // PKG_ADD: autoload ("__midi__", "__midi__.oct"); DEFUN_DLD (__midi__, args, nargout, "-*- texinfo -*-\n\ @deftypefn {Package} {@var{dev} = } __midi__()\n \ private stub for octave midi\n \ \n \ @seealso{audio}\n \ @end deftypefn") { return octave_value (); } // PKG_ADD: autoload ("__mididevice__", "__midi__.oct"); DEFUN_DLD (__mididevice__, args, nargout, "-*- texinfo -*-\n\ @deftypefn {Package} {@var{dev} = } __mididevice__(inputdev, outputdev)\n \ private function to create a midi device\n \ \n \ @seealso{mididevice}\n \ @end deftypefn") { if ( 2 != args.length ()) { print_usage(); return octave_value (); } octave_value in_dev = args (0); octave_value out_dev = args (1); std::string in_dev_name = in_dev.is_string () ? in_dev.string_value () : ""; std::string out_dev_name = out_dev.is_string () ? out_dev.string_value () : ""; init_types (); octave_midi * retvalue = new octave_midi (); if ( retvalue->create (in_dev_name, out_dev_name) == false ) { delete retvalue; return octave_value (); } return octave_value (retvalue); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/src/mididevinfo.cc��������������������������������������������������0000664�0000000�0000000�00000003677�15135415131�0022076�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (C) 2019 John Donoghue <john.donoghue@ieee.org> // // This program is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free Software // Foundation; either version 3 of the License, or (at your option) any later // version. // // This program is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // this program; if not, see <http://www.gnu.org/licenses/>. // Octave Includes #include <octave/oct.h> #include <octave/defun-dld.h> #include <octave/ov.h> #include <octave/oct-map.h> #include <iostream> #include <iomanip> #if defined (HAVE_CONFIG_H) # include "config.h" #endif #include "midi.h" // PKG_ADD: autoload ("__mididevinfo__", "__midi__.oct"); DEFUN_DLD (__mididevinfo__, args, nargout, "-*- texinfo -*-\n\ @deftypefn {Package} {} __mididevinfo__ ()\n \ Internal function to retieve midi devices\n \ @end deftypefn") { octave_value retval; midi_device_list devs; if (get_midi_devices(devs)) { Cell name (dim_vector (1, devs.size())); Cell driver (dim_vector (1, devs.size())); Cell id (dim_vector (1, devs.size())); Cell dir (dim_vector (1, devs.size())); for(size_t i=0; i<devs.size(); i++) { midi_device_info dev = devs[i]; name(i) = dev.name; driver(i) = dev.driver; id(i) = dev.id; if(dev.output) { dir(i) = "output"; } else { dir(i) = "input"; } } octave_map devinfo; devinfo.setfield("ID", id); devinfo.setfield("Direction", dir); devinfo.setfield("Interface", driver); devinfo.setfield("Name", name); retval = devinfo; } return retval; } �����������������������������������������������������������������gnu-octave-octave-audio-125c0f5/src/midiflush.cc����������������������������������������������������0000664�0000000�0000000�00000002756�15135415131�0021562�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (C) 2022 John Donoghue <john.donoghue@ieee.org> // // This program is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free Software // Foundation; either version 3 of the License, or (at your option) any later // version. // // This program is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // this program; if not, see <http://www.gnu.org/licenses/>. // Octave Includes #include <octave/oct.h> #include <octave/defun-dld.h> #include <octave/ov.h> #include <iostream> #include <iomanip> #if defined (HAVE_CONFIG_H) # include "config.h" #endif #include "midi_object.h" #include "midi.h" // PKG_ADD: autoload ("__midiflush__", "__midi__.oct"); DEFUN_DLD (__midiflush__, args, nargout, "-*- texinfo -*-\n\ @deftypefn {Package} {} midiflush ()\n \ Internal function for midiflush\n \ \n \ @end deftypefn") { octave_value retval; if (0 == args.length()) { print_usage(); return retval; } if (args (0).type_id () != octave_midi::static_type_id ()) { error ("Expected midi device"); return retval; } octave_midi * dev = dynamic_cast<octave_midi*>(args (0).internal_rep ()); dev->flush(); return retval; } ������������������gnu-octave-octave-audio-125c0f5/src/midirecv.cc�����������������������������������������������������0000664�0000000�0000000�00000003623�15135415131�0021372�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (C) 2019 John Donoghue <john.donoghue@ieee.org> // // This program is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free Software // Foundation; either version 3 of the License, or (at your option) any later // version. // // This program is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // this program; if not, see <http://www.gnu.org/licenses/>. // Octave Includes #include <octave/oct.h> #include <octave/defun-dld.h> #include <octave/ov.h> #include <iostream> #include <iomanip> #if defined (HAVE_CONFIG_H) # include "config.h" #endif #include "midi_object.h" #include "midi.h" // PKG_ADD: autoload ("__midirecv__", "__midi__.oct"); DEFUN_DLD (__midirecv__, args, nargout, "-*- texinfo -*-\n\ @deftypefn {Package} {} midirecv ()\n \ iNternal function for midirecv\n \ \n \ @end deftypefn") { octave_value_list retval; if (0 == args.length()) { print_usage(); return retval; } if (1 < args.length ()) { error ("Expected midi device "); return retval; } if (args (0).type_id () != octave_midi::static_type_id ()) { error ("Expected midi device"); return retval; } octave_midi * dev = dynamic_cast<octave_midi*>(args (0).internal_rep ()); unsigned char buf[1024]; double ts; int ret = dev->recv (&ts, buf, 1024); if(ret > 0) { uint8NDArray data ( dim_vector (1,ret) ); for (int i=0; i<ret; i++) data (i) = buf[i]; retval(0) = ts; retval(1) = data; } else { retval(0) = 0; retval(1) = uint8NDArray (dim_vector (1,0)); } return retval; } �������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/src/midisend.cc�����������������������������������������������������0000664�0000000�0000000�00000003704�15135415131�0021364�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (C) 2019 John Donoghue <john.donoghue@ieee.org> // // This program is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free Software // Foundation; either version 3 of the License, or (at your option) any later // version. // // This program is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // this program; if not, see <http://www.gnu.org/licenses/>. // Octave Includes #include <octave/oct.h> #include <octave/defun-dld.h> #include <octave/ov.h> #include <iostream> #include <iomanip> #if defined (HAVE_CONFIG_H) # include "config.h" #endif #include "midi_object.h" #include "midi.h" // PKG_ADD: autoload ("__midisend__", "__midi__.oct"); DEFUN_DLD (__midisend__, args, nargout, "-*- texinfo -*-\n\ @deftypefn {Package} {} midisend ()\n \ Internal function for midisend\n \ \n \ @end deftypefn") { octave_value retval; if (0 == args.length()) { print_usage(); return retval; } if (3 < args.length ()) { error ("Expected midi device and timestamp and data"); return retval; } if (args (0).type_id () != octave_midi::static_type_id ()) { error ("Expected midi device"); return retval; } octave_midi * dev = dynamic_cast<octave_midi*>(args (0).internal_rep ()); octave_value ts = args(1); octave_value data = args(2); uint8NDArray v = data.uint8_array_value(); OCTAVE_LOCAL_BUFFER (uint8_t, buf, v.numel ()); if (!buf) error ("zeromq: could allocate memory for send message.\n"); else { for(int i=0; i<v.numel (); i++) buf[i] = v(i); retval = dev->send (buf, data.numel ()); } return retval; } ������������������������������������������������������������gnu-octave-octave-audio-125c0f5/src/midistat.cc�����������������������������������������������������0000664�0000000�0000000�00000003055�15135415131�0021405�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (C) 2022 John Donoghue <john.donoghue@ieee.org> // // This program is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free Software // Foundation; either version 3 of the License, or (at your option) any later // version. // // This program is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // this program; if not, see <http://www.gnu.org/licenses/>. // Octave Includes #include <octave/oct.h> #include <octave/defun-dld.h> #include <octave/ov.h> #include <iostream> #include <iomanip> #if defined (HAVE_CONFIG_H) # include "config.h" #endif #include "midi_object.h" #include "midi.h" // PKG_ADD: autoload ("__midistat__", "__midi__.oct"); DEFUN_DLD (__midistat__, args, nargout, "-*- texinfo -*-\n\ @deftypefn {Package} {} __midistat__ ()\n \ Internal function for midi hasdata\n \ \n \ @end deftypefn") { octave_value_list retval; if (1 < args.length ()) { error ("Expected midi device "); return retval; } if (args (0).type_id () != octave_midi::static_type_id ()) { error ("Expected midi device"); return retval; } octave_midi * dev = dynamic_cast<octave_midi*>(args (0).internal_rep ()); int ret = dev->stat(); retval(0) = ret ? true : false; return retval; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/src/pkglock.cc������������������������������������������������������0000664�0000000�0000000�00000002656�15135415131�0021227�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (C) 2020 John Donoghue <john.donoghue@ieee.org> // // This program is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free Software // Foundation; either version 3 of the License, or (at your option) any later // version. // // This program is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // this program; if not, see <http://www.gnu.org/licenses/>. #include <octave/oct.h> #include <octave/ov.h> #include <octave/defun-dld.h> #ifdef HAVE_CONFIG_H # include "config.h" #endif // PKG_ADD: autoload ("__audio_pkg_lock__", "__midi__.oct"); // PKG_ADD: __audio_pkg_lock__(1); // PKG_DEL: __audio_pkg_lock__(0); #ifdef DEFMETHOD_DLD DEFMETHOD_DLD (__audio_pkg_lock__, interp, args, , "internal function") { octave_value retval; if (args.length () >= 1) { if (args(0).int_value () == 1) interp.mlock(); else if (args(0).int_value () == 0 && interp.mislocked("__audio_pkg_lock__")) interp.munlock("__audio_pkg_lock__"); } return retval; } #else DEFUN_DLD(__audio_pkg_lock__, args, , "internal function") { octave_value retval; return retval; } #endif ����������������������������������������������������������������������������������gnu-octave-octave-audio-125c0f5/src/undef-ah-octave.h�����������������������������������������������0000664�0000000�0000000�00000000706�15135415131�0022377�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* To be included at the top of config.h (by autoheader). Avoid warnings for redefining AH-generated preprocessor symbols of Octave. */ #ifdef PACKAGE_BUGREPORT #undef PACKAGE_BUGREPORT #endif #ifdef PACKAGE_NAME #undef PACKAGE_NAME #endif #ifdef PACKAGE_STRING #undef PACKAGE_STRING #endif #ifdef PACKAGE_TARNAME #undef PACKAGE_TARNAME #endif #ifdef PACKAGE_URL #undef PACKAGE_URL #endif #ifdef PACKAGE_VERSION #undef PACKAGE_VERSION #endif ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������