You can subscribe to this list here.
| 2005 |
Jan
|
Feb
(66) |
Mar
(37) |
Apr
(1) |
May
|
Jun
|
Jul
(11) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
|
Feb
(10) |
Mar
(127) |
Apr
(11) |
May
(14) |
Jun
(11) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Jerome F. <kin...@us...> - 2011-03-11 16:29:58
|
Update of /cvsroot/munt/mt32emu/src
In directory vz-cvs-4.sog:/tmp/cvs-serv21573
Modified Files:
part.cpp
Log Message:
- Fixed the bender range not being properly updated when modifying the patch temp area via sysex.
- As a side-effect, fixed a Valgrind warning due to the bender range not being initialised on the rhythm part.
Index: part.cpp
===================================================================
RCS file: /cvsroot/munt/mt32emu/src/part.cpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** part.cpp 11 Mar 2011 01:45:09 -0000 1.45
--- part.cpp 11 Mar 2011 16:29:56 -0000 1.46
***************
*** 161,164 ****
--- 161,165 ----
}
}
+ updatePitchBenderRange();
}
***************
*** 171,174 ****
--- 172,176 ----
}
memcpy(currentInstr, timbreTemp->common.name, 10);
+ updatePitchBenderRange();
}
***************
*** 241,245 ****
void Part::setProgram(unsigned int patchNum) {
setPatch(&synth->mt32ram.patches[patchNum]);
- updatePitchBenderRange();
allSoundOff();
setTimbre(&synth->mt32ram.timbres[getAbsTimbreNum()].timbre);
--- 243,246 ----
|
|
From: Jerome F. <kin...@us...> - 2011-03-11 14:29:17
|
Update of /cvsroot/munt/mt32emu/src In directory vz-cvs-4.sog:/tmp/cvs-serv30318 Modified Files: synth.cpp Log Message: - Fixed paddedTimbreMaxTable being deleted instead of delete[]d (thanks, Valgrind). Index: synth.cpp =================================================================== RCS file: /cvsroot/munt/mt32emu/src/synth.cpp,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** synth.cpp 5 Jul 2009 17:39:30 -0000 1.67 --- synth.cpp 11 Mar 2011 14:29:15 -0000 1.68 *************** *** 891,895 **** resetMemoryRegion = NULL; ! delete paddedTimbreMaxTable; paddedTimbreMaxTable = NULL; } --- 891,895 ---- resetMemoryRegion = NULL; ! delete[] paddedTimbreMaxTable; paddedTimbreMaxTable = NULL; } |
|
From: Jerome F. <kin...@us...> - 2011-03-11 11:28:44
|
Update of /cvsroot/munt/mt32emu_alsadrv/src
In directory vz-cvs-4.sog:/tmp/cvs-serv15845
Modified Files:
lcd.cpp pixmaps.cpp
Log Message:
Applied patch from Munt bug #2921570:
xmt32 causes a segmentation fault (null pointer dereference) when using an xfont for which the per_char pointer is NULL. The attached patch fixes this problem,
Index: lcd.cpp
===================================================================
RCS file: /cvsroot/munt/mt32emu_alsadrv/src/lcd.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** lcd.cpp 19 Dec 2004 23:30:51 -0000 1.1
--- lcd.cpp 11 Mar 2011 11:28:42 -0000 1.2
***************
*** 86,91 ****
if (!c)
break;
! nw = lcd_flagfont->per_char[c].width;
! nh = lcd_flagfont->per_char[c].ascent + lcd_flagfont->per_char[c].descent;
if (nw > w) w = nw;
--- 86,100 ----
if (!c)
break;
! /* From xfontstruct man page: "If the per_char pointer is NULL, all glyphs between the
! first and last character indexes inclusive have the same information, as given by both
! min_bounds and max_bounds." */
! if (lcd_flagfont->per_char == NULL)
! {
! nw = lcd_flagfont->max_bounds.width;
! nh = lcd_flagfont->max_bounds.ascent + lcd_flagfont->max_bounds.descent;
! } else {
! nw = lcd_flagfont->per_char[c].width;
! nh = lcd_flagfont->per_char[c].ascent + lcd_flagfont->per_char[c].descent;
! }
if (nw > w) w = nw;
Index: pixmaps.cpp
===================================================================
RCS file: /cvsroot/munt/mt32emu_alsadrv/src/pixmaps.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** pixmaps.cpp 19 Dec 2004 23:30:51 -0000 1.1
--- pixmaps.cpp 11 Mar 2011 11:28:42 -0000 1.2
***************
*** 72,77 ****
c = txt[i];
! w += fs->per_char[c].width;
! nh = fs->per_char[c].ascent; // + fs->per_char[c].descent;
if (nh > h)
--- 72,87 ----
c = txt[i];
!
! /* From xfontstruct man page: "If the per_char pointer is NULL, all glyphs between the
! first and last character indexes inclusive have the same information, as given by both
! min_bounds and max_bounds." */
! if (fs->per_char == NULL)
! {
! w += fs->max_bounds.width;
! nh = fs->max_bounds.ascent; // + fs->max_bounds.descent;
! } else {
! w += fs->per_char[c].width;
! nh = fs->per_char[c].ascent; // + fs->per_char[c].descent;
! }
if (nh > h)
|
|
From: Jerome F. <kin...@us...> - 2011-03-11 01:45:11
|
Update of /cvsroot/munt/mt32emu/src In directory vz-cvs-4.sog:/tmp/cvs-serv26517 Modified Files: part.cpp Log Message: - Fixed Valgrind warnings due to uninitialised modulation and pitchBend (inspired by the fork guys). Index: part.cpp =================================================================== RCS file: /cvsroot/munt/mt32emu/src/part.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** part.cpp 10 Mar 2011 22:21:46 -0000 1.44 --- part.cpp 11 Mar 2011 01:45:09 -0000 1.45 *************** *** 58,62 **** --- 58,64 ---- currentInstr[0] = 0; currentInstr[10] = 0; + modulation = 0; expression = 100; + pitchBend = 0; activePartialCount = 0; memset(patchCache, 0, sizeof(patchCache)); |
|
From: Jerome F. <kin...@us...> - 2011-03-11 01:39:34
|
Update of /cvsroot/munt/mt32emu/src/freeverb In directory vz-cvs-4.sog:/tmp/cvs-serv23596 Modified Files: revmodel.cpp Log Message: - Fixed Valgrind warnings during construction, and made slightly more efficient in the process. Index: revmodel.cpp =================================================================== RCS file: /cvsroot/munt/mt32emu/src/freeverb/revmodel.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** revmodel.cpp 5 Jun 2009 22:55:40 -0000 1.2 --- revmodel.cpp 11 Mar 2011 01:39:32 -0000 1.3 *************** *** 44,53 **** allpassL[3].setfeedback(0.5f); allpassR[3].setfeedback(0.5f); ! setwet(initialwet); ! setroomsize(initialroom); ! setdry(initialdry); ! setdamp(initialdamp); ! setwidth(initialwidth); ! setmode(initialmode); // Buffer will be full of rubbish - so we MUST mute them --- 44,54 ---- allpassL[3].setfeedback(0.5f); allpassR[3].setfeedback(0.5f); ! dry = initialdry; ! wet = initialwet*scalewet; ! damp = initialdamp*scaledamp; ! roomsize = (initialroom*scaleroom) + offsetroom; ! width = initialwidth; ! mode = initialmode; ! update(); // Buffer will be full of rubbish - so we MUST mute them |
|
From: Jerome F. <kin...@us...> - 2011-03-10 22:21:48
|
Update of /cvsroot/munt/mt32emu/src In directory vz-cvs-4.sog:/tmp/cvs-serv26030 Modified Files: part.cpp Log Message: - Removed unnecessary include of <math.h> Index: part.cpp =================================================================== RCS file: /cvsroot/munt/mt32emu/src/part.cpp,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** part.cpp 11 Jun 2009 13:03:39 -0000 1.43 --- part.cpp 10 Mar 2011 22:21:46 -0000 1.44 *************** *** 16,20 **** #include <string.h> - #include <math.h> #include "mt32emu.h" --- 16,19 ---- |
|
From: Jerome F. <kin...@us...> - 2009-07-31 18:14:44
|
Update of /cvsroot/munt/mt32emu In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv8120 Modified Files: README COPYING Added Files: COPYING.LESSER Log Message: - COPYING is now the GPL (v2), COPYING.LESSER the LGPL (v2.1). This matches FSF recommendations. Index: README =================================================================== RCS file: /cvsroot/munt/mt32emu/README,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** README 26 Feb 2005 16:15:20 -0000 1.1 --- README 31 Jul 2009 18:14:32 -0000 1.2 *************** *** 20,24 **** sh autogen.sh ! For license information, including a warranty disclaimer, see the COPYING file. --- 20,42 ---- sh autogen.sh ! ! License ! ------- ! ! Copyright (C) 2003-2009 Dean Beeler, Jerome Fisher ! ! This library is free software; you can redistribute it and/or ! modify it under the terms of the GNU Lesser General Public ! License as published by the Free Software Foundation; either ! version 2.1 of the License, or (at your option) any later version. ! ! This library 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 ! Lesser General Public License for more details. ! ! You should have received a copy of the GNU Lesser General Public ! License along with this library; if not, write to the Free Software ! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA --- NEW FILE: COPYING.LESSER --- GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, 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 this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), 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 distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser 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 Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! Index: COPYING =================================================================== RCS file: /cvsroot/munt/mt32emu/COPYING,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** COPYING 3 Mar 2009 15:22:22 -0000 1.4 --- COPYING 31 Jul 2009 18:14:33 -0000 1.5 *************** *** 1,376 **** ! GNU LESSER GENERAL PUBLIC LICENSE ! Version 2.1, February 1999 ! Copyright (C) 1991, 1999 Free Software Foundation, Inc. ! 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - [This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public ! Licenses are intended to guarantee your freedom to share and change ! free software--to make sure the software is free for all its users. ! ! This license, the Lesser General Public License, applies to some ! specially designated software packages--typically libraries--of the ! Free Software Foundation and other authors who decide to use it. You ! can use it too, but we suggest you first think carefully about whether ! this license or the ordinary General Public License is the better ! strategy to use in any particular case, based on the explanations below. ! When we speak of free software, we are referring to freedom of use, ! 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 this service if you wish); that you receive source code or can get ! it if you want it; that you can change the software and use pieces of ! it in new free programs; and that you are informed that you can do ! these things. To protect your rights, we need to make restrictions that forbid ! distributors to deny you these rights or to ask you to surrender these ! rights. These restrictions translate to certain responsibilities for ! you if you distribute copies of the library or if you modify it. ! ! For example, if you distribute copies of the library, whether gratis ! or for a fee, you must give the recipients all the rights that we gave ! you. You must make sure that they, too, receive or can get the source ! code. If you link other code with the library, you must provide ! complete object files to the recipients, so that they can relink them ! with the library after making changes to the library and recompiling ! it. And you must show them these terms so they know their rights. ! ! We protect your rights with a two-step method: (1) we copyright the ! library, and (2) we offer you this license, which gives you legal ! permission to copy, distribute and/or modify the library. ! ! To protect each distributor, we want to make it very clear that ! there is no warranty for the free library. Also, if the library is ! modified by someone else and passed on, the recipients should know ! that what they have is not the original version, so that the original ! author's reputation will not be affected by problems that might be ! introduced by others. ! ! Finally, software patents pose a constant threat to the existence of ! any free program. We wish to make sure that a company cannot ! effectively restrict the users of a free program by obtaining a ! restrictive license from a patent holder. Therefore, we insist that ! any patent license obtained for a version of the library must be ! consistent with the full freedom of use specified in this license. ! ! Most GNU software, including some libraries, is covered by the ! ordinary GNU General Public License. This license, the GNU Lesser ! General Public License, applies to certain designated libraries, and ! is quite different from the ordinary General Public License. We use ! this license for certain libraries in order to permit linking those ! libraries into non-free programs. ! ! When a program is linked with a library, whether statically or using ! a shared library, the combination of the two is legally speaking a ! combined work, a derivative of the original library. The ordinary ! General Public License therefore permits such linking only if the ! entire combination fits its criteria of freedom. The Lesser General ! Public License permits more lax criteria for linking other code with ! the library. ! We call this license the "Lesser" General Public License because it ! does Less to protect the user's freedom than the ordinary General ! Public License. It also provides other free software developers Less ! of an advantage over competing non-free programs. These disadvantages ! are the reason we use the ordinary General Public License for many ! libraries. However, the Lesser license provides advantages in certain ! special circumstances. ! For example, on rare occasions, there may be a special need to ! encourage the widest possible use of a certain library, so that it becomes ! a de-facto standard. To achieve this, non-free programs must be ! allowed to use the library. A more frequent case is that a free ! library does the same job as widely used non-free libraries. In this ! case, there is little to gain by limiting the free library to free ! software only, so we use the Lesser General Public License. ! In other cases, permission to use a particular library in non-free ! programs enables a greater number of people to use a large body of ! free software. For example, permission to use the GNU C Library in ! non-free programs enables many more people to use the whole GNU ! operating system, as well as its variant, the GNU/Linux operating ! system. ! Although the Lesser General Public License is Less protective of the ! users' freedom, it does ensure that the user of a program that is ! linked with the Library has the freedom and the wherewithal to run ! that program using a modified version of the Library. The precise terms and conditions for copying, distribution and ! modification follow. Pay close attention to the difference between a ! "work based on the library" and a "work that uses the library". The ! former contains code derived from the library, whereas the latter must ! be combined with the library in order to run. ! ! GNU LESSER GENERAL PUBLIC LICENSE ! TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION ! 0. This License Agreement applies to any software library or other ! program which contains a notice placed by the copyright holder or ! other authorized party saying it may be distributed under the terms of ! this Lesser General Public License (also called "this License"). ! Each licensee is addressed as "you". ! A "library" means a collection of software functions and/or data ! prepared so as to be conveniently linked with application programs ! (which use some of those functions and data) to form executables. ! The "Library", below, refers to any such software library or work ! which has been distributed under these terms. A "work based on the ! Library" means either the Library or any derivative work under ! copyright law: that is to say, a work containing the Library or a ! portion of it, either verbatim or with modifications and/or translated ! straightforwardly into another language. (Hereinafter, translation is ! included without limitation in the term "modification".) ! "Source code" for a work means the preferred form of the work for ! making modifications to it. For a library, complete source code means ! all the source code for all modules it contains, plus any associated ! interface definition files, plus the scripts used to control compilation ! and installation of the library. ! Activities other than copying, distribution and modification are not ! covered by this License; they are outside its scope. The act of ! running a program using the Library is not restricted, and output from ! such a program is covered only if its contents constitute a work based ! on the Library (independent of the use of the Library in a tool for ! writing it). Whether that is true depends on what the Library does ! and what the program that uses the Library does. ! ! 1. You may copy and distribute verbatim copies of the Library's ! complete source code as you receive it, in any medium, provided that ! you conspicuously and appropriately publish on each copy an ! appropriate copyright notice and disclaimer of warranty; keep intact ! all the notices that refer to this License and to the absence of any ! warranty; and distribute a copy of this License along with the ! Library. ! You may charge a fee for the physical act of transferring a copy, ! and you may at your option offer warranty protection in exchange for a ! fee. ! ! 2. You may modify your copy or copies of the Library or any portion ! of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: ! a) The modified work must itself be a software library. ! ! b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. ! c) You must cause the whole of the work to be licensed at no ! charge to all third parties under the terms of this License. ! ! d) If a facility in the modified Library refers to a function or a ! table of data to be supplied by an application program that uses ! the facility, other than as an argument passed when the facility ! is invoked, then you must make a good faith effort to ensure that, ! in the event an application does not supply such function or ! table, the facility still operates, and performs whatever part of ! its purpose remains meaningful. ! (For example, a function in a library to compute square roots has ! a purpose that is entirely well-defined independent of the ! application. Therefore, Subsection 2d requires that any ! application-supplied function or table used by this function must ! be optional: if the application does not supply it, the square ! root function must still compute square roots.) These requirements apply to the modified work as a whole. If ! identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based ! on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the ! entire whole, and thus to each and every part regardless of who wrote ! it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or ! collective works based on the Library. ! In addition, mere aggregation of another work not based on the Library ! with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. ! 3. You may opt to apply the terms of the ordinary GNU General Public ! License instead of this License to a given copy of the Library. To do ! this, you must alter all the notices that refer to this License, so ! that they refer to the ordinary GNU General Public License, version 2, ! instead of to this License. (If a newer version than version 2 of the ! ordinary GNU General Public License has appeared, then you can specify ! that version instead if you wish.) Do not make any other change in ! these notices. ! ! Once this change is made in a given copy, it is irreversible for ! that copy, so the ordinary GNU General Public License applies to all ! subsequent copies and derivative works made from that copy. ! ! This option is useful when you wish to copy part of the code of ! the Library into a program that is not a library. ! ! 4. You may copy and distribute the Library (or a portion or ! derivative of it, under Section 2) in object code or executable form ! under the terms of Sections 1 and 2 above provided that you accompany ! it with the complete corresponding machine-readable source code, which ! must be distributed under the terms of Sections 1 and 2 above on a ! medium customarily used for software interchange. ! ! If distribution of object code is made by offering access to copy ! from a designated place, then offering equivalent access to copy the ! source code from the same place satisfies the requirement to ! distribute the source code, even though third parties are not ! compelled to copy the source along with the object code. ! ! 5. A program that contains no derivative of any portion of the ! Library, but is designed to work with the Library by being compiled or ! linked with it, is called a "work that uses the Library". Such a ! work, in isolation, is not a derivative work of the Library, and ! therefore falls outside the scope of this License. ! ! However, linking a "work that uses the Library" with the Library ! creates an executable that is a derivative of the Library (because it ! contains portions of the Library), rather than a "work that uses the ! library". The executable is therefore covered by this License. ! Section 6 states terms for distribution of such executables. ! ! When a "work that uses the Library" uses material from a header file ! that is part of the Library, the object code for the work may be a ! derivative work of the Library even though the source code is not. ! Whether this is true is especially significant if the work can be ! linked without the Library, or if the work is itself a library. The ! threshold for this to be true is not precisely defined by law. ! ! If such an object file uses only numerical parameters, data ! structure layouts and accessors, and small macros and small inline ! functions (ten lines or less in length), then the use of the object ! file is unrestricted, regardless of whether it is legally a derivative ! work. (Executables containing this object code plus portions of the ! Library will still fall under Section 6.) ! ! Otherwise, if the work is a derivative of the Library, you may ! distribute the object code for the work under the terms of Section 6. ! Any executables containing that work also fall under Section 6, ! whether or not they are linked directly with the Library itself. ! ! 6. As an exception to the Sections above, you may also combine or ! link a "work that uses the Library" with the Library to produce a ! work containing portions of the Library, and distribute that work ! under terms of your choice, provided that the terms permit ! modification of the work for the customer's own use and reverse ! engineering for debugging such modifications. ! ! You must give prominent notice with each copy of the work that the ! Library is used in it and that the Library and its use are covered by ! this License. You must supply a copy of this License. If the work ! during execution displays copyright notices, you must include the ! copyright notice for the Library among them, as well as a reference ! directing the user to the copy of this License. Also, you must do one ! of these things: ! ! a) Accompany the work with the complete corresponding ! machine-readable source code for the Library including whatever ! changes were used in the work (which must be distributed under ! Sections 1 and 2 above); and, if the work is an executable linked ! with the Library, with the complete machine-readable "work that ! uses the Library", as object code and/or source code, so that the ! user can modify the Library and then relink to produce a modified ! executable containing the modified Library. (It is understood ! that the user who changes the contents of definitions files in the ! Library will not necessarily be able to recompile the application ! to use the modified definitions.) ! ! b) Use a suitable shared library mechanism for linking with the ! Library. A suitable mechanism is one that (1) uses at run time a ! copy of the library already present on the user's computer system, ! rather than copying library functions into the executable, and (2) ! will operate properly with a modified version of the library, if ! the user installs one, as long as the modified version is ! interface-compatible with the version that the work was made with. ! ! c) Accompany the work with a written offer, valid for at ! least three years, to give the same user the materials ! specified in Subsection 6a, above, for a charge no more ! than the cost of performing this distribution. ! ! d) If distribution of the work is made by offering access to copy ! from a designated place, offer equivalent access to copy the above ! specified materials from the same place. ! e) Verify that the user has already received a copy of these ! materials or that you have already sent this user a copy. ! For an executable, the required form of the "work that uses the ! Library" must include any data and utility programs needed for ! reproducing the executable from it. However, as a special exception, ! the materials to be distributed need not include anything that is ! normally distributed (in either source or binary form) with the major ! components (compiler, kernel, and so on) of the operating system on ! which the executable runs, unless that component itself accompanies ! the executable. ! It may happen that this requirement contradicts the license ! restrictions of other proprietary libraries that do not normally ! accompany the operating system. Such a contradiction means you cannot ! use both them and the Library together in an executable that you ! distribute. ! ! 7. You may place library facilities that are a work based on the ! Library side-by-side in a single library together with other library ! facilities not covered by this License, and distribute such a combined ! library, provided that the separate distribution of the work based on ! the Library and of the other library facilities is otherwise ! permitted, and provided that you do these two things: ! a) Accompany the combined library with a copy of the same work ! based on the Library, uncombined with any other library ! facilities. This must be distributed under the terms of the ! Sections above. ! b) Give prominent notice with the combined library of the fact ! that part of it is a work based on the Library, and explaining ! where to find the accompanying uncombined form of the same work. ! 8. You may not copy, modify, sublicense, link with, or distribute ! the Library except as expressly provided under this License. Any ! attempt otherwise to copy, modify, sublicense, link with, or ! distribute the Library is void, and will automatically terminate your ! rights under this License. However, parties who have received copies, ! or rights, from you under this License will not have their licenses ! terminated so long as such parties remain in full compliance. ! 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or ! distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by ! modifying or distributing the Library (or any work based on the ! Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying ! the Library or works based on it. ! 10. Each time you redistribute the Library (or any work based on the ! Library), the recipient automatically receives a license from the ! original licensor to copy, distribute, link with or modify the Library ! subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. ! You are not responsible for enforcing compliance by third parties with this License. ! ! 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or --- 1,199 ---- ! GNU GENERAL PUBLIC LICENSE ! Version 2, June 1991 ! Copyright (C) 1989, 1991 Free Software Foundation, Inc., ! 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public ! License is intended to guarantee your freedom to share and change free ! software--to make sure the software is free for all its users. This ! General Public License applies to most of the Free Software ! Foundation's software and to any other program whose authors commit to ! using it. (Some other Free Software Foundation software is covered by ! the GNU Lesser General Public License instead.) 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 ! this service 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 make restrictions that forbid ! anyone to deny you these rights or to ask you to surrender the rights. ! These restrictions translate to certain responsibilities for you if you ! distribute copies of the software, or if you modify it. ! For example, if you distribute copies of such a program, whether ! gratis or for a fee, you must give the recipients all the rights that ! you have. 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. ! We protect your rights with two steps: (1) copyright the software, and ! (2) offer you this license which gives you legal permission to copy, ! distribute and/or modify the software. ! Also, for each author's protection and ours, we want to make certain ! that everyone understands that there is no warranty for this free ! software. If the software is modified by someone else and passed on, we ! want its recipients to know that what they have is not the original, so ! that any problems introduced by others will not reflect on the original ! authors' reputations. ! Finally, any free program is threatened constantly by software ! patents. We wish to avoid the danger that redistributors of a free ! program will individually obtain patent licenses, in effect making the ! program proprietary. To prevent this, we have made it clear that any ! patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and ! modification follow. ! GNU GENERAL PUBLIC LICENSE ! TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION ! 0. This License applies to any program or other work which contains ! a notice placed by the copyright holder saying it may be distributed ! under the terms of this General Public License. The "Program", below, ! refers to any such program or work, and a "work based on the Program" ! means either the Program or any derivative work under copyright law: ! that is to say, a work containing the Program or a portion of it, ! either verbatim or with modifications and/or translated into another ! language. (Hereinafter, translation is included without limitation in ! the term "modification".) Each licensee is addressed as "you". ! Activities other than copying, distribution and modification are not ! covered by this License; they are outside its scope. The act of ! running the Program is not restricted, and the output from the Program ! is covered only if its contents constitute a work based on the ! Program (independent of having been made by running the Program). ! Whether that is true depends on what the Program does. ! 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the ! notices that refer to this License and to the absence of any warranty; ! and give any other recipients of the Program a copy of this License ! along with the Program. ! You may charge a fee for the physical act of transferring a copy, and ! you may at your option offer warranty protection in exchange for a fee. ! 2. You may modify your copy or copies of the Program or any portion ! of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: ! a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. ! b) You must cause any work that you distribute or publish, that in ! whole or in part contains or is derived from the Program or any ! part thereof, to be licensed as a whole at no charge to all third ! parties under the terms of this License. ! c) If the modified program normally reads commands interactively ! when run, you must cause it, when started running for such ! interactive use in the most ordinary way, to print or display an ! announcement including an appropriate copyright notice and a ! notice that there is no warranty (or else, saying that you provide ! a warranty) and that users may redistribute the program under ! these conditions, and telling the user how to view a copy of this ! License. (Exception: if the Program itself is interactive but ! does not normally print such an announcement, your work based on ! the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If ! identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based ! on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the ! entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or ! collective works based on the Program. ! In addition, mere aggregation of another work not based on the Program ! with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. ! 3. You may copy and distribute the Program (or a work based on it, ! under Section 2) in object code or executable form under the terms of ! Sections 1 and 2 above provided that you also do one of the following: ! a) Accompany it with the complete corresponding machine-readable ! source code, which must be distributed under the terms of Sections ! 1 and 2 above on a medium customarily used for software interchange; or, ! b) Accompany it with a written offer, valid for at least three ! years, to give any third party, for a charge no more than your ! cost of physically performing source distribution, a complete ! machine-readable copy of the corresponding source code, to be ! distributed under the terms of Sections 1 and 2 above on a medium ! customarily used for software interchange; or, ! c) Accompany it with the information you received as to the offer ! to distribute corresponding source code. (This alternative is ! allowed only for noncommercial distribution and only if you ! received the program in object code or executable form with such ! an offer, in accord with Subsection b above.) ! The source code for a work means the preferred form of the work for ! making modifications to it. For an executable work, complete source ! code means all the source code for all modules it contains, plus any ! associated interface definition files, plus the scripts used to ! control compilation and installation of the executable. However, as a ! special exception, the source code distributed need not include ! anything that is normally distributed (in either source or binary ! form) with the major components (compiler, kernel, and so on) of the ! operating system on which the executable runs, unless that component ! itself accompanies the executable. ! If distribution of executable or object code is made by offering ! access to copy from a designated place, then offering equivalent ! access to copy the source code from the same place counts as ! distribution of the source code, even though third parties are not ! compelled to copy the source along with the object code. ! 4. You may not copy, modify, sublicense, or distribute the Program ! except as expressly provided under this License. Any attempt ! otherwise to copy, modify, sublicense or distribute the Program is ! void, and will automatically terminate your rights under this License. ! However, parties who have received copies, or rights, from you under ! this License will not have their licenses terminated so long as such ! parties remain in full compliance. ! 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or ! distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by ! modifying or distributing the Program (or any work based on the ! Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying ! the Program or works based on it. ! 6. Each time you redistribute the Program (or any work based on the ! Program), the recipient automatically receives a license from the ! original licensor to copy, distribute or modify the Program subject to ! these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. ! You are not responsible for enforcing compliance by third parties to this License. ! ! 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or *************** *** 379,396 **** distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you ! may not distribute the Library at all. For example, if a patent ! license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to ! refrain entirely from distribution of the Library. ! If any portion of this section is held invalid or unenforceable under any ! particular circumstance, the balance of the section is intended to apply, ! and the section as a whole is intended to apply in other circumstances. ... [truncated message content] |
|
From: Jerome F. <kin...@us...> - 2009-07-26 22:48:10
|
Update of /cvsroot/munt/mt32emu/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv14557/src Modified Files: partial.cpp partial.h Log Message: Cleaned up, fixed and slightly optimised partial pair mixing: - Now only ring-modulation and ring-modulation-plus-master mixing are performed within Partial. - Ring-modulation slaves are now deactivated immediately after the master. - Slave deactivation is now noticed immediately and handled consistently. These changes seem to have fixed the slight output inconsistencies seen when rendering different buffer lengths. Index: partial.h =================================================================== RCS file: /cvsroot/munt/mt32emu/src/partial.h,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** partial.h 26 Jul 2009 21:01:53 -0000 1.29 --- partial.h 26 Jul 2009 22:48:01 -0000 1.30 *************** *** 90,96 **** Bit32s calcRingMod(Bit16s sample1, Bit16s sample2); ! Bit16s *mixBuffers(Bit16s *buf1, Bit16s *buf2, int len); ! Bit16s *mixBuffersRingMix(Bit16s *buf1, Bit16s *buf2, int len); ! Bit16s *mixBuffersRing(Bit16s *buf1, Bit16s *buf2, int len); Bit16s getPCMSample(unsigned int position); --- 90,95 ---- Bit32s calcRingMod(Bit16s sample1, Bit16s sample2); ! Bit16s *mixBuffersRingMix(Bit16s *buf1, Bit16s *buf2, unsigned long len); ! Bit16s *mixBuffersRing(Bit16s *buf1, Bit16s *buf2, unsigned long len); Bit16s getPCMSample(unsigned int position); *************** *** 133,140 **** // This function (unlike the one below it) returns processed stereo samples // made from combining this single partial with its pair, if it has one. ! bool produceOutput(Bit16s * partialBuf, long length); ! // This function produces mono sample output using the partial's private internal buffer ! Bit16s *generateSamples(long length); }; --- 132,139 ---- // This function (unlike the one below it) returns processed stereo samples // made from combining this single partial with its pair, if it has one. ! bool produceOutput(Bit16s * partialBuf, unsigned long length); ! // This function writes mono sample output to the provided buffer, and returns the number of samples written ! unsigned long generateSamples(Bit16s *buffer, unsigned long length); }; Index: partial.cpp =================================================================== RCS file: /cvsroot/munt/mt32emu/src/partial.cpp,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** partial.cpp 26 Jul 2009 21:01:53 -0000 1.69 --- partial.cpp 26 Jul 2009 22:48:01 -0000 1.70 *************** *** 194,204 **** } ! Bit16s *Partial::generateSamples(long length) { if (!isActive() || alreadyOutputed) { ! return NULL; } if (poly == NULL) { synth->printDebug("*** ERROR: poly is NULL at Partial::generateSamples()!"); ! return NULL; } --- 194,204 ---- } ! unsigned long Partial::generateSamples(Bit16s *partialBuf, unsigned long length) { if (!isActive() || alreadyOutputed) { ! return 0; } if (poly == NULL) { synth->printDebug("*** ERROR: poly is NULL at Partial::generateSamples()!"); ! return 0; } *************** *** 207,212 **** // Generate samples ! Bit16s *partialBuf = &myBuffer[0]; ! while (length--) { float sample = 0; float amp = tva->nextAmp(); --- 207,212 ---- // Generate samples ! unsigned long sampleNum; ! for(sampleNum = 0; sampleNum < length; sampleNum++) { float sample = 0; float amp = tva->nextAmp(); *************** *** 314,322 **** *partialBuf++ = (Bit16s)(amp * sample); } ! // We may have deactivated and broken out of the loop before the end of the buffer, ! // if so then fill the remainder with 0s. ! if (++length > 0) ! memset(partialBuf, 0, length * 2); ! return &myBuffer[0]; } --- 314,319 ---- *partialBuf++ = (Bit16s)(amp * sample); } ! // At this point, sampleNum represents the number of samples rendered ! return sampleNum; } *************** *** 346,367 **** } ! Bit16s *Partial::mixBuffers(Bit16s * buf1, Bit16s *buf2, int len) { ! if (buf1 == NULL) ! return buf2; ! if (buf2 == NULL) ! return buf1; ! ! Bit16s *outBuf = buf1; ! while (len--) { ! *buf1 = *buf1 + *buf2; ! buf1++, buf2++; ! } ! return outBuf; ! } ! ! Bit16s *Partial::mixBuffersRingMix(Bit16s *buf1, Bit16s *buf2, int len) { if (buf1 == NULL) return NULL; if (buf2 == NULL) { Bit16s *outBuf = buf1; while (len--) { --- 343,353 ---- } ! Bit16s *Partial::mixBuffersRingMix(Bit16s *buf1, Bit16s *buf2, unsigned long len) { if (buf1 == NULL) return NULL; if (buf2 == NULL) { + return buf1; + // FIXME:KG: Not sure what the reason for this was, but hopefully it's obsolete + /* Bit16s *outBuf = buf1; while (len--) { *************** *** 373,376 **** --- 359,363 ---- } return outBuf; + */ } *************** *** 390,394 **** } ! Bit16s *Partial::mixBuffersRing(Bit16s *buf1, Bit16s *buf2, int len) { if (buf1 == NULL) { return NULL; --- 377,381 ---- } ! Bit16s *Partial::mixBuffersRing(Bit16s *buf1, Bit16s *buf2, unsigned long len) { if (buf1 == NULL) { return NULL; *************** *** 435,440 **** } ! bool Partial::produceOutput(Bit16s *partialBuf, long length) { ! if (!isActive() || alreadyOutputed) return false; if (poly == NULL) { --- 422,427 ---- } ! bool Partial::produceOutput(Bit16s *partialBuf, unsigned long length) { ! if (!isActive() || alreadyOutputed || isRingModulatingSlave()) return false; if (poly == NULL) { *************** *** 443,505 **** } ! Bit16s *pairBuf = NULL; ! // Check for dependent partial ! if (pair != NULL) { ! if (!pair->alreadyOutputed) { ! // Note: pair may have become NULL after this ! pairBuf = pair->generateSamples(length); } - } else if (useNoisePair) { - // Generate noise for pairless ring mix - pairBuf = synth->tables.noiseBuf; - } - - Bit16s *myBuf = generateSamples(length); - - if (myBuf == NULL && pairBuf == NULL) - return false; - - Bit16s *p1buf, *p2buf; - - if (structurePosition == 0 || pairBuf == NULL) { - p1buf = myBuf; - p2buf = pairBuf; - } else { - p2buf = myBuf; - p1buf = pairBuf; - } - - //synth->printDebug("mixType: %d", mixType); - - Bit16s *mixedBuf; - switch (mixType) { - case 0: - // Standard sound mix - mixedBuf = mixBuffers(p1buf, p2buf, length); - break; - - case 1: - // Ring modulation with sound mix - mixedBuf = mixBuffersRingMix(p1buf, p2buf, length); - break; - - case 2: - // Ring modulation alone - mixedBuf = mixBuffersRing(p1buf, p2buf, length); - break; - - default: - mixedBuf = mixBuffers(p1buf, p2buf, length); - break; } ! if (mixedBuf == NULL) ! return false; ! ! while (length--) { ! *partialBuf++ = (Bit16s)(((Bit32s)*mixedBuf * (Bit32s)stereoVolume.leftvol) >> 16); ! *partialBuf++ = (Bit16s)(((Bit32s)*mixedBuf * (Bit32s)stereoVolume.rightvol) >> 16); ! mixedBuf++; } return true; } --- 430,472 ---- } ! Bit16s *myBuf = &myBuffer[0]; ! unsigned long numGenerated = generateSamples(myBuf, length); ! if (mixType == 1 || mixType == 2) { ! Bit16s *pairBuf; ! unsigned long pairNumGenerated; ! if (pair == NULL) { ! pairBuf = NULL; ! pairNumGenerated = 0; ! } else { ! pairBuf = &pair->myBuffer[0]; ! pairNumGenerated = generateSamples(pairBuf, numGenerated); ! if (!isActive()) { ! pair->deactivate(); ! pair = NULL; ! } else if (!pair->isActive()) { ! pair = NULL; ! } ! } ! if (pairNumGenerated > 0) { ! if(mixType == 1) ! mixBuffersRingMix(myBuf, pairBuf, pairNumGenerated); ! else ! mixBuffersRing(myBuf, pairBuf, pairNumGenerated); ! } ! if (numGenerated > pairNumGenerated) { ! if(mixType == 1) ! mixBuffersRingMix(myBuf + pairNumGenerated, NULL, numGenerated - pairNumGenerated); ! else ! mixBuffersRing(myBuf + pairNumGenerated, NULL, numGenerated - pairNumGenerated); } } ! for (unsigned int i = 0; i < numGenerated; i++) { ! *partialBuf++ = (Bit16s)(((Bit32s)*myBuf * (Bit32s)stereoVolume.leftvol) >> 16); ! *partialBuf++ = (Bit16s)(((Bit32s)*myBuf * (Bit32s)stereoVolume.rightvol) >> 16); ! myBuf++; } + if (numGenerated < length) + memset(partialBuf, 0, sizeof(Bit16s) * 2 * (length - numGenerated)); return true; } |
|
From: Jerome F. <kin...@us...> - 2009-07-26 21:02:09
|
Update of /cvsroot/munt/mt32emu/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv6669/src Modified Files: partial.cpp partial.h Log Message: - Unified ring modulation calculation for ring-modulation-only and ring-modulation-and-master mix types. Index: partial.h =================================================================== RCS file: /cvsroot/munt/mt32emu/src/partial.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** partial.h 24 May 2009 14:09:58 -0000 1.28 --- partial.h 26 Jul 2009 21:01:53 -0000 1.29 *************** *** 89,92 **** --- 89,93 ---- Bit32s pastDesOsc; + Bit32s calcRingMod(Bit16s sample1, Bit16s sample2); Bit16s *mixBuffers(Bit16s *buf1, Bit16s *buf2, int len); Bit16s *mixBuffersRingMix(Bit16s *buf1, Bit16s *buf2, int len); Index: partial.cpp =================================================================== RCS file: /cvsroot/munt/mt32emu/src/partial.cpp,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** partial.cpp 28 May 2009 23:21:37 -0000 1.68 --- partial.cpp 26 Jul 2009 21:01:53 -0000 1.69 *************** *** 321,324 **** --- 321,349 ---- } + Bit32s Partial::calcRingMod(Bit16s sample1, Bit16s sample2) { + static const Bit32s CUTOFF = 2048; + Bit32s a[3], b[3], c[2], d[2]; + a[0] = (Bit32s)sample1; + b[0] = (Bit32s)sample2; + + a[1] = pastCarrier + ((CUTOFF * (a[0] - pastCarrier)) >> 12); + a[2] = a[1] + ((CUTOFF * (0 - a[1])) >> 12); + pastCarrier = a[2]; + + b[1] = pastOsc + ((CUTOFF * (b[0] - pastOsc)) >> 12); + b[2] = b[1] + ((CUTOFF * (0 - b[1])) >> 12); + pastOsc = b[2]; + + c[0] = a[1] ^ b[1]; + c[1] = a[2] * b[2]; + + d[0] = pastDesCarrier + ((CUTOFF * (c[0] - pastDesCarrier)) >> 12); + d[1] = d[0] + ((CUTOFF * (c[1] - d[0])) >> 12); + + pastDesCarrier = d[1]; + + return d[0] >> 5; + } + Bit16s *Partial::mixBuffers(Bit16s * buf1, Bit16s *buf2, int len) { if (buf1 == NULL) *************** *** 335,339 **** } ! Bit16s *Partial::mixBuffersRingMix(Bit16s * buf1, Bit16s *buf2, int len) { if (buf1 == NULL) return NULL; --- 360,364 ---- } ! Bit16s *Partial::mixBuffersRingMix(Bit16s *buf1, Bit16s *buf2, int len) { if (buf1 == NULL) return NULL; *************** *** 351,381 **** Bit16s *outBuf = buf1; - #define CUTOFF 2048 while (len--) { ! int a[3], b[3], c[2], d[2], result; ! a[0] = ((Bit32s)*buf1); ! b[0] = ((Bit32s)*buf2); ! ! a[1] = pastCarrier + ((CUTOFF * (a[0] - pastCarrier)) >> 12); ! a[2] = a[1] + ((CUTOFF * (0 - a[1])) >> 12); ! pastCarrier = a[2]; ! ! b[1] = pastOsc + ((CUTOFF * (b[0] - pastOsc)) >> 12); ! b[2] = b[1] + ((CUTOFF * (0 - b[1])) >> 12); ! pastOsc = b[2]; ! ! c[0] = a[1] ^ b[1]; ! c[1] = (a[2] * b[2]); ! ! d[0] = pastDesCarrier + ((CUTOFF * (c[0] - pastDesCarrier)) >> 12); ! d[1] = d[0] + ((CUTOFF * (c[1] - d[0])) >> 12); ! ! pastDesCarrier = d[1]; ! ! result = ((d[0] >> 5) + a[0]); ! if (result>32767) result = 32767; ! if (result<-32768) result = -32768; *buf1 = (Bit16s)(result); --- 376,385 ---- Bit16s *outBuf = buf1; while (len--) { ! Bit32s result = calcRingMod(*buf1, *buf2) + *buf1; ! if (result > 32767) result = 32767; ! if (result < -32768) result = -32768; *buf1 = (Bit16s)(result); *************** *** 386,390 **** } ! Bit16s *Partial::mixBuffersRing(Bit16s * buf1, Bit16s *buf2, int len) { if (buf1 == NULL) { return NULL; --- 390,394 ---- } ! Bit16s *Partial::mixBuffersRing(Bit16s *buf1, Bit16s *buf2, int len) { if (buf1 == NULL) { return NULL; *************** *** 396,427 **** Bit16s *outBuf = buf1; while (len--) { ! int a[3], b[3], c[2], d[2], result; ! ! a[0] = ((Bit32s)*buf1); ! b[0] = ((Bit32s)*buf2); ! ! ! a[1] = pastCarrier + ((CUTOFF * (a[0] - pastCarrier)) >> 12); ! a[2] = a[1] + ((CUTOFF * (0 - a[1])) >> 12); ! pastCarrier = a[2]; ! ! ! b[1] = pastOsc + ((CUTOFF * (b[0] - pastOsc)) >> 12); ! b[2] = b[1] + ((CUTOFF * (0 - b[1])) >> 12); ! pastOsc = b[2]; ! ! c[0] = a[1] ^ b[1]; ! c[1] = (a[2] * b[2]); ! ! d[0] = pastDesCarrier + ((CUTOFF * (c[0] - pastDesCarrier)) >> 12); ! d[1] = d[0] + ((CUTOFF * (c[1] - d[0])) >> 12); ! ! pastDesCarrier = d[1]; ! ! result = d[0] >> 5; ! if (result>32767) result = 32767; ! if (result<-32768) result = -32768; *buf1 = (Bit16s)(result); --- 400,408 ---- Bit16s *outBuf = buf1; while (len--) { ! Bit32s result = calcRingMod(*buf1, *buf2); ! if (result > 32767) result = 32767; ! if (result < -32768) result = -32768; *buf1 = (Bit16s)(result); |
|
From: Jerome F. <kin...@us...> - 2009-07-25 00:47:41
|
Update of /cvsroot/munt/mt32emu_smf2wav/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv15534/src Modified Files: mt32emu-smf2wav.cpp Log Message: - Now documents and requires a minimum buffer size of 4 bytes. Index: mt32emu-smf2wav.cpp =================================================================== RCS file: /cvsroot/munt/mt32emu_smf2wav/src/mt32emu-smf2wav.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mt32emu-smf2wav.cpp 12 Jul 2009 15:04:51 -0000 1.6 --- mt32emu-smf2wav.cpp 25 Jul 2009 00:47:32 -0000 1.7 *************** *** 290,294 **** fprintf(stdout, "\nusage: %s [arguments] <SMF MIDI file>\n\n", cmd); fprintf(stdout, "Arguments:\n"); ! fprintf(stdout, " -b Buffer size (in bytes) (default: %d)\n", DEFAULT_BUFFER_SIZE); fprintf(stdout, " -f Force overwrite of output file if already present\n"); fprintf(stdout, " -h Show this help and exit\n"); --- 290,294 ---- fprintf(stdout, "\nusage: %s [arguments] <SMF MIDI file>\n\n", cmd); fprintf(stdout, "Arguments:\n"); ! fprintf(stdout, " -b Buffer size (in bytes) (minimum: 4, default: %d)\n", DEFAULT_BUFFER_SIZE); fprintf(stdout, " -f Force overwrite of output file if already present\n"); fprintf(stdout, " -h Show this help and exit\n"); *************** *** 313,316 **** --- 313,320 ---- case 'b': bufferSize = atoi(optarg); + if (bufferSize < 4) { + printUsage(cmd); + return 0; + } break; case 'f': |
|
From: Jerome F. <kin...@us...> - 2009-07-12 15:04:58
|
Update of /cvsroot/munt/mt32emu_smf2wav/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv24676/src Modified Files: mt32emu-smf2wav.cpp Log Message: - Added support for partial sysex messages. Index: mt32emu-smf2wav.cpp =================================================================== RCS file: /cvsroot/munt/mt32emu_smf2wav/src/mt32emu-smf2wav.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** mt32emu-smf2wav.cpp 23 Mar 2009 23:09:55 -0000 1.5 --- mt32emu-smf2wav.cpp 12 Jul 2009 15:04:51 -0000 1.6 *************** *** 166,169 **** --- 166,171 ---- if (dstFile != NULL) { if (writeWAVEHeader(dstFile, synthProperties.sampleRate)) { + int unterminatedSysexLen = 0; + unsigned char *unterminatedSysex = NULL; for (;;) { smf_event_t *event = smf_get_next_event(smf); *************** *** 200,206 **** if (decoded && !quiet) fprintf(stdout, "Metadata: %s\n", decoded); ! } else if (smf_event_is_system_common(event)) { ! if (event->midi_buffer[0] == 0xF0) { ! synth->playSysex(event->midi_buffer, event->midi_buffer_length); } } else { --- 202,248 ---- if (decoded && !quiet) fprintf(stdout, "Metadata: %s\n", decoded); ! } else if (smf_event_is_sysex(event) || smf_event_is_sysex_continuation(event)) { ! bool unterminated = smf_event_is_unterminated_sysex(event); ! bool addUnterminated = unterminated; ! bool continuation = smf_event_is_sysex_continuation(event); ! unsigned char *buf; ! int len; ! if (continuation) { ! if (unterminatedSysex != NULL) { ! addUnterminated = true; ! } else { ! fprintf(stderr, "Sysex continuation received without preceding unterminated sysex - hoping for the best\n"); ! } ! buf = event->midi_buffer + 1; ! len = event->midi_buffer_length - 1; ! } else { ! if (unterminatedSysex != NULL) { ! fprintf(stderr, "New sysex received with an unterminated sysex pending - ignoring unterminated\n"); ! delete[] unterminatedSysex; ! unterminatedSysex = NULL; ! unterminatedSysexLen = 0; ! } ! buf = event->midi_buffer; ! len = event->midi_buffer_length; ! } ! if (addUnterminated) { ! unsigned char *newUnterminatedSysex = new unsigned char[unterminatedSysexLen + len]; ! if(unterminatedSysex != NULL) { ! memcpy(newUnterminatedSysex, unterminatedSysex, unterminatedSysexLen); ! delete[] unterminatedSysex; ! } ! memcpy(newUnterminatedSysex + unterminatedSysexLen, buf, len); ! unterminatedSysex = newUnterminatedSysex; ! unterminatedSysexLen += len; ! buf = unterminatedSysex; ! len = unterminatedSysexLen; ! } ! if (!unterminated) { ! synth->playSysex(buf, len); ! if (addUnterminated) { ! delete[] unterminatedSysex; ! unterminatedSysex = NULL; ! unterminatedSysexLen = 0; ! } } } else { *************** *** 220,223 **** --- 262,268 ---- } } + if (unterminatedSysex != NULL) { + delete[] unterminatedSysex; + } if (!fillWAVESizes(dstFile, playedSamples)) { fprintf(stderr, "Error writing final sizes to WAVE header\n"); |
|
From: Jerome F. <kin...@us...> - 2009-07-12 15:04:00
|
Update of /cvsroot/munt/mt32emu_smf2wav/libsmf/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv24527/src Modified Files: smf.h smf_decode.c smf_load.c Log Message: - Fixed several bugs in escaped message parsing, including adding support for continued sysex messages. Index: smf_decode.c =================================================================== RCS file: /cvsroot/munt/mt32emu_smf2wav/libsmf/src/smf_decode.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** smf_decode.c 28 Feb 2009 23:42:59 -0000 1.1 --- smf_decode.c 12 Jul 2009 15:03:54 -0000 1.2 *************** *** 109,112 **** --- 109,136 ---- } + int + smf_event_is_sysex_continuation(const smf_event_t *event) + { + assert(event->midi_buffer); + assert(event->midi_buffer_length > 0); + + if (event->midi_buffer[0] == 0xF7) + return (1); + + return (0); + } + + int + smf_event_is_unterminated_sysex(const smf_event_t *event) + { + assert(event->midi_buffer); + assert(event->midi_buffer_length > 0); + + if (!smf_event_is_sysex(event) && !smf_event_is_sysex_continuation(event)) + return 0; + + return event->midi_buffer[event->midi_buffer_length - 1] != 0xF7; + } + static char * smf_event_decode_textual(const smf_event_t *event, const char *name) Index: smf_load.c =================================================================== RCS file: /cvsroot/munt/mt32emu_smf2wav/libsmf/src/smf_load.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** smf_load.c 28 Feb 2009 23:42:59 -0000 1.1 --- smf_load.c 12 Jul 2009 15:03:54 -0000 1.2 *************** *** 296,306 **** } - static int - expected_escaped_length(const unsigned char status, const unsigned char *second_byte, const int buffer_length, int *consumed_bytes) - { - /* -1, because we do not want to account for 0x7F status. */ - return (expected_sysex_length(status, second_byte, buffer_length, consumed_bytes) - 1); - } - /** * Returns expected length of the midi message (including the status byte), in bytes, for the given status byte. --- 296,299 ---- *************** *** 383,387 **** static int ! extract_sysex_event(const unsigned char *buf, const int buffer_length, smf_event_t *event, int *len, int last_status) { int status, message_length, vlq_length; --- 376,380 ---- static int ! extract_sysex_event(const unsigned char *buf, const int buffer_length, smf_event_t *event, int *len, int last_status, int *has_unterminated_sysex) { int status, message_length, vlq_length; *************** *** 416,419 **** --- 409,414 ---- memcpy(event->midi_buffer + 1, c, message_length - 1); + *has_unterminated_sysex = event->midi_buffer[event->midi_buffer_length - 1] != 0xF7; + *len = vlq_length + message_length; *************** *** 422,426 **** static int ! extract_escaped_event(const unsigned char *buf, const int buffer_length, smf_event_t *event, int *len, int last_status) { int status, message_length, vlq_length; --- 417,421 ---- static int ! extract_escaped_event(const unsigned char *buf, const int buffer_length, smf_event_t *event, int *len, int last_status, int *has_unterminated_sysex) { int status, message_length, vlq_length; *************** *** 433,449 **** c++; ! message_length = expected_escaped_length(status, c, buffer_length - 1, &vlq_length); ! ! if (message_length < 0) return (-3); c += vlq_length; ! if (vlq_length + message_length >= buffer_length) { g_critical("End of buffer in extract_escaped_event()."); return (-5); } ! event->midi_buffer_length = message_length; event->midi_buffer = malloc(event->midi_buffer_length); if (event->midi_buffer == NULL) { --- 428,449 ---- c++; ! if (extract_vlq(c, buffer_length - 1, &message_length, &vlq_length) != 0) return (-3); + if (message_length < 1) { + g_critical("0-length escaped event in extract_escaped_event()."); + return (-4); + } + c += vlq_length; ! if (1 + vlq_length + message_length > buffer_length) { g_critical("End of buffer in extract_escaped_event()."); return (-5); } ! /* If *has_unterminated_sysex is non-zero, we want to add the F7 status byte to the start of the message ! so that it can be identified as such. */ ! event->midi_buffer_length = *has_unterminated_sysex ? message_length + 1 : message_length; event->midi_buffer = malloc(event->midi_buffer_length); if (event->midi_buffer == NULL) { *************** *** 451,467 **** return (-4); } ! memcpy(event->midi_buffer, c, message_length); ! ! if (smf_event_is_valid(event)) { g_critical("Escaped event is invalid."); return (-1); } ! if (smf_event_is_system_realtime(event) || smf_event_is_system_common(event)) { ! g_warning("Escaped event is not System Realtime nor System Common."); ! } ! ! *len = vlq_length + message_length; return (0); --- 451,471 ---- return (-4); } + if (*has_unterminated_sysex) { + event->midi_buffer[0] = 0xF7; + memcpy(event->midi_buffer + 1, c, message_length); + *has_unterminated_sysex = c[message_length - 1] != 0xF7; + } else { + memcpy(event->midi_buffer, c, message_length); + if (smf_event_is_system_realtime(event) || smf_event_is_system_common(event)) { + g_warning("Escaped event is not System Realtime nor System Common."); + } + } ! if (!smf_event_is_valid(event)) { g_critical("Escaped event is invalid."); return (-1); } ! *len = 1 + vlq_length + message_length; return (0); *************** *** 475,479 **** */ static int ! extract_midi_event(const unsigned char *buf, const int buffer_length, smf_event_t *event, int *len, int last_status) { int status, message_length; --- 479,483 ---- */ static int ! extract_midi_event(const unsigned char *buf, const int buffer_length, smf_event_t *event, int *len, int last_status, int *has_unterminated_sysex) { int status, message_length; *************** *** 498,505 **** if (is_sysex_byte(status)) ! return (extract_sysex_event(buf, buffer_length, event, len, last_status)); if (is_escape_byte(status)) ! return (extract_escaped_event(buf, buffer_length, event, len, last_status)); /* At this point, "c" points to first byte following the status byte. */ --- 502,509 ---- if (is_sysex_byte(status)) ! return (extract_sysex_event(buf, buffer_length, event, len, last_status, has_unterminated_sysex)); if (is_escape_byte(status)) ! return (extract_escaped_event(buf, buffer_length, event, len, last_status, has_unterminated_sysex)); /* At this point, "c" points to first byte following the status byte. */ *************** *** 565,569 **** /* Now, extract the actual event. */ ! if (extract_midi_event(c, buffer_length, event, &len, track->last_status)) goto error; --- 569,573 ---- /* Now, extract the actual event. */ ! if (extract_midi_event(c, buffer_length, event, &len, track->last_status, &track->has_unterminated_sysex)) goto error; *************** *** 719,724 **** return (0); ! /* We cannot use expected_message_length on sysexes. */ ! if (smf_event_is_sysex(event)) return (1); --- 723,728 ---- return (0); ! /* We cannot use expected_message_length on sysexes or sysex continuations. */ ! if (smf_event_is_sysex(event) || smf_event_is_sysex_continuation(event)) return (1); *************** *** 745,749 **** if (!is_status_byte(event->midi_buffer[0])) { ! g_critical("First byte of MIDI message is not a valid status byte."); return (0); --- 749,753 ---- if (!is_status_byte(event->midi_buffer[0])) { ! g_critical("First byte of MIDI message (%02X) is not a valid status byte.", event->midi_buffer[0] & 0xFF); return (0); Index: smf.h =================================================================== RCS file: /cvsroot/munt/mt32emu_smf2wav/libsmf/src/smf.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** smf.h 28 Feb 2009 23:42:59 -0000 1.1 --- smf.h 12 Jul 2009 15:03:54 -0000 1.2 *************** *** 279,282 **** --- 279,283 ---- int file_buffer_length; int last_status; /* Used for "running status". */ + int has_unterminated_sysex; /** Private, used by smf.c. */ *************** *** 377,380 **** --- 378,383 ---- int smf_event_is_system_common(const smf_event_t *event) WARN_UNUSED_RESULT; int smf_event_is_sysex(const smf_event_t *event) WARN_UNUSED_RESULT; + int smf_event_is_sysex_continuation(const smf_event_t *event) WARN_UNUSED_RESULT; + int smf_event_is_unterminated_sysex(const smf_event_t *event) WARN_UNUSED_RESULT; int smf_event_is_eot(const smf_event_t *event) WARN_UNUSED_RESULT; int smf_event_is_textual(const smf_event_t *event) WARN_UNUSED_RESULT; |
|
From: Jerome F. <kin...@us...> - 2009-07-05 17:39:43
|
Update of /cvsroot/munt/mt32emu/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv606 Modified Files: synth.cpp Log Message: - The rhythm patchtemp area was not being initialised, potentially resulting in segfaults during sysex writes to the area. Fixed. (Thanks to Mok for report/analysis) Index: synth.cpp =================================================================== RCS file: /cvsroot/munt/mt32emu/src/synth.cpp,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** synth.cpp 11 Jun 2009 21:33:22 -0000 1.66 --- synth.cpp 5 Jul 2009 17:39:30 -0000 1.67 *************** *** 517,528 **** return false; ! for (int i = 0; i < 8; i++) { ! mt32ram.patchTemp[i].outputLevel = 80; ! mt32ram.patchTemp[i].panpot = controlROMData[controlROMMap->panSettings + i]; ! memset(mt32ram.patchTemp[i].dummyv, 0, sizeof(mt32ram.patchTemp[i].dummyv)); ! parts[i] = new Part(this, i); ! parts[i]->setProgram(controlROMData[controlROMMap->programSettings + i]); } - parts[8] = new RhythmPart(this, 8); // For resetting mt32 mid-execution --- 517,545 ---- return false; ! for (int i = 0; i < 9; i++) { ! MemParams::PatchTemp *patchTemp = &mt32ram.patchTemp[i]; ! ! // Note that except for the rhythm part, these patch fields will be set in setProgram() below anyway. ! patchTemp->patch.timbreGroup = 0; ! patchTemp->patch.timbreNum = 0; ! patchTemp->patch.keyShift = 24; ! patchTemp->patch.fineTune = 50; ! patchTemp->patch.benderRange = 12; ! patchTemp->patch.assignMode = 0; ! patchTemp->patch.reverbSwitch = 1; ! patchTemp->patch.dummy = 0; ! ! patchTemp->outputLevel = 80; ! patchTemp->panpot = controlROMData[controlROMMap->panSettings + i]; ! memset(patchTemp->dummyv, 0, sizeof(patchTemp->dummyv)); ! patchTemp->dummyv[1] = 127; ! ! if(i < 8) { ! parts[i] = new Part(this, i); ! parts[i]->setProgram(controlROMData[controlROMMap->programSettings + i]); ! } else { ! parts[i] = new RhythmPart(this, i); ! } } // For resetting mt32 mid-execution |
|
From: Jerome F. <kin...@us...> - 2009-06-11 21:33:31
|
Update of /cvsroot/munt/mt32emu/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv22227/src Modified Files: synth.cpp Log Message: - Code indentation fixes. Index: synth.cpp =================================================================== RCS file: /cvsroot/munt/mt32emu/src/synth.cpp,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** synth.cpp 11 Jun 2009 21:30:48 -0000 1.65 --- synth.cpp 11 Jun 2009 21:33:22 -0000 1.66 *************** *** 732,737 **** // This is checked early in the real devices (before any sysex length checks or further processing) if (command == SYSEX_CMD_DT1 && sysex[0] == 0x7F) { ! reset(); ! return; } if (len < 4) { --- 732,737 ---- // This is checked early in the real devices (before any sysex length checks or further processing) if (command == SYSEX_CMD_DT1 && sysex[0] == 0x7F) { ! reset(); ! return; } if (len < 4) { |
|
From: Jerome F. <kin...@us...> - 2009-06-11 21:30:51
|
Update of /cvsroot/munt/mt32emu/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21915/src Modified Files: synth.cpp Log Message: - Code indentation fixes. Index: synth.cpp =================================================================== RCS file: /cvsroot/munt/mt32emu/src/synth.cpp,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** synth.cpp 11 Jun 2009 14:24:23 -0000 1.64 --- synth.cpp 11 Jun 2009 21:30:48 -0000 1.65 *************** *** 731,738 **** } // This is checked early in the real devices (before any sysex length checks or further processing) ! if (command == SYSEX_CMD_DT1 && sysex[0] == 0x7F) { ! reset(); ! return; ! } if (len < 4) { printDebug("playSysexWithoutHeader: Message is too short (%d bytes)!", len); --- 731,738 ---- } // This is checked early in the real devices (before any sysex length checks or further processing) ! if (command == SYSEX_CMD_DT1 && sysex[0] == 0x7F) { ! reset(); ! return; ! } if (len < 4) { printDebug("playSysexWithoutHeader: Message is too short (%d bytes)!", len); *************** *** 1196,1203 **** m=0; for (unsigned int i = 0; i < len; i++) { ! stream[m] = clipBit16s(outbufl[i] * 32767.0f); ! m++; ! stream[m] = clipBit16s(outbufr[i] * 32767.0f); ! m++; } for (unsigned int i = 0; i < MT32EMU_MAX_PARTIALS; i++) { --- 1196,1203 ---- m=0; for (unsigned int i = 0; i < len; i++) { ! stream[m] = clipBit16s(outbufl[i] * 32767.0f); ! m++; ! stream[m] = clipBit16s(outbufr[i] * 32767.0f); ! m++; } for (unsigned int i = 0; i < MT32EMU_MAX_PARTIALS; i++) { |
|
From: Jerome F. <kin...@us...> - 2009-06-11 14:24:27
|
Update of /cvsroot/munt/mt32emu/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv28084/src Modified Files: synth.cpp Log Message: - Removed #ifdef-ed out SSE/3DNow detection. Index: synth.cpp =================================================================== RCS file: /cvsroot/munt/mt32emu/src/synth.cpp,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** synth.cpp 11 Jun 2009 13:03:39 -0000 1.63 --- synth.cpp 11 Jun 2009 14:24:23 -0000 1.64 *************** *** 531,554 **** iirFilter = &iir_filter_normal; - #ifdef MT32EMU_HAVE_X86 - bool availableSSE = false; //DetectSIMD(); - bool available3DNow = false; //Detect3DNow(); - - if (availableSSE) - report(ReportType_availableSSE, NULL); - if (available3DNow) - report(ReportType_available3DNow, NULL); - - if (available3DNow) { - printDebug("Detected and using SIMD (AMD 3DNow) extensions"); - iirFilter = &iir_filter_3dnow; - report(ReportType_using3DNow, NULL); - } else if (availableSSE) { - printDebug("Detected and using SIMD (Intel SSE) extensions"); - iirFilter = &iir_filter_sse; - report(ReportType_usingSSE, NULL); - } - #endif - isOpen = true; isEnabled = false; --- 531,534 ---- |
|
From: Jerome F. <kin...@us...> - 2009-06-11 13:03:48
|
Update of /cvsroot/munt/mt32emu/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv16414/src Modified Files: part.h synth.cpp part.cpp Log Message: - Implemented MIDI data entry/RPN handling (used for setting pitch bend range). - Improved sysex reset - now more closely matches the behaviour documented by Mok. Index: synth.cpp =================================================================== RCS file: /cvsroot/munt/mt32emu/src/synth.cpp,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** synth.cpp 7 Jun 2009 18:32:20 -0000 1.62 --- synth.cpp 11 Jun 2009 13:03:39 -0000 1.63 *************** *** 630,635 **** break; case 0x06: ! // FIXME: This really needs to be implemented (it's supported, at least on the LAPC-I, for bender range setting) ! printDebug("MIDI data entry unimplemented. Note=0x%02x, Velo=0x%02x", note, velocity); break; case 0x07: // Set volume --- 630,634 ---- break; case 0x06: ! parts[part]->setDataEntryMSB(velocity); break; case 0x07: // Set volume *************** *** 647,660 **** case 0x40: // Hold (sustain) pedal //printDebug("Hold pedal set: %d", velocity); ! parts[part]->setHoldPedal(velocity>=64); break; case 0x79: // Reset all controllers //printDebug("Reset all controllers"); ! // CONFIRMED:Mok: A real LAPC-I responds to this controller as follows: ! parts[part]->setHoldPedal(false); ! parts[part]->setModulation(0); ! parts[part]->setExpression(127); ! parts[part]->setBend(0x2000); break; --- 646,666 ---- case 0x40: // Hold (sustain) pedal //printDebug("Hold pedal set: %d", velocity); ! parts[part]->setHoldPedal(velocity >= 64); ! break; ! ! case 0x62: ! case 0x63: ! parts[part]->setNRPN(); ! break; ! case 0x64: ! parts[part]->setRPNLSB(velocity); ! break; ! case 0x65: ! parts[part]->setRPNMSB(velocity); break; case 0x79: // Reset all controllers //printDebug("Reset all controllers"); ! parts[part]->resetAllControllers(); break; *************** *** 1100,1104 **** mt32ram = mt32default; for (int i = 0; i < 9; i++) { ! parts[i]->refresh(); } refreshSystem(); --- 1106,1115 ---- mt32ram = mt32default; for (int i = 0; i < 9; i++) { ! parts[i]->reset(); ! if (i != 8) { ! parts[i]->setProgram(controlROMData[controlROMMap->programSettings + i]); ! } else { ! parts[8]->refresh(); ! } } refreshSystem(); Index: part.cpp =================================================================== RCS file: /cvsroot/munt/mt32emu/src/part.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** part.cpp 24 May 2009 15:36:00 -0000 1.42 --- part.cpp 11 Jun 2009 13:03:39 -0000 1.43 *************** *** 78,87 **** } ! void Part::setHoldPedal(bool pedalval) { ! if (holdpedal && !pedalval) { holdpedal = false; stopPedalHold(); } else { ! holdpedal = pedalval; } } --- 78,116 ---- } ! void Part::setDataEntryMSB(unsigned char midiDataEntryMSB) { ! if (nrpn) { ! // The last RPN-related control change was for an NRPN, ! // which the real synths don't support. ! return; ! } ! if (rpn != 0) { ! // The RPN has been set to something other than 0, ! // which is the only RPN that these synths support ! return; ! } ! patchTemp->patch.benderRange = midiDataEntryMSB > 24 ? 24 : midiDataEntryMSB; ! updatePitchBenderRange(); ! } ! ! void Part::setNRPN() { ! nrpn = true; ! } ! ! void Part::setRPNLSB(unsigned char midiRPNLSB) { ! nrpn = false; ! rpn = (rpn & 0xFF00) | midiRPNLSB; ! } ! ! void Part::setRPNMSB(unsigned char midiRPNMSB) { ! nrpn = false; ! rpn = (rpn & 0x00FF) | (midiRPNMSB << 8); ! } ! ! void Part::setHoldPedal(bool pressed) { ! if (holdpedal && !pressed) { holdpedal = false; stopPedalHold(); } else { ! holdpedal = pressed; } } *************** *** 104,107 **** --- 133,149 ---- } + void Part::resetAllControllers() { + modulation = 0; + expression = 100; + pitchBend = 0; + setHoldPedal(false); + } + + void Part::reset() { + resetAllControllers(); + allSoundOff(); + rpn = 0xFFFF; + } + void RhythmPart::refresh() { // (Re-)cache all the mapped timbres ahead of time *************** *** 196,211 **** } - void Part::updatePitchBenderRange() { - pitchBenderRange = patchTemp->patch.benderRange * 683; - } - void Part::setProgram(unsigned int patchNum) { setPatch(&synth->mt32ram.patches[patchNum]); updatePitchBenderRange(); setTimbre(&synth->mt32ram.timbres[getAbsTimbreNum()].timbre); - refresh(); ! allSoundOff(); //FIXME:KG: Is this correct? } --- 238,251 ---- } void Part::setProgram(unsigned int patchNum) { setPatch(&synth->mt32ram.patches[patchNum]); updatePitchBenderRange(); + allSoundOff(); setTimbre(&synth->mt32ram.timbres[getAbsTimbreNum()].timbre); refresh(); + } ! void Part::updatePitchBenderRange() { ! pitchBenderRange = patchTemp->patch.benderRange * 683; } Index: part.h =================================================================== RCS file: /cvsroot/munt/mt32emu/src/part.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** part.h 24 May 2009 15:36:00 -0000 1.23 --- part.h 11 Jun 2009 13:03:39 -0000 1.24 *************** *** 56,59 **** --- 56,61 ---- Bit8u expression; Bit32s pitchBend; + bool nrpn; + Bit16u rpn; Bit16u pitchBenderRange; // (patchTemp->patch.benderRange * 683) at the time of the last MIDI program change or MIDI data entry. *************** *** 67,70 **** --- 69,78 ---- Part(Synth *synth, unsigned int usePartNum); ~Part(); + void reset(); + void setDataEntryMSB(unsigned char midiDataEntryMSB); + void setNRPN(); + void setRPNLSB(unsigned char midiRPNLSB); + void setRPNMSB(unsigned char midiRPNMSB); + void resetAllControllers(); virtual void noteOn(unsigned int midiKey, unsigned int velocity); virtual void noteOff(unsigned int midiKey); |
|
From: Jerome F. <kin...@us...> - 2009-06-07 18:32:55
|
Update of /cvsroot/munt/mt32emu/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv9230/src Modified Files: synth.cpp synth.h Makefile.am Added Files: delayReverb.cpp delayReverb.h Log Message: - Added a new model for "type 3" reverb, based on info from Mok: Simple delay of left/right mix with feedback, with separate output delay to left and right. Index: synth.cpp =================================================================== RCS file: /cvsroot/munt/mt32emu/src/synth.cpp,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** synth.cpp 7 Jun 2009 06:32:49 -0000 1.61 --- synth.cpp 7 Jun 2009 18:32:20 -0000 1.62 *************** *** 22,25 **** --- 22,27 ---- #include "mt32emu.h" + #include "delayReverb.h" + namespace MT32Emu { *************** *** 105,111 **** --- 107,115 ---- isOpen = false; reverbModel = NULL; + delayReverbModel = NULL; reverbEnabled = true; reverbOverridden = false; setReverbModel(NULL); // Creates a default FreeverbModel + setDelayReverbModel(NULL); // Creates a default DelayReverb. partialManager = NULL; memset(parts, 0, sizeof(parts)); *************** *** 115,118 **** --- 119,123 ---- close(); // Make sure we're closed and everything is freed delete reverbModel; + delete delayReverbModel; } *************** *** 149,152 **** --- 154,166 ---- } + void Synth::setDelayReverbModel(ReverbModel *delayReverbModel) { + delete this->delayReverbModel; + if(delayReverbModel == NULL) + delayReverbModel = new DelayReverb(); + this->delayReverbModel = delayReverbModel; + if(isOpen) + setReverbParameters(mt32ram.system.reverbMode, mt32ram.system.reverbTime, mt32ram.system.reverbLevel); + } + void Synth::setReverbEnabled(bool reverbEnabled) { this->reverbEnabled = reverbEnabled; *************** *** 168,172 **** if(reverbOverridden) return; ! reverbModel->setParameters(mode, time, level); } --- 182,189 ---- if(reverbOverridden) return; ! if(mode == 3) ! delayReverbModel->setParameters(mode, time, level); ! else ! reverbModel->setParameters(mode, time, level); } *************** *** 403,406 **** --- 420,425 ---- reverbModel->reset(); reverbModel->setSampleRate(useProp.sampleRate); + delayReverbModel->reset(); + delayReverbModel->setSampleRate(useProp.sampleRate); myProp = useProp; if (useProp.baseDir != NULL) { *************** *** 1178,1182 **** m++; } ! reverbModel->process(sndbufl, sndbufr, outbufl, outbufr, len); m=0; for (unsigned int i = 0; i < len; i++) { --- 1197,1206 ---- m++; } ! if (mt32ram.system.reverbMode == 3) { ! delayReverbModel->process(sndbufl, sndbufr, outbufl, outbufr, len); ! } ! else { ! reverbModel->process(sndbufl, sndbufr, outbufl, outbufr, len); ! } m=0; for (unsigned int i = 0; i < len; i++) { --- NEW FILE: delayReverb.cpp --- /* Copyright (C) 2003-2009 Dean Beeler, Jerome Fisher * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 2.1 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <string.h> #include "mt32emu.h" #include "delayReverb.h" using namespace MT32Emu; // All in seconds const float RAMP_TIME = 1.0f / 88.0f; // Time taken to ramp up from 0 to desired reverb/feedback levels after parameter change const float BASE_DELAY = 0.0006875; const float LEFT_DELAY_COEF = 0.056; const float RIGHT_DELAY_COEF = 0.028; DelayReverb::DelayReverb() { sampleRate = 0; buf = NULL; bufSize = 0; leftDelaySeconds = 0; rightDelaySeconds = 0; targetReverbLevel = 0; targetFeedbackLevel = 0; } DelayReverb::~DelayReverb() { delete[] buf; } void DelayReverb::setSampleRate(unsigned int sampleRate) { if(sampleRate != this->sampleRate) { this->sampleRate = sampleRate; delete[] buf; // FIXME: Always 2 second buffer - we could reduce this to what we actually need after we've tweaked the parameters bufSize = 2 * sampleRate; buf = new float[bufSize]; this->rampTarget = (unsigned int)(RAMP_TIME * sampleRate); reset(); } } void DelayReverb::setParameters(Bit8u mode, Bit8u time, Bit8u level) { float oldLeftDelaySeconds = leftDelaySeconds; float oldRightDelaySeconds = rightDelaySeconds; float oldTargetReverbLevel = targetReverbLevel; float oldTargetFeedbackLevel = targetFeedbackLevel; leftDelaySeconds = BASE_DELAY + time * LEFT_DELAY_COEF; rightDelaySeconds = BASE_DELAY + time * RIGHT_DELAY_COEF; targetReverbLevel = level * 6.0f / 127.0f; targetFeedbackLevel = 30.0f / 128.0f; if (leftDelaySeconds != oldLeftDelaySeconds || rightDelaySeconds != oldRightDelaySeconds || targetReverbLevel != oldTargetReverbLevel || targetFeedbackLevel != oldTargetFeedbackLevel) { resetParameters(); } } void DelayReverb::process(const float *inLeft, const float *inRight, float *outLeft, float *outRight, long numSamples) { for (unsigned int sampleIx = 0; sampleIx < numSamples; sampleIx++) { float leftSample = inLeft[sampleIx]; float rightSample = inRight[sampleIx]; bufIx = (bufSize + bufIx - 1) % bufSize; float reverbLeft = buf[(bufIx + leftDelay) % bufSize]; float reverbRight = buf[(bufIx + rightDelay) % bufSize]; outLeft[sampleIx] = (reverbLeft * reverbLevel) + leftSample; outRight[sampleIx] = (reverbRight * reverbLevel) + rightSample; buf[bufIx] = (reverbLeft * feedbackLevel) + (leftSample + rightSample) / 2.0f; if (rampCount < rampTarget) { // Linearly ramp up reverb/feedback levels over RAMP_TIME (after parameter change) rampCount++; if (rampCount == rampTarget) { reverbLevel = targetReverbLevel; feedbackLevel = targetFeedbackLevel; } else { reverbLevel += reverbLevelRampInc; feedbackLevel += feedbackLevelRampInc; } } } } void DelayReverb::reset() { resetBuffer(); resetParameters(); } void DelayReverb::resetBuffer() { bufIx = 0; if (buf != NULL) { memset(buf, 0, bufSize * sizeof(float)); } } void DelayReverb::resetParameters() { leftDelay = leftDelaySeconds * sampleRate; rightDelay = rightDelaySeconds * sampleRate; rampCount = 0; reverbLevel = 0; feedbackLevel = 0; feedbackLevelRampInc = targetFeedbackLevel / rampTarget; reverbLevelRampInc = targetReverbLevel / rampTarget; } Index: Makefile.am =================================================================== RCS file: /cvsroot/munt/mt32emu/src/Makefile.am,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Makefile.am 24 May 2009 18:39:13 -0000 1.8 --- Makefile.am 7 Jun 2009 18:32:20 -0000 1.9 *************** *** 1,3 **** lib_LIBRARIES = libmt32emu.a ! libmt32emu_a_SOURCES = file.cpp part.cpp partial.cpp partialManager.cpp poly.cpp synth.cpp tables.cpp tva.cpp tvf.cpp tvp.cpp freeverb/allpass.cpp freeverb/comb.cpp freeverb/revmodel.cpp blit/Blit.cpp blit/BlitSaw.cpp blit/BlitSquare.cpp blit/Generator.cpp blit/Stk.cpp nobase_pkginclude_HEADERS = file.h mt32emu.h part.h partial.h partialManager.h poly.h structures.h synth.h tables.h tva.h tvf.h tvp.h freeverb/allpass.h freeverb/comb.h freeverb/denormals.h freeverb/tuning.h freeverb/revmodel.h blit/BlitSaw.h blit/BlitSquare.h blit/Generator.h blit/Stk.h --- 1,3 ---- lib_LIBRARIES = libmt32emu.a ! libmt32emu_a_SOURCES = delayReverb.cpp file.cpp part.cpp partial.cpp partialManager.cpp poly.cpp synth.cpp tables.cpp tva.cpp tvf.cpp tvp.cpp freeverb/allpass.cpp freeverb/comb.cpp freeverb/revmodel.cpp blit/Blit.cpp blit/BlitSaw.cpp blit/BlitSquare.cpp blit/Generator.cpp blit/Stk.cpp nobase_pkginclude_HEADERS = file.h mt32emu.h part.h partial.h partialManager.h poly.h structures.h synth.h tables.h tva.h tvf.h tvp.h freeverb/allpass.h freeverb/comb.h freeverb/denormals.h freeverb/tuning.h freeverb/revmodel.h blit/BlitSaw.h blit/BlitSquare.h blit/Generator.h blit/Stk.h --- NEW FILE: delayReverb.h --- /* Copyright (C) 2003-2009 Dean Beeler, Jerome Fisher * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 2.1 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef MT32EMU_DELAYREVERB_H #define MT32EMU_DELAYREVERB_H namespace MT32Emu { class DelayReverb : public ReverbModel { private: float *buf; unsigned int sampleRate; unsigned int bufSize; unsigned int bufIx; unsigned int rampCount; unsigned int rampTarget; unsigned int leftDelay; unsigned int rightDelay; float leftDelaySeconds; float rightDelaySeconds; float targetReverbLevel; float reverbLevelRampInc; float reverbLevel; float targetFeedbackLevel; float feedbackLevelRampInc; float feedbackLevel; void resetBuffer(); void resetParameters(); public: DelayReverb(); ~DelayReverb(); void setSampleRate(unsigned int sampleRate); void setParameters(Bit8u mode, Bit8u time, Bit8u level); void process(const float *inLeft, const float *inRight, float *outLeft, float *outRight, long numSamples); void reset(); }; } #endif Index: synth.h =================================================================== RCS file: /cvsroot/munt/mt32emu/src/synth.h,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** synth.h 5 Jun 2009 23:56:52 -0000 1.29 --- synth.h 7 Jun 2009 18:32:20 -0000 1.30 *************** *** 310,313 **** --- 310,314 ---- ReverbModel *reverbModel; + ReverbModel *delayReverbModel; bool reverbEnabled; bool reverbOverridden; *************** *** 382,385 **** --- 383,387 ---- void setReverbModel(ReverbModel *reverbModel); + void setDelayReverbModel(ReverbModel *reverbModel); void setReverbEnabled(bool reverbEnabled); bool isReverbEnabled() const; |
|
From: Jerome F. <kin...@us...> - 2009-06-07 06:33:20
|
Update of /cvsroot/munt/mt32emu/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv1939/src Modified Files: synth.cpp Log Message: - Fixed reverbModel being incorrectly deleted on close(). Index: synth.cpp =================================================================== RCS file: /cvsroot/munt/mt32emu/src/synth.cpp,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** synth.cpp 5 Jun 2009 23:56:52 -0000 1.60 --- synth.cpp 7 Jun 2009 06:32:49 -0000 1.61 *************** *** 548,556 **** } - if (reverbModel != NULL) { - delete reverbModel; - reverbModel = NULL; - } - for (int i = 0; i < 9; i++) { if (parts[i] != NULL) { --- 548,551 ---- |
|
From: Jerome F. <kin...@us...> - 2009-06-05 23:56:55
|
Update of /cvsroot/munt/mt32emu/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv8519/src Modified Files: synth.cpp synth.h Log Message: - Added ReverbModel::reset(). Currently only used on open() - may be necessary elsewhere. Index: synth.cpp =================================================================== RCS file: /cvsroot/munt/mt32emu/src/synth.cpp,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** synth.cpp 5 Jun 2009 23:30:44 -0000 1.59 --- synth.cpp 5 Jun 2009 23:56:52 -0000 1.60 *************** *** 401,404 **** --- 401,405 ---- return false; Stk::setSampleRate(useProp.sampleRate); + reverbModel->reset(); reverbModel->setSampleRate(useProp.sampleRate); myProp = useProp; *************** *** 1309,1314 **** void FreeverbModel::setParameters(Bit8u mode, Bit8u time, Bit8u level) { // FIXME:KG: I don't think it's necessary to recreate freeverb's model... Just set the parameters. ! delete freeverb; ! freeverb = new revmodel(); switch (mode) { --- 1310,1314 ---- void FreeverbModel::setParameters(Bit8u mode, Bit8u time, Bit8u level) { // FIXME:KG: I don't think it's necessary to recreate freeverb's model... Just set the parameters. ! reset(); switch (mode) { *************** *** 1344,1346 **** --- 1344,1351 ---- } + void FreeverbModel::reset() { + delete freeverb; + freeverb = new revmodel(); + } + } Index: synth.h =================================================================== RCS file: /cvsroot/munt/mt32emu/src/synth.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** synth.h 5 Jun 2009 23:30:44 -0000 1.28 --- synth.h 5 Jun 2009 23:56:52 -0000 1.29 *************** *** 253,256 **** --- 253,257 ---- virtual void setParameters(Bit8u mode, Bit8u time, Bit8u level) = 0; virtual void process(const float *inLeft, const float *inRight, float *outLeft, float *outRight, long numSamples) = 0; + virtual void reset() = 0; }; *************** *** 263,266 **** --- 264,268 ---- void setParameters(Bit8u mode, Bit8u time, Bit8u level); void process(const float *inLeft, const float *inRight, float *outLeft, float *outRight, long numSamples); + void reset(); }; |
|
From: Jerome F. <kin...@us...> - 2009-06-05 23:30:47
|
Update of /cvsroot/munt/mt32emu/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv5810/src Modified Files: synth.cpp synth.h Log Message: - Added ReverbModel::setSampleRate(). Index: synth.cpp =================================================================== RCS file: /cvsroot/munt/mt32emu/src/synth.cpp,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** synth.cpp 5 Jun 2009 23:18:46 -0000 1.58 --- synth.cpp 5 Jun 2009 23:30:44 -0000 1.59 *************** *** 401,404 **** --- 401,405 ---- return false; Stk::setSampleRate(useProp.sampleRate); + reverbModel->setSampleRate(useProp.sampleRate); myProp = useProp; if (useProp.baseDir != NULL) { *************** *** 1298,1301 **** --- 1299,1306 ---- } + void FreeverbModel::setSampleRate(unsigned int sampleRate) { + // FIXME: We don't deal with this at all. + } + void FreeverbModel::process(const float *inLeft, const float *inRight, float *outLeft, float *outRight, long numSamples) { freeverb->processreplace(inLeft, inRight, outLeft, outRight, numSamples, 1); Index: synth.h =================================================================== RCS file: /cvsroot/munt/mt32emu/src/synth.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** synth.h 5 Jun 2009 23:18:46 -0000 1.27 --- synth.h 5 Jun 2009 23:30:44 -0000 1.28 *************** *** 250,253 **** --- 250,254 ---- public: virtual ~ReverbModel() {}; + virtual void setSampleRate(unsigned int sampleRate) = 0; virtual void setParameters(Bit8u mode, Bit8u time, Bit8u level) = 0; virtual void process(const float *inLeft, const float *inRight, float *outLeft, float *outRight, long numSamples) = 0; *************** *** 259,262 **** --- 260,264 ---- FreeverbModel(); ~FreeverbModel(); + void setSampleRate(unsigned int sampleRate); void setParameters(Bit8u mode, Bit8u time, Bit8u level); void process(const float *inLeft, const float *inRight, float *outLeft, float *outRight, long numSamples); |
|
From: Jerome F. <kin...@us...> - 2009-06-05 23:18:49
|
Update of /cvsroot/munt/mt32emu/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv3936/src Modified Files: synth.cpp synth.h Log Message: - Deprecated the reverb-related fields in SynthProperties in favour of setter/getter methods (with sensible defaults) in the Synth class. - Added a simple abstraction layer for the reverb model to help with experimentation. Index: synth.cpp =================================================================== RCS file: /cvsroot/munt/mt32emu/src/synth.cpp,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** synth.cpp 5 Jun 2009 22:01:35 -0000 1.57 --- synth.cpp 5 Jun 2009 23:18:46 -0000 1.58 *************** *** 105,108 **** --- 105,111 ---- isOpen = false; reverbModel = NULL; + reverbEnabled = true; + reverbOverridden = false; + setReverbModel(NULL); // Creates a default FreeverbModel partialManager = NULL; memset(parts, 0, sizeof(parts)); *************** *** 111,114 **** --- 114,118 ---- Synth::~Synth() { close(); // Make sure we're closed and everything is freed + delete reverbModel; } *************** *** 136,175 **** } ! void Synth::initReverb(Bit8u newRevMode, Bit8u newRevTime, Bit8u newRevLevel) { ! // FIXME:KG: I don't think it's necessary to recreate the reverbModel... Just set the parameters ! if (reverbModel != NULL) ! delete reverbModel; ! reverbModel = new revmodel(); ! switch (newRevMode) { ! case 0: ! reverbModel->setroomsize(.1f); ! //reverbModel->setdamp(.75f); ! reverbModel->setdamp(1.0f); ! break; ! case 1: ! reverbModel->setroomsize(.5f); ! //reverbModel->setdamp(.5f); ! reverbModel->setdamp(1.0f); ! break; ! case 2: ! reverbModel->setroomsize(.5f); ! //reverbModel->setdamp(.1f); ! reverbModel->setdamp(1.0f); ! break; ! case 3: ! reverbModel->setroomsize(1.0f); ! //reverbModel->setdamp(.75f); ! reverbModel->setdamp(1.0f); ! break; ! default: ! reverbModel->setroomsize(.1f); ! //reverbModel->setdamp(.5f); ! reverbModel->setdamp(1.0f); ! break; ! } ! reverbModel->setdry(1); ! reverbModel->setwet((float)newRevLevel / 5.0f); ! reverbModel->setwidth((float)newRevTime / 6.0f); } --- 140,172 ---- } ! void Synth::setReverbModel(ReverbModel *reverbModel) { ! delete this->reverbModel; ! if(reverbModel == NULL) ! reverbModel = new FreeverbModel(); ! this->reverbModel = reverbModel; ! if(isOpen) ! setReverbParameters(mt32ram.system.reverbMode, mt32ram.system.reverbTime, mt32ram.system.reverbLevel); ! } ! void Synth::setReverbEnabled(bool reverbEnabled) { ! this->reverbEnabled = reverbEnabled; ! } ! ! bool Synth::isReverbEnabled() const { ! return reverbEnabled; ! } ! ! void Synth::setReverbOverridden(bool reverbOverridden) { ! this->reverbOverridden = reverbOverridden; ! } ! ! bool Synth::isReverbOverridden() const { ! return reverbOverridden; ! } ! ! void Synth::setReverbParameters(Bit8u mode, Bit8u time, Bit8u level) { ! if(reverbOverridden) ! return; ! reverbModel->setParameters(mode, time, level); } *************** *** 1064,1072 **** report(ReportType_newReverbLevel, &mt32ram.system.reverbLevel); ! if (myProp.useDefaultReverb) { ! initReverb(mt32ram.system.reverbMode, mt32ram.system.reverbTime, mt32ram.system.reverbLevel); ! } else { ! initReverb(myProp.reverbType, myProp.reverbTime, mt32ram.system.reverbLevel); ! } Bit8u *rset = mt32ram.system.reserveSettings; --- 1061,1065 ---- report(ReportType_newReverbLevel, &mt32ram.system.reverbLevel); ! setReverbParameters(mt32ram.system.reverbMode, mt32ram.system.reverbTime, mt32ram.system.reverbLevel); Bit8u *rset = mt32ram.system.reserveSettings; *************** *** 1173,1177 **** void Synth::doRender(Bit16s *stream, Bit32u len) { ! if (myProp.useReverb) { for (unsigned int i = 0; i < MT32EMU_MAX_PARTIALS; i++) { if (partialManager->shouldReverb(i)) { --- 1166,1170 ---- void Synth::doRender(Bit16s *stream, Bit32u len) { ! if (reverbEnabled) { for (unsigned int i = 0; i < MT32EMU_MAX_PARTIALS; i++) { if (partialManager->shouldReverb(i)) { *************** *** 1188,1192 **** m++; } ! reverbModel->processreplace(sndbufl, sndbufr, outbufl, outbufr, len, 1); m=0; for (unsigned int i = 0; i < len; i++) { --- 1181,1185 ---- m++; } ! reverbModel->process(sndbufl, sndbufr, outbufl, outbufr, len); m=0; for (unsigned int i = 0; i < len; i++) { *************** *** 1297,1299 **** --- 1290,1341 ---- } + FreeverbModel::FreeverbModel() { + freeverb = NULL; // Will be initialised with the first setParameters() call. + } + + FreeverbModel::~FreeverbModel() { + delete freeverb; + } + + void FreeverbModel::process(const float *inLeft, const float *inRight, float *outLeft, float *outRight, long numSamples) { + freeverb->processreplace(inLeft, inRight, outLeft, outRight, numSamples, 1); + } + + void FreeverbModel::setParameters(Bit8u mode, Bit8u time, Bit8u level) { + // FIXME:KG: I don't think it's necessary to recreate freeverb's model... Just set the parameters. + delete freeverb; + freeverb = new revmodel(); + + switch (mode) { + case 0: + freeverb->setroomsize(.1f); + //freeverb->setdamp(.75f); + freeverb->setdamp(1.0f); + break; + case 1: + freeverb->setroomsize(.5f); + //freeverb->setdamp(.5f); + freeverb->setdamp(1.0f); + break; + case 2: + freeverb->setroomsize(.5f); + //freeverb->setdamp(.1f); + freeverb->setdamp(1.0f); + break; + case 3: + freeverb->setroomsize(1.0f); + //freeverb->setdamp(.75f); + freeverb->setdamp(1.0f); + break; + default: + freeverb->setroomsize(.1f); + //freeverb->setdamp(.5f); + freeverb->setdamp(1.0f); + break; + } + freeverb->setdry(1); + freeverb->setwet((float)level / 5.0f); + freeverb->setwidth((float)time / 6.0f); + } + } Index: synth.h =================================================================== RCS file: /cvsroot/munt/mt32emu/src/synth.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** synth.h 24 May 2009 19:23:50 -0000 1.26 --- synth.h 5 Jun 2009 23:18:46 -0000 1.27 *************** *** 58,72 **** unsigned int sampleRate; ! // Flag to activate reverb. True = use reverb, False = no reverb bool useReverb; ! // True to use software set reverb settings, False to set reverb settings in ! // following parameters bool useDefaultReverb; ! // When not using the default settings, this specifies one of the 4 reverb types ! // 1 = Room 2 = Hall 3 = Plate 4 = Tap unsigned char reverbType; ! // This specifies the delay time, from 0-7 (not sure of the actual MT-32's measurement) unsigned char reverbTime; ! // This specifies the reverb level, from 0-7 (not sure of the actual MT-32's measurement) unsigned char reverbLevel; // The name of the directory in which the ROM and data files are stored (with trailing slash/backslash) --- 58,70 ---- unsigned int sampleRate; ! // Deprecated - ignored. Use Synth::setReverbEnabled() instead. bool useReverb; ! // Deprecated - ignored. Use Synth::setReverbOverridden() instead. bool useDefaultReverb; ! // Deprecated - ignored. Use Synth::setReverbParameters() instead. unsigned char reverbType; ! // Deprecated - ignored. Use Synth::setReverbParameters() instead. unsigned char reverbTime; ! // Deprecated - ignored. Use Synth::setReverbParameters() instead. unsigned char reverbLevel; // The name of the directory in which the ROM and data files are stored (with trailing slash/backslash) *************** *** 249,252 **** --- 247,266 ---- }; + class ReverbModel { + public: + virtual ~ReverbModel() {}; + virtual void setParameters(Bit8u mode, Bit8u time, Bit8u level) = 0; + virtual void process(const float *inLeft, const float *inRight, float *outLeft, float *outRight, long numSamples) = 0; + }; + + class FreeverbModel : public ReverbModel { + revmodel *freeverb; + public: + FreeverbModel(); + ~FreeverbModel(); + void setParameters(Bit8u mode, Bit8u time, Bit8u level); + void process(const float *inLeft, const float *inRight, float *outLeft, float *outRight, long numSamples); + }; + class Synth { friend class Part; *************** *** 291,295 **** MemParams mt32ram, mt32default; ! revmodel *reverbModel; float masterTune; --- 305,311 ---- MemParams mt32ram, mt32default; ! ReverbModel *reverbModel; ! bool reverbEnabled; ! bool reverbOverridden; float masterTune; *************** *** 309,313 **** bool loadPreset(File *file); - void initReverb(Bit8u newRevMode, Bit8u newRevTime, Bit8u newRevLevel); void doRender(Bit16s * stream, Bit32u len); --- 325,328 ---- *************** *** 362,365 **** --- 377,387 ---- void writeSysex(unsigned char channel, const Bit8u *sysex, Bit32u len); + void setReverbModel(ReverbModel *reverbModel); + void setReverbEnabled(bool reverbEnabled); + bool isReverbEnabled() const; + void setReverbOverridden(bool reverbOverridden); + bool isReverbOverridden() const; + void setReverbParameters(Bit8u mode, Bit8u time, Bit8u level); + // Renders samples to the specified output stream. // The length is in frames, not bytes (in 16-bit stereo, |
|
From: Jerome F. <kin...@us...> - 2009-06-05 22:55:51
|
Update of /cvsroot/munt/mt32emu/src/freeverb In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv32399/src/freeverb Modified Files: revmodel.h revmodel.cpp Log Message: - Input parameters to processreplace() are now const. Index: revmodel.cpp =================================================================== RCS file: /cvsroot/munt/mt32emu/src/freeverb/revmodel.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** revmodel.cpp 28 Nov 2004 08:12:39 -0000 1.1 --- revmodel.cpp 5 Jun 2009 22:55:40 -0000 1.2 *************** *** 74,78 **** } ! void revmodel::processreplace(float *inputL, float *inputR, float *outputL, float *outputR, long numsamples, int skip) { float outL,outR,input; --- 74,78 ---- } ! void revmodel::processreplace(const float *inputL, const float *inputR, float *outputL, float *outputR, long numsamples, int skip) { float outL,outR,input; Index: revmodel.h =================================================================== RCS file: /cvsroot/munt/mt32emu/src/freeverb/revmodel.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** revmodel.h 28 Nov 2004 08:12:39 -0000 1.1 --- revmodel.h 5 Jun 2009 22:55:40 -0000 1.2 *************** *** 18,22 **** void mute(); void processmix(float *inputL, float *inputR, float *outputL, float *outputR, long numsamples, int skip); ! void processreplace(float *inputL, float *inputR, float *outputL, float *outputR, long numsamples, int skip); void setroomsize(float value); float getroomsize(); --- 18,22 ---- void mute(); void processmix(float *inputL, float *inputR, float *outputL, float *outputR, long numsamples, int skip); ! void processreplace(const float *inputL, const float *inputR, float *outputL, float *outputR, long numsamples, int skip); void setroomsize(float value); float getroomsize(); |
|
From: Jerome F. <kin...@us...> - 2009-06-05 22:01:38
|
Update of /cvsroot/munt/mt32emu/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv25559/src Modified Files: synth.cpp Log Message: - Fixed broken code indentation. Index: synth.cpp =================================================================== RCS file: /cvsroot/munt/mt32emu/src/synth.cpp,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** synth.cpp 24 May 2009 19:23:50 -0000 1.56 --- synth.cpp 5 Jun 2009 22:01:35 -0000 1.57 *************** *** 1263,1298 **** void MemoryRegion::write(unsigned int entry, unsigned int off, const Bit8u *src, unsigned int len, bool init) const { ! unsigned int memOff = entry * entrySize + off; ! // This method should never be called with out-of-bounds parameters, ! // or on an unsupported region - seeing any of this debug output indicates a bug in the emulator ! if (off > entrySize * entries - 1) { ! synth->printDebug("write[%d]: parameters start out of bounds: entry=%d, off=%d, len=%d", type, entry, off, len); ! return; ! } ! if (off + len > entrySize * entries) { ! synth->printDebug("write[%d]: parameters end out of bounds: entry=%d, off=%d, len=%d", type, entry, off, len); ! len = entrySize * entries - off; ! } ! Bit8u *dest = getRealMemory(); ! if (dest == NULL) { ! synth->printDebug("write[%d]: unwritable region: entry=%d, off=%d, len=%d", type, entry, off, len); ! } ! for (unsigned int i = 0; i < len; i++) { ! Bit8u desiredValue = src[i]; ! Bit8u maxValue = getMaxValue(memOff); ! // maxValue == 0 means write-protected unless called from initialisation code, in which case it really means the maximum value is 0. ! if (maxValue != 0 || init) { ! if (desiredValue > maxValue) { ! synth->printDebug("write[%d]: Wanted 0x%02x at %d, but max 0x%02x", type, desiredValue, memOff, maxValue); ! desiredValue = maxValue; ! } ! dest[memOff] = desiredValue; ! } else if (desiredValue != 0){ ! // Only output debug info if they wanted to write non-zero, since a lot of things cause this to spit out a lot of debug info otherwise. ! synth->printDebug("write[%d]: Wanted 0x%02x at %d, but write-protected", type, desiredValue, memOff); } ! memOff++; } } } --- 1263,1299 ---- void MemoryRegion::write(unsigned int entry, unsigned int off, const Bit8u *src, unsigned int len, bool init) const { ! unsigned int memOff = entry * entrySize + off; ! // This method should never be called with out-of-bounds parameters, ! // or on an unsupported region - seeing any of this debug output indicates a bug in the emulator ! if (off > entrySize * entries - 1) { ! synth->printDebug("write[%d]: parameters start out of bounds: entry=%d, off=%d, len=%d", type, entry, off, len); ! return; ! } ! if (off + len > entrySize * entries) { ! synth->printDebug("write[%d]: parameters end out of bounds: entry=%d, off=%d, len=%d", type, entry, off, len); ! len = entrySize * entries - off; ! } ! Bit8u *dest = getRealMemory(); ! if (dest == NULL) { ! synth->printDebug("write[%d]: unwritable region: entry=%d, off=%d, len=%d", type, entry, off, len); ! } ! for (unsigned int i = 0; i < len; i++) { ! Bit8u desiredValue = src[i]; ! Bit8u maxValue = getMaxValue(memOff); ! // maxValue == 0 means write-protected unless called from initialisation code, in which case it really means the maximum value is 0. ! if (maxValue != 0 || init) { ! if (desiredValue > maxValue) { ! synth->printDebug("write[%d]: Wanted 0x%02x at %d, but max 0x%02x", type, desiredValue, memOff, maxValue); ! desiredValue = maxValue; } ! dest[memOff] = desiredValue; ! } else if (desiredValue != 0){ ! // Only output debug info if they wanted to write non-zero, since a lot of things cause this to spit out a lot of debug info otherwise. ! synth->printDebug("write[%d]: Wanted 0x%02x at %d, but write-protected", type, desiredValue, memOff); } + memOff++; } } + + } |
|
From: Jerome F. <kin...@us...> - 2009-05-28 23:21:40
|
Update of /cvsroot/munt/mt32emu/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv11612 Modified Files: partial.cpp Log Message: - Partials no longer notify of their own deactivation when already deactivated, fixing various screwups when the synth was reset (introduced with the recent poly priority changes). Index: partial.cpp =================================================================== RCS file: /cvsroot/munt/mt32emu/src/partial.cpp,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** partial.cpp 24 May 2009 21:35:58 -0000 1.67 --- partial.cpp 28 May 2009 23:21:37 -0000 1.68 *************** *** 65,68 **** --- 65,70 ---- void Partial::deactivate() { + if (!isActive()) + return; ownerPart = -1; if (poly != NULL) { |