diff --git a/public/octatrack-modules/tiempos/0.1.0-experimental.mwrm b/public/octatrack-modules/tiempos/0.1.0-experimental.mwrm new file mode 100644 index 000000000..a5bbb7e79 Binary files /dev/null and b/public/octatrack-modules/tiempos/0.1.0-experimental.mwrm differ diff --git a/sdk/catalog.json b/sdk/catalog.json index 40023a1f2..22e8c10c7 100644 --- a/sdk/catalog.json +++ b/sdk/catalog.json @@ -191,6 +191,11 @@ "id": "stem-rec", "version": "0.1.0-experimental", "addedAt": "2026-11-05T15:55:00Z" + }, + { + "id": "tiempos", + "version": "0.1.0-experimental", + "addedAt": "2026-10-30T12:00:00Z" } ] } diff --git a/sdk/octabam/modules/tiempos/LICENSE b/sdk/octabam/modules/tiempos/LICENSE new file mode 100644 index 000000000..f288702d2 --- /dev/null +++ b/sdk/octabam/modules/tiempos/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/sdk/octabam/modules/tiempos/README.md b/sdk/octabam/modules/tiempos/README.md new file mode 100644 index 000000000..e4a1f1c5a --- /dev/null +++ b/sdk/octabam/modules/tiempos/README.md @@ -0,0 +1,89 @@ +# Tiempos + +Version: 0.1.0-experimental · author: @imdantelo + +## Overview + +Tiempos shows the time left on all eight audio tracks on one screen. It is meant for playing long samples (whole tracks on Static machines) the way a DJ does: you see at a glance which track ends when, without opening each track's pages. + +Each track gets one 8-pixel row: + +| Area | What it shows | +| --- | --- | +| Track number | Filled: playing. Outline: loaded and stopped. Dotted: empty, or a machine with no length (Thru, Neighbor, Pickup). | +| Mark beside the number | The active track. | +| Bar | Solid: what is left to play. Thin line: what has played. A stop mark at the end. A track playing backwards (RATE below 0) has its solid part on the left. | +| Time left | Real time, m:ss. Flashes inverted in the last 30 seconds while the track plays. `--:--` while a playing track stands still (RATE 0). | +| Right column | Total length or time played, both at the current speed. | + +The time left is real time, not sample time. Tiempos measures how fast each voice's play position moves against the unit's 132 MHz timer, every half second. That speed already includes timestretch, repitch and project tempo changes, so a 126 BPM track in a 128 BPM project shows 7:22 left where the sample length alone would say 7:29. After a tempo change the figure settles within two seconds. With RATE below 0 the track plays backwards: Tiempos measures the speed with its direction, counts the time left to the start of the trim and the time played from the end, and a trig, which sends a reversed track back to the end, starts the count again. Tiempos does not need to know a sample's tempo or which slot a track uses. + +Tiempos only reads memory and draws. It takes no effect slot, adds no knob and changes nothing in the project. + +## Controls + +Tiempos has no knobs. While its screen shows: + +| Key | Action | +| --- | --- | +| CUE + MIDI | Open or close the screen. Tiempos takes this MIDI press, so the unit does not switch to MIDI tracks. | +| NO | Close the screen. | +| LEFT or RIGHT | Switch the right column between total length and time played. A notice names the column (TOTAL or ELAPSED) for one second. | +| SRC, AMP, LFO, FX1, FX2, BANK, PATTERN | Close the screen and reach the unit as usual. | +| A track key | Selects the track as usual; the screen stays. | +| The same track key twice within 0.4 s | Closes the screen. Both presses reach the unit, so it opens QUICK ASSIGN for that track, as a double press does on stock. | +| Everything else | Reaches the unit as usual: PLAY, STOP, REC, trig keys, encoders, the crossfader. The screen stays. | + +Closing the screen redraws the page that was underneath. + +## Usage + +Load whole tracks into Static slots on tracks 1 to 8 and start playback. Hold CUE and press MIDI from any page. Mix with the crossfader and the track keys as usual while the screen shows the time left. Close it with NO or CUE + MIDI when you need to edit, or press a track key twice to close it and open that track's QUICK ASSIGN. + +## Quick tutorial + +1. **Open it.** Load a sample on track 1, press PLAY, hold CUE and press MIDI. Row 1 shows a filled number, a bar and the time left. +2. **Read the speed.** Change the project tempo. Within two seconds the time left on track 1 changes with it; with timestretch on, a faster tempo leaves less time. +3. **Switch the column and close.** Press RIGHT: the notice says ELAPSED and the right column shows the time played. Press NO: the page you were on comes back. + +### What changes in a stock flow + +One stock gesture changes: + +- **What changes and for whom.** On stock, CUE + MIDI switches to the MIDI tracks, as MIDI alone does. With Tiempos installed it opens and closes the Tiempos screen instead, for everyone who has the module. +- **Why.** The screen has to open from any page with keys a DJ-style player reaches without looking. The MKI has no PROJ key, so CUE + PROJ is not available, and CUE + MIDI adds nothing on stock that MIDI alone does not do. +- **What you see and do differently.** To switch to the MIDI tracks, press MIDI without holding CUE. While the Tiempos screen shows, LEFT, RIGHT and NO act on it; every other key reaches the unit. +- **Turning it off.** Remove Tiempos from the module set. There is no setting. +- **Neighbouring flows checked** on the author's MKI with the Modwerk base 24a0ed57: with the screen open, PLAY, STOP, tempo changes and track keys act as on stock, and a double press of a track key closes Tiempos and opens stock QUICK ASSIGN. In the emulator (MKI panel, with and without the module): MIDI alone switches tracks; SRC closes the screen and the page is redrawn. Not checked on a unit: every other key while the screen is open. + +## Compatibility and limitations + +- USB only. Tiempos runs only on the Modwerk base, loaded over USB, on an Octatrack MKI or MKII with OS 1.40C. It uses the base's tick, draw, key and encoder events, and card firmware has no base, so card firmware cannot include it: take it out of a set before building card firmware. +- Changes one stock gesture: CUE + MIDI opens Tiempos instead of switching to the MIDI tracks (see [What changes in a stock flow](#what-changes-in-a-stock-flow)). +- Declares one UI claim, the gesture CUE + MIDI on every page (`key:CUE+MIDI`). LEFT, RIGHT and NO act on its own screen only while it shows, which no other module draws, so they are not declared. +- No effect slot, no DSP code, no stock-code sites. +- It reads each voice's play position (voice record + 0x44) and its trim start and end (+ 0x28, + 0x2c). On one MKI the totals of a whole Static, a trimmed Static and a Flex track matched the expected times, and followed a tempo change (reported by the author, see TESTING.md); the fields were not read directly on hardware. +- The voice copies the trim only when it starts, so a track that has not played since the project loaded shows as empty (dotted, `--:--`) until it plays. +- The time played and the total length count from the sample's trim start, so a trimmed sample shows its trimmed length. +- A looping track shows the time to the end of the sample, not to the end of the loop. +- A track playing backwards shows as empty once it reaches the start: the unit clears its voice there, as when a forward track ends. +- With RATE 0 the unit does not start a track from a stopped transport (stock behaviour); Tiempos shows it as loaded and stopped. +- Until a track has played for half a second, its time is shown at the sample's original speed. + +## Tests and measurements + +See [TESTING.md](TESTING.md). Host tests pass 24/24. On the author's MKI with the Modwerk base 24a0ed57 (and 9b3ba417 for the published package's install, Keep, power cycle and Undo), over USB: totals, time left, elapsed time, the last-30-seconds flash, retriggers and tempo changes checked against a stopwatch; reverse playback (RATE below 0) counted down to the start of the trim; an install with Keep survived a power cycle and Undo removed it; the base's LOAD page showed no CPU or DSP change with the screen open or closed. Package: 2,588 bytes of code and data and 304 of state. The draw cost was measured in the emulator only (about 0.3 ms a UI tick open); no static cycle bound. Not tested: an MKII, Part changes and project reloads with the screen open, timestretch modes other than NORMAL, other modules at the same time. + +## Authorship and licences + +Design, specification and screen layout by Diego Antelo Barba. Code written with Claude (Anthropic) for the author. GPL-3.0-or-later, see [LICENSE](LICENSE). The 3x5 font in `deck_font.h` is original. No Elektron firmware, extracted routines or tables. + +## Screens and audio + +Photographs of the developer's MKI LCD, cropped and turned to greyscale (30 October 2026, project at 140 BPM, three 64-bar tones on tracks 1-3). + +![Tiempos open just after PLAY](media/ot-tiempos-open.png) + +![The last 30 seconds flash; track 1 was retriggered](media/ot-tiempos-last-30s.png) + +Tiempos makes no sound, so it has no audio preview. diff --git a/sdk/octabam/modules/tiempos/TESTING.md b/sdk/octabam/modules/tiempos/TESTING.md new file mode 100644 index 000000000..e28b1a2ef --- /dev/null +++ b/sdk/octabam/modules/tiempos/TESTING.md @@ -0,0 +1,238 @@ +# Tiempos testing + +## Commands and exact revision + +Source: `sdk/octabam/modules/tiempos/` on branch `tiempos`, on Modwerk `main` at `246c3b41` (merged 7 November 2026, after #1231). Packages built with m68k-elf-gcc 16.2.0 (Homebrew), the same compiler as the pinned `modwerk-source-tools` image, which rebuilt the 26 October package byte for byte. + +```sh +# Published USB package: ABI 8, titled "tiempos" (#1231), written to public/octatrack-modules/tiempos/ and its row +npm run octatrack:module-packages +npm run octatrack:module-packages -- --check +# Development build (ABI 4, untitled). build.py names the module after the output file: keep it tiempos.mwrm +python3 -B sdk/runtime/loader/build.py sdk/octabam/modules/tiempos/tiempos.c -o tiempos.mwrm +# Host tests and the package check (simulated OS memory, simulated 132 MHz timer, 60 ticks a second) +python3 -B sdk/octabam/modules/tiempos/verify.py +``` + +| Package | Source | Bytes | SHA-256 | Where it ran | +| --- | --- | --- | --- | --- | +| `225a0170…` | before the double press | 2,336 (2,156 code and data, 268 BSS, 33 relocations) | `225a0170382915f749315e26f4dbf97d4e0c4a047bf85bd347fb0e1bbe35d53e` | emulator 26 October; MKI 28 and 30 October | +| `0506a245…` | with the double press on a track key | 2,444 (2,240 code and data, 272 BSS, 39 relocations) | `0506a24500c2aa175aede07bcf1cc1a4c5f215b23852b26518acad6ac9444aa7` | MKI 30 October (fourth trial, USB lifecycle, load trial) | + +| `8c886466…` | with reverse playback (RATE below 0) and RATE 0, development build (ABI 4) | 2,808 (2,588 code and data, 304 BSS, 43 relocations) | `8c886466b8ef7133e41f64c4e8e3e1c8c7388b2d514370ed0b2f588ce8bd5022` | MKI 2 November (reverse trial) | +| `0b54a734…` | the same source, published by `octatrack:module-packages` as ABI 8 named "tiempos" (current) | 2,852 | `0b54a734258945acbf74551b8920ee4bfa760d390964bd04d2877e4382e990b9` | MKI 7 November (USB lifecycle on base `9b3ba417…`) | + +Hook words of `0506a245…`: `module_tick` 0x1ca, `module_draw` 0x2d0, `module_key` 0x6e6, `module_enc` 0x81e; none after the core four. + +## Host results + +24 of 24 pass on `8c886466…`, no compiler warnings (`-Werror`). The simulated voice goes backwards as on the MKI: its position falls and stays at the frame before the trim start (-1 for a trim at 0). Times are checked pixel for pixel against the font: + +| Check | Result | +| --- | --- | +| Closed: the stock frame is left untouched | pass | +| CUE + MIDI opens and takes the MIDI press | pass | +| Measured speed of a 126 BPM sample in a 128 BPM project: 44100 × 128/126 frames a second, error under 0.2 % | pass | +| Playing track: filled number | pass | +| Active-track mark | pass | +| Loaded, stopped track whose trim starts at 10 s: outline | pass | +| Empty track: dotted number | pass | +| Empty track: `--:--` | pass | +| Last 30 seconds (trim from 30 s): the time flashes | pass | +| Tempo change to 132 BPM: new speed within 2 s | pass | +| Flex loop retriggered five times: times still shown | pass | +| PLAY reaches the unit | pass | +| SRC closes the screen and the unit redraws its page | pass | +| Track key T3 twice, 500 ms apart: both reach the unit, the screen stays | pass | +| T4, then T3 200 ms later: both reach the unit, the screen stays | pass | +| T3 twice within 250 ms: both reach the unit, the screen closes and the unit redraws | pass | +| RATE turned from positive to negative while T1 plays: negative speed within 2 s | pass | +| Backwards: the time left is the time to the trim start | pass | +| Backwards: the total does not change | pass | +| Backwards: the solid part of the bar is on the left | pass | +| A reversed track retriggered (jumps to the end): still measured backwards | pass | +| A reversed track retriggered: the time left counts again from the end | pass | +| Backwards, at the trim start (position -1): 0:00, not flashing | pass | +| RATE 0 (active, not moving): `--:--` in the time left and the total | pass | + +## Emulator results + +Emulator evidence only: executed code paths, not timing, audio or hardware behaviour. + +Setup, 26 October 2026: `ot_emu` from octabam `dcf93d3`, adapted by `scripts/octatrack-emulator/build.py`; MKI panel (the default); a development base built from the developer's own OS 1.40C file (`build_core.py --dsp-loader --site-events --cached-modules --dev`, base `6a44c813…`); a scratch card with one set and a 120 s, 44.1 kHz stereo test tone (5,292,000 frames) on track 1's Static slot 1, one trig on step 1; the package above installed over the emulated USB link with `npm run device -- serve --emulator` and `scripts/device-send.py`. + +| What | Result | +| --- | --- | +| Install, trial and Keep of the package | accepted | +| Voice record of track 1 while playing (`mem:0x800049d8:168`) | +0x00 = 0xff (active); +0x28 = 0 and +0x2c = 5,292,000 (the trim region STORAGE.md §4 describes); +0x34 and +0x3c also 5,292,000; **+0x30 = 0**; +0x44 grows while it plays (0xb9af → 0xcdb9 over one read) | +| CUE + MIDI | opens the screen; the unit does not switch to MIDI tracks (the only declared UI claim, `key:CUE+MIDI`) | +| Screen, stopped and playing | track 1 outlined (stopped) or filled (playing), bar, time left and total; tracks 2-8 dotted with `--:--` | +| RIGHT, LEFT | the ELAPSED and TOTAL notices; the right column switches | +| SRC | closes; the PLAYBACK page is redrawn | +| CUE + MIDI again | closes | +| Removal | accepted; afterwards CUE + MIDI switches to MIDI tracks as on stock | +| Measured speed in the emulator | about 41,400 frames a second (module test value 0xa1a6), so a total of 2:07 for the 2:00 tone. The emulator's audio clock and its 132 MHz timer are not in the hardware's ratio, so this says nothing about a unit; the stopwatch check below decides it. | + +### Three tracks at different original tempos + +Same setup, a card with three mono 44.1 kHz test tones, each 64 bars of 4/4 (256 beats): `T100.WAV` 6,773,760 frames (153.6 s at 100 BPM) on track 1, `T120.WAV` 5,644,800 frames (128 s) on track 2, `T140.WAV` 4,838,400 frames (109.7 s) on track 3, each loaded through the stock browser (no `.ot` file: the firmware gives a tempo from the length, and TIMESTRETCH NORMAL), one trig on step 1 of each. Package `225a0170…` above. + +Each original tempo was checked from the voices themselves: between two reads of `mem:0x800049d8:504` in one pattern cycle, the play positions (+0x44) advanced in the ratio 1.2000 : 1.0000 : 0.8572 at 120 BPM and again at 140 BPM, which is 100, 120 and 140 BPM against the project tempo. 64 bars last 128 s at 120 BPM and 109.7 s at 140 BPM, whatever the sample's own tempo, so all three tracks should show the same times; the sample lengths alone would say 2:33, 2:08 and 1:49. + +| Project tempo | Expected total | Shown total (T1, T2, T3) | Expected time left at the read | Shown time left | +| --- | --- | --- | --- | --- | +| 120 BPM | 2:08 (128.0 s) | 2:07, 2:07, 2:07 | 2:07 | 2:07, 2:07, 2:07 | +| 140 BPM (raised with TEMPO and LEVEL while playing) | 1:49 (109.7 s) | 1:49, 1:49, 1:49 | 1:48 (T1: (6,773,760 − 99,393) / (44,100 × 140/100) = 108.1 s) | 1:47, 1:47, 1:48 | + +Every figure is within one second of the expected value (the display truncates to whole seconds, and the emulator's clock is not the unit's). Reopened right after the tempo change, the totals already read 1:49, because Tiempos keeps measuring while closed. The one trig per pattern retriggers each track every 16 steps, so these runs show a few seconds of each sample, never a track running out; the last-30-seconds flash, a track reaching its end and minutes-long accuracy are not tested here. Captures, kept outside Git: the 120 BPM screen, the TEMPO popup, the 140 BPM screen right after reopening and later, and the ELAPSED column. + +The draft first read the sample end at voice +0x30, which the emulator shows is 0 on a playing Static voice; it now reads the trim start (+0x28) and end (+0x2c) and measures time played and total from the trim start. + +## Base on the unit + +Hardware results below come from the developer's Octatrack MKI, OS 1.40C, running a Modwerk base built and installed from a local `npm run dev` checkout of this branch (owner, #953). + +| What | Value | +| --- | --- | +| Unit | Octatrack MKI | +| OS the base was built from | 1.40C (developer's own `OCTATRACK_OS1.40C.bin`, SHA-256 `34695b60…99e1ad`, the file the site requires) | +| Checkout | branch `tiempos`, commit `976c6caf` (`npm run dev`, Vite 8.3.1, Node 24.22.1) | +| Base file | `Modwerk-octatrack-base-739c9d.bin`, 766,404 bytes, SHA-256 `739c9d4f…42259c89`, built in Chrome from the site's Setup page, 28 October 2026 | +| Base identity (as the unit reports it) | `24a0ed5729add7c3…` over USB (`npm run device -- status`), equal to `sdk/machines/octatrack/base-binding.json`; state normal, generation 0, no modules, no trial. A released base: it does not answer development requests (`mem`, `ui`, keys) | +| Installed | 28 October 2026, from the card (PROJECT → SYSTEM → OS UPGRADE). Reported by the developer: it starts, PROJECT shows MODWERK, the project loads and plays normally | + +## First session on the MKI (28 October 2026, base `24a0ed57…`, reported by the developer unless marked read) + +| What | Result | +| --- | --- | +| Base over USB | read: `OCTATRACK 1.40C`, base `24a0ed5729add7c3…`, normal, no modules | +| Trial of package `225a0170…` (`npm run device -- try … --seconds 1200`, not accepted) | read: running, UI ticks about 60 a second; ended after about 7.5 minutes with SIGINT, rolled back (generation 2, bare base) | +| CUE + MIDI, transport stopped | Tiempos opens; the unit does not switch to MIDI tracks (photo) | +| Rows with tracks 1-3 loaded (Static `T120.WAV`, Static `T120.WAV` trimmed 720,000-4,004,800, Flex `T100.WAV`), never played | all eight rows dotted with `--:--`; the active-track mark beside 2. Expected from the code: the voice's trim fields are filled only when a voice starts | +| PLAY | the sequencer stays on step 1, nothing sounds, with Tiempos open, closed, and after its rollback; with the USB session closed too. Not a Tiempos fault, cause not found; no project has played on this base on this unit | + +Not tested: playback, the voice fields, LEFT/RIGHT, NO, timing, Flex. + +The unit's own log (`npm run device -- do diaglog`, read after the trial), all in boot 1, so no power cycle since the install: at +431 s a `hot` incident, CPU 100 % with the transport stopped, tempo 120; then **stall record 1, reason 1 (DSP frames stopped) at UI tick 33,032**, about 550 s after the start. From the tick count at the first USB read, that is about 20:49, when the developer was in USB DISK MODE copying the test samples, before the Tiempos trial (about 20:57). The later five-minute records show 0-18 of 600 frames playing. The stall, not Tiempos, is the likely reason PLAY stays on step 1; whether USB DISK MODE caused it is not shown. After a power cycle (no USB DISK MODE since), PLAY runs the sequencer again (reported). The developer reports that this unit hangs after leaving USB DISK MODE; the developer reports it did so on the stock OS too, before the base. Also run by mistake that evening: `npm run device -- lifecycle`, which keeps and removes the base's test modules; the unit was left with no module (active identity `1030e7c9…`, the empty set). + +## Second trial on the MKI (28 October 2026, 22:01, base `24a0ed57…`, package `225a0170…`, not accepted; reported by the developer) + +After the power cycle, project `tiempos` at 120 BPM, trigs with condition 1ST on step 1 of tracks 1-3, a phone stopwatch started with PLAY. + +| What | Expected | Reported | +| --- | --- | --- | +| Track 1, Static `T120.WAV`, whole | total 2:08 | matches ("cuadra"), plays and sounds | +| Track 2, Static `T120.WAV` trimmed 720,000-4,004,800 (74.5 s) | total 1:14 | matches | +| Track 3, Flex `T100.WAV`, timestretch | total 2:08 (2:33 without) | matches | +| Last 30 seconds | time left flashes inverted | flashes | +| RIGHT, LEFT | ELAPSED and TOTAL notices, right column switches | works | +| NO | closes; the page underneath comes back | closes, the normal page comes back | +| T1, T3 with the screen open | the active-track mark moves to that row | moves | +| Tempo raised to 140 BPM while playing | totals 1:49, 1:03, 1:49 within about 2 s | changes correctly | + +Exact stopwatch figures at each track's end were not written down; "matches" is the developer's word. Not tested: minutes-long accuracy beyond one play of each sample, timestretch modes, Part changes and project reloads, a Keep and persistence across a power cycle, performance. The voice fields (+0x28, +0x2c, +0x44) were not read directly (released base, no `mem`): the totals of the whole, trimmed and Flex tracks are the indirect check. + +## Third trial on the MKI (30 October 2026, 19:29-19:59, base `24a0ed57…`, package `225a0170…`, not accepted; reported by the developer, photos checked) + +Project `tiempos`, samples as the developer later confirmed them: track 1 `T100.WAV`, track 2 `T120.WAV` **without** the trim this time (the trim was checked on 28 October), track 3 `T140.WAV`. Tiempos' own reading of track 1's speed agrees: 61,742 frames a second at 140 BPM (read over USB as the module's test value, 0xf12e), which is 44,100 × 140/100. The earlier sessions' notes named the samples differently (track 1 `T120.WAV`, track 3 Flex `T100.WAV`); the 28 October reading of 52,922 frames a second at 120 BPM (0xceba) is also 44,100 × 120/100, so track 1 most likely held `T100.WAV` then too. All three tones are 64 bars, so the expected totals are the same either way. The trial ended by its own timer and rolled back (read: generation 2, bare base). Photos are kept outside Git. + +| What | Expected | Reported | +| --- | --- | --- | +| 120 BPM, all three tracks | total 2:08, all three end together | the three lasted the same and matched 2:08; stopwatch time not written down | +| 140 BPM, tempo set while stopped, then PLAY | totals 1:49 | 1:49 on all three (photo) | +| 140 BPM, stopwatch 0:24.28 (lap 0:24.25) | time left about 1:24-1:25, elapsed about 0:24-0:25 | 1:25 left and 0:24 ELAPSED on all three (photo). The stopwatch started 1-2 s after PLAY: at 0:00 the screen already showed 1:48 left (photo) | +| Last 30 seconds | flashes | tracks 2 and 3 inverted at stopwatch 1:22 (photo) | +| Track 1 retriggered by hand with a trig at about 0:48 | counts again from the start | 1:15 left at stopwatch 1:22 (photo), as expected from a restart about 34 s earlier | +| Track 3 (Flex, LOOP on) reaching its end | starts again | restarted by itself; what Tiempos showed at that moment was not noted | + +At 0:24 the screen's elapsed time (0:24, left 1:25 of 1:49) trails the stopwatch-based estimate (0:25-0:26) by up to about a second; the start of the stopwatch is only known to 1-2 s, and the display truncates to whole seconds. + +## Fourth trial on the MKI (30 October 2026, from 20:07, base `24a0ed57…`, package `0506a245…`, not accepted; reported by the developer, one photo) + +| What | Expected | Reported | +| --- | --- | --- | +| STOP, tempo 140, PLAY | stock: playback resumes where it stopped until a trig restarts the track | as stock | +| T2 once, screen open | the track is selected, the screen stays | selected, the screen stays | +| T3 twice quickly | the screen closes; both presses reach the unit | Tiempos closes and stock's QUICK ASSIGN opens on track 3's Flex slot list (photo): the stock double press, which both presses reach. Kept on purpose (the developer's choice): no stock gesture changes | +| T1, about a second, T1 | the screen stays | stays | + +Not reported in this trial: the totals at 140 BPM after PLAY. + +## USB lifecycle on the MKI (30 October 2026, base `24a0ed57…`, package `0506a245…`) + +| Step | Result | +| --- | --- | +| Install with Keep (`npm run device -- try … --seconds 10 --accept`) | read: 10 s trial, accepted; generation 5, active `0506a24500c2aa17…` | +| Power cycle (the developer) | read: the boot's log records the saved set restored with one module, `31282ae5` (Tiempos), 5 s after the start (`set a=1 [31282ae5]`); `status` then reports the bare base identity, as the base does after a restore until the next sync. Reported: the project plays and CUE + MIDI opens Tiempos | +| Undo (`npm run device -- remove … --accept`) | read: accepted, slot empty; generation 1, active `75b95b9e…` (the empty set) | + +Not tested: a power cycle after the Undo, the site's guided sync, a set with other modules beside Tiempos. + +## Load on the MKI (30 October 2026, the base's MODWERK > LOAD page, reported by the developer, one photo) + +| Condition | Working now: CPU | Working now: tracks 1-4 | Working now: tracks 5-8 | DSP space used: tracks 1-4 / 5-8 | +| --- | --- | --- | --- | --- | +| Tiempos installed, closed, stopped | 45 % | 33 % | 42 % | 32 % / 37 % | +| Tiempos installed, just closed after being open, playing (photo) | 52 % | 33 % | 42 % | 32 % / 37 % | +| Tiempos removed, stopped | 45 % | 33 % | 42 % | 32 % / 37 % | +| Tiempos removed, playing | 53 % | 33 % | 42 % | 32 % / 37 % | +| No Tiempos, three tracks playing (peak) | 64 % | 33 % | 42 % | 32 % / 37 % | +| Tiempos in trial (`0506a245…`), three tracks playing, open for about a minute, read on LOAD just after closing | 62 % | 33 % | 42 % | 32 % / 37 % | + +Closed, Tiempos adds no load the page shows. The base's five-minute record for the first minutes after the power cycle (Tiempos installed, including the boot and the set's restore) reads CPU 45.5 % mean, 94.9 % peak and a UI tick gap of 1,901 frames; the boot is the likely cause, not separated here. Open, it stays within the stock range: 62 % read just after closing against a 64 % peak without Tiempos, with three tracks playing (LOAD cannot be shown while Tiempos holds the screen). During that trial the base's tick count grew 60 per second without gaps and Tiempos measured T1 at 0xf12c–0xf136 frames per second, as on 30 October. The base's five-minute records agree: minutes 15–20 (no Tiempos, three tracks) CPU 51.3 % mean / 64.7 % peak, tick gap 69 frames, playing 261/600; minutes 20–25 (mostly the trial, Tiempos opened and closed) 51.1 % / 62.7 %, tick gap 63 frames, playing 228/600; tracks 1-4 and 5-8 unchanged at 32.7–32.8 % and 41.9 %. The trial rolled back by itself after 420 s (generation 3, active `75b95b9e…`); no new stall record. The 28 October records near 1.5 % CPU were taken while the DSPs were stalled and are no baseline. + +## Reverse playback on the MKI (2 November 2026, base `24a0ed57…`; reported by the developer, speeds read over USB) + +The owner asked in #1096 how Tiempos handles RATE below 0. On this MKI the highest RATE (the default) plays forward at normal speed, negative values play backwards, and 0 holds the voice still. + +**Package `0506a245…`, trial (not accepted).** Track 1 (Static, the 100 BPM tone at 120 BPM) with RATE -64 sounded from the end; row 1 read 0:00, then 99:59 left and 99:59 total at RATE -12. Tiempos took every backward step as a jump, so it kept no speed or kept a tiny forward one (34 frames a second), and counted towards the end of the sample. + +**Diagnostic package (trial only, not committed, built from this folder with `api->value` set to track 1's position).** Positions read once a second: + +| What the developer did | Track 1's position | +| --- | --- | +| RATE at its highest | +52,915 frames a second; a trig retriggers it backwards to the start | +| RATE below 0 while playing | -52,935 a second; at the start it stays at **-1** (signed) and the voice stays active | +| A trig on the reversed track | jumps forward to the end (6,764,698, or +370,425) and falls again | +| RATE -16 and -10 or so | -16,536 and -10,749 a second, steady | +| RATE 0 | the position does not move; from a stopped transport the voice does not start, sound or advance | +| Turning RATE | small steps both ways | + +**Package `8c886466…`, trial (not accepted).** Speeds Tiempos measured on track 1: -10,749 frames a second backwards (416-455 s), 0 at the start, +7,440 and +9,096 forwards after RATE changes; each change of direction settled within a second. Reported: backwards, row 1 counted down to 0:00 in step with the stopwatch; a trig on the reversed track restarted the count from the end; tracks 2 and 3 (Static forwards, Flex) as before. When the reversed track reached its start, the row turned empty (dotted number, `--:--`): the unit clears that voice's fields, as it does when a forward track ends. With RATE 0 from a stopped transport the track does not start, which is the unit's own behaviour (the diagnostic run showed the voice not advancing), and the row looked like a loaded, stopped track. The `--:--` for an active voice that does not move is covered by the host test only. + +The first attempt to load `8c886466…` was refused while the diagnostic trial still ran; a SIGINT to that trial did not confirm its rollback, so the session's `recover` request rolled it back (generation 6) before the load. Each trial ended with the bare base (generation 8 after the last). + +Not tested: a stopwatch figure for the reversed track, Flex and Static at other negative RATE values, reverse with timestretch modes other than NORMAL. + +## Published package on the current base (7 November 2026, MKI, package `0b54a734…`) + +The developer's unit had been flashed with a card build for a live set, so it had no base. A new base was built on the local site (`npm run dev` on branch `tiempos` at `70f472b9`, `main` merged; Setup → Install the base, from the developer's own OS 1.40C) as `Modwerk-octatrack-base-d9d29a.bin` and installed from the card with OS UPGRADE. Its SHA-256 was not recorded. Over USB it reports base `9b3ba41715140d5f…`, the identity in `sdk/machines/octatrack/base-binding.json`; normal, generation 0, inventory empty. + +| Step | Result | +| --- | --- | +| Install with Keep (`npm run device -- try public/octatrack-modules/tiempos/0.1.0-experimental.mwrm --seconds 10 --accept`) | read: accepted; generation 1, active `0b54a734…`; inventory `[{"module":"31282ae5","name":"tiempos"}]` | +| CUE + MIDI | reported: opens TIEMPOS, the time rows show | +| Power cycle (the developer) | read: the boot's log records the saved set restored with Tiempos 5 s after the start (`set a=1 [31282ae5]`), inventory still names "tiempos"; `status` reports the bare base identity after the restore. Reported: CUE + MIDI opens TIEMPOS again | +| Undo (`npm run device -- remove … --accept`) | read: accepted; generation 1, active `75b95b9e…` (the empty set), inventory empty | + +No stall in the two boots on this base. The log's earlier stall records belong to boots 9 and 10 on the old base `24a0ed57…`, before the firmware was changed; they follow a `hot` record at 100 % CPU, the trace an OS upgrade leaves (OCTATRACK_HARDWARE_TRAPS.md). + +Not tested on this base: the timing, reverse and load checks above, which ran on `24a0ed57…` with packages of the same source (`8c886466…` is `0b54a734…` before titling) or of earlier sources. + +## Hardware and audio quality + +Tiempos makes no sound. On the MKI with the released base `24a0ed57…` (above): CUE + MIDI, LEFT, RIGHT, NO, track keys and the double press as described; totals, time left, the last-30-seconds flash, a hand retrigger, trimmed and Flex tracks and tempo changes against the stopwatch and the expected 64-bar times; reverse playback with package `8c886466…` (above). The voice fields were not read directly (a released base answers no `mem` request): the totals are the indirect check. + +Not tested: an MKII; timestretch modes other than NORMAL; Part changes and project reloads with the screen open; minutes-long accuracy beyond one play of each 64-bar sample; SRC, AMP, LFO, FX1, FX2, BANK and PATTERN closing the screen on a unit (emulator only); a set with other modules beside Tiempos. + +## Stock flows + +On the unit, with Tiempos installed: PLAY, STOP, TEMPO and track keys behave as stock with the screen open; a double press of a track key closes Tiempos and the unit opens its own QUICK ASSIGN, as on stock. In the emulator: CUE + MIDI switches to MIDI tracks on stock and opens Tiempos with it installed, and again after removal. Not compared on a unit: every other key while the screen is open. + +## Performance and resources + +Package `8c886466…`: 2,588 bytes of code and data, 304 bytes of BSS (`0506a245…`: 2,240 and 272). The load figures above were taken with `0506a245…`; `8c886466…` adds a signed speed and a second bar shape, with the same pixel count per row. No DSP code, no effect slot, no DSP memory; the DSP load and space on LOAD are the same with and without it (above). ColdFire load: no change the LOAD page or the base's five-minute records show, closed or open (above). Cycles per tick not measured: the released base has no `modwerk_cost` profile. + +## OT UI capture evidence + +Development captures from the emulator's display read over USB are kept outside Git. Captures for the module page still have to be made with `scripts/capture-module-ui.py` or from the unit's LCD (docs/MODULE_UI_CAPTURES.md). diff --git a/sdk/octabam/modules/tiempos/deck_font.h b/sdk/octabam/modules/tiempos/deck_font.h new file mode 100644 index 000000000..71cb9f740 --- /dev/null +++ b/sdk/octabam/modules/tiempos/deck_font.h @@ -0,0 +1,87 @@ +/* SPDX-License-Identifier: GPL-3.0-or-later + * DECK: fuente propia de 3 x 5 px (avance de 4 px), solo mayúsculas. + * + * Por qué una fuente propia y no la del Octatrack: la fuente pequeña del OS + * (0x400ba876, "5 px capitals" según Octabam PANEL.md) tiene anchos por glifo + * que todavía no se han medido en la unidad. La columna de datos necesita + * exactamente 4 px por carácter (5 caracteres en 20 px), así que la vista DECK + * dibuja con esta fuente. Misma altura que la del OS: visualmente encaja. + * + * Cada glifo son 15 bits: 5 filas de 3, de arriba abajo; en cada fila el bit + * más alto es la columna izquierda. Índice = ASCII - 32 (de ' ' a '_'). + */ +#ifndef DECK_FONT_H +#define DECK_FONT_H +#include + +#define G(a, b, c, d, e) ((uint16_t)((a) << 12 | (b) << 9 | (c) << 6 | (d) << 3 | (e))) + +static const uint16_t deck_font[64] = { + /* ' ' */ 0, + /* '!' */ G(2, 2, 2, 0, 2), + /* '"' */ G(5, 5, 0, 0, 0), + /* '#' */ G(5, 7, 5, 7, 5), + /* '$' */ G(3, 6, 2, 3, 6), + /* '%' */ G(5, 1, 2, 4, 5), + /* '&' */ G(2, 5, 2, 5, 3), + /* ''' */ G(2, 2, 0, 0, 0), + /* '(' */ G(2, 4, 4, 4, 2), + /* ')' */ G(2, 1, 1, 1, 2), + /* '*' */ G(0, 5, 2, 5, 0), + /* '+' */ G(0, 2, 7, 2, 0), + /* ',' */ G(0, 0, 0, 2, 4), + /* '-' */ G(0, 0, 7, 0, 0), + /* '.' */ G(0, 0, 0, 0, 2), + /* '/' */ G(1, 1, 2, 4, 4), + /* '0' */ G(7, 5, 5, 5, 7), + /* '1' */ G(2, 6, 2, 2, 7), + /* '2' */ G(7, 1, 7, 4, 7), + /* '3' */ G(7, 1, 7, 1, 7), + /* '4' */ G(5, 5, 7, 1, 1), + /* '5' */ G(7, 4, 7, 1, 7), + /* '6' */ G(7, 4, 7, 5, 7), + /* '7' */ G(7, 1, 2, 2, 2), + /* '8' */ G(7, 5, 7, 5, 7), + /* '9' */ G(7, 5, 7, 1, 7), + /* ':' */ G(0, 2, 0, 2, 0), + /* ';' */ G(0, 2, 0, 2, 4), + /* '<' */ G(1, 2, 4, 2, 1), + /* '=' */ G(0, 7, 0, 7, 0), + /* '>' */ G(4, 2, 1, 2, 4), + /* '?' */ G(7, 1, 2, 0, 2), + /* '@' */ G(7, 5, 7, 4, 3), + /* 'A' */ G(2, 5, 7, 5, 5), + /* 'B' */ G(6, 5, 6, 5, 6), + /* 'C' */ G(3, 4, 4, 4, 3), + /* 'D' */ G(6, 5, 5, 5, 6), + /* 'E' */ G(7, 4, 6, 4, 7), + /* 'F' */ G(7, 4, 6, 4, 4), + /* 'G' */ G(3, 4, 5, 5, 3), + /* 'H' */ G(5, 5, 7, 5, 5), + /* 'I' */ G(7, 2, 2, 2, 7), + /* 'J' */ G(1, 1, 1, 5, 2), + /* 'K' */ G(5, 5, 6, 5, 5), + /* 'L' */ G(4, 4, 4, 4, 7), + /* 'M' */ G(5, 7, 7, 5, 5), + /* 'N' */ G(6, 5, 5, 5, 5), + /* 'O' */ G(2, 5, 5, 5, 2), + /* 'P' */ G(6, 5, 6, 4, 4), + /* 'Q' */ G(2, 5, 5, 6, 3), + /* 'R' */ G(6, 5, 6, 5, 5), + /* 'S' */ G(3, 4, 2, 1, 6), + /* 'T' */ G(7, 2, 2, 2, 2), + /* 'U' */ G(5, 5, 5, 5, 7), + /* 'V' */ G(5, 5, 5, 5, 2), + /* 'W' */ G(5, 5, 7, 7, 5), + /* 'X' */ G(5, 5, 2, 5, 5), + /* 'Y' */ G(5, 5, 2, 2, 2), + /* 'Z' */ G(7, 1, 2, 4, 7), + /* '[' */ G(6, 4, 4, 4, 6), + /* '\' */ G(4, 4, 2, 1, 1), + /* ']' */ G(3, 1, 1, 1, 3), + /* '^' */ G(2, 5, 0, 0, 0), + /* '_' */ G(0, 0, 0, 0, 7), +}; +#undef G + +#endif diff --git a/sdk/octabam/modules/tiempos/deck_keys.h b/sdk/octabam/modules/tiempos/deck_keys.h new file mode 100644 index 000000000..1b36ac0e8 --- /dev/null +++ b/sdk/octabam/modules/tiempos/deck_keys.h @@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: GPL-3.0-or-later + * DECK: códigos de tecla del Octatrack (OS 1.40C). + * + * Fuentes, que coinciden: + * - Modwerk status.c (probado en hardware, MKII): CUE 0x2a, PROJ 0x1c, NO 0x32. + * - Octabam docs/firmware/PANEL.md (sondeo bajo el port, corregido el 25 sep 2026: + * STOP es 0x27, no 0x2a): pistas 0x10..0x17, DOWN 0x20, RIGHT 0x21, páginas + * 0x22..0x26, STOP 0x27, PLAY 0x28, REC 0x29, CUE 0x2a, FUNCTION 0x2d, + * PATTERN 0x2e, BANK 0x2f, YES 0x31, NO 0x32, UP 0x33, LEFT 0x34, MIDI 0x35. + * - El código es fila·8 + bit en la MK1 y en la MKII; la tabla de la MK1 + * (0x400bfc10, 57 registros) no tiene 0x1c: la MK1 no tiene PROJ. + * + * Sin confirmar en una MK1 real: se comprueban con el sondeo de teclas del + * TESTING.md antes de calificar el módulo. Todo el módulo usa solo estas constantes. + */ +#ifndef DECK_KEYS_H +#define DECK_KEYS_H + +#define K_TRACK1 0x10 /* pistas 1..8 = 0x10..0x17 */ +#define K_TRACK8 0x17 +#define K_DOWN 0x20 +#define K_RIGHT 0x21 +#define K_SRC 0x22 /* páginas 0x22..0x26: SRC AMP LFO FX1 FX2 */ +#define K_FX2 0x26 +#define K_STOP 0x27 +#define K_PLAY 0x28 +#define K_REC 0x29 +#define K_CUE 0x2a +#define K_FUNC 0x2d +#define K_PATTERN 0x2e +#define K_BANK 0x2f +#define K_YES 0x31 +#define K_NO 0x32 +#define K_UP 0x33 +#define K_LEFT 0x34 +#define K_MIDI 0x35 + +/* Combinación para abrir y cerrar DECK: mantener CUE y pulsar MIDI. + * Motivo: en la MK1 no hay PROJ (Modwerk usa CUE + PROJ para su página de estado) + * y MIDI, que cambia entre pistas de audio y MIDI, no se usa al pinchar. DECK se + * queda la pulsación de MIDI, así que la máquina no cambia de modo. + * Cámbialo aquí si en tu flujo usas MIDI. */ +#define K_OPEN_MOD K_CUE +#define K_OPEN K_MIDI + +#endif diff --git a/sdk/octabam/modules/tiempos/evidence/performance.json b/sdk/octabam/modules/tiempos/evidence/performance.json new file mode 100644 index 000000000..aab175549 --- /dev/null +++ b/sdk/octabam/modules/tiempos/evidence/performance.json @@ -0,0 +1,30 @@ +{ + "schema": 1, + "module": "tiempos", + "version": "0.1.0-experimental", + "kind": "coldfire", + "cycles": { + "unit": "cycles/event", + "static": null, + "measured": 1133300, + "budget": 4330000, + "method": "An event is one composed screen frame while Tiempos is open: module_draw clears and redraws the 128x64 frame on the UI task, not in an interrupt; closed it returns at once. Emulator, not hardware: ot_emu (octabam dcf93d3, adapted by scripts/octatrack-emulator/build.py), MKI panel, development base 6a44c813 (26 Oct 2026), package 0506a245, 30 Oct 2026. The base's modwerk_cost read twice 10 s apart: runtime module draw [22] 12.5 us a tick with no module, 18.8 us installed and closed, 260.6 us open and stopped, 314.6 us open and playing, with all eight rows empty in that project; runtime tick [1] 15.0 us with no module, 16.1-17.9 us with Tiempos (all eight voices read every tick, open or closed). Worst case estimated, not measured: the host build counts 341 pixel writes a draw for eight empty rows and 4,653 for eight playing rows in their last 30 s (the dearest layout), and 314.6 x 4,653 / 341 = 4,293 us, 1,133,300 cycles at 264 MHz; this scales the whole draw, frame clear included, by the pixel count, so it overstates. No static bound. Budget: one UI tick, 16.4 ms at 61 ticks a second (4,330,000 cycles). On the developer's MKI (released base 24a0ed57, which has no modwerk_cost) the CPU on MODWERK > LOAD read 62 % just after a minute open with three tracks playing, against a 64 % peak without Tiempos, and the base's five-minute records read 51.1 % mean / 62.7 % peak with the trial against 51.3 % / 64.7 % without it (TESTING.md)." + }, + "load": { + "frameUs": 362.8, + "stockLongestUs": null, + "moduleLongestUs": null, + "stockIdlePercent": null, + "moduleIdlePercent": null, + "method": "No cfmeter.py capture and no frame-guard reading: the developer's MKI runs the released base 24a0ed57, which answers no development request. Tiempos adds nothing to the frame interrupt (it has no frame, MIDI or DSP hook: only the core's tick, draw, key and encoder hooks on the UI task). On that unit, the base's MODWERK > LOAD page and five-minute records, three tracks playing: CPU 51.3 % mean / 64.7 % peak without Tiempos (minutes 15-20), 51.1 % / 62.7 % with Tiempos in trial and opened for about a minute (minutes 20-25); DSP load tracks 1-4 / 5-8 32.7-32.8 % / 41.9 % and DSP space 32 % / 37 % in both; the UI tick gap 69 frames without, 63 with." + }, + "stress": { + "floodMessagesPerSecond": null, + "clockBpm": null, + "seconds": null, + "stuckNotes": null, + "hangs": null, + "dropped": null, + "droppedExplanation": "No MIDI flood ran: Tiempos has no MIDI path and nothing on this Mac sends MIDI. Instead three tracks played for about seven minutes with the screen opened and closed, tempo changes and retriggers, on the developer's MKI: the base's tick count grew 60 a second without a gap and no stall was recorded (TESTING.md)." + } +} diff --git a/sdk/octabam/modules/tiempos/manifest.py b/sdk/octabam/modules/tiempos/manifest.py new file mode 100644 index 000000000..bcc086fcc --- /dev/null +++ b/sdk/octabam/modules/tiempos/manifest.py @@ -0,0 +1,17 @@ +"""TIEMPOS: the time left on all eight audio tracks, on one screen behind CUE + MIDI. + +A C runtime module (tiempos.c) on the base's four core hooks (module_tick, module_draw, module_key, module_enc). +It reads each voice's play position and trim, measures how fast the position moves against the 132 MHz timer and +draws its own screen; the package holds no stock-code site. It has no card form: its USB package is built from its +row in src/engine/assets/octatrack-module-packages.json, and verify.py checks it. +""" +from remix.schema import Category, Proof, Gate, Kind, Module + +MODULE = Module( + name="tiempos", key="TIEMPOS", kind=Kind.CF_PATCH, + doc="The time left on all eight audio tracks, measured from how fast each voice plays.", + category=Category.TRACK, author="imdantelo", author_url="https://github.com/imdantelo", + proof=Proof.UNTESTED, + proof_note="USB package only; host and package checks in verify.py, hardware results in TESTING.md.", + gates=(Gate("modules/tiempos/verify.py", remix_arg=False),), +) diff --git a/sdk/octabam/modules/tiempos/media/ot-tiempos-last-30s.png b/sdk/octabam/modules/tiempos/media/ot-tiempos-last-30s.png new file mode 100644 index 000000000..c87e74264 Binary files /dev/null and b/sdk/octabam/modules/tiempos/media/ot-tiempos-last-30s.png differ diff --git a/sdk/octabam/modules/tiempos/media/ot-tiempos-open.png b/sdk/octabam/modules/tiempos/media/ot-tiempos-open.png new file mode 100644 index 000000000..1e6d8e4ca Binary files /dev/null and b/sdk/octabam/modules/tiempos/media/ot-tiempos-open.png differ diff --git a/sdk/octabam/modules/tiempos/octamod.module.json b/sdk/octabam/modules/tiempos/octamod.module.json new file mode 100644 index 000000000..1e46524d4 --- /dev/null +++ b/sdk/octabam/modules/tiempos/octamod.module.json @@ -0,0 +1,238 @@ +{ + "schemaVersion": 2, + "id": "tiempos", + "key": "TIEMPOS", + "name": "Tiempos", + "version": "0.1.0-experimental", + "category": "system", + "author": { + "github": "imdantelo", + "credits": [ + "Diego Antelo Barba (design and specification)" + ] + }, + "nativeManifest": "manifest.py", + "presentation": { + "label": "TIME LEFT", + "family": "Display", + "summary": "One screen with the time left on all eight tracks, for playing long samples like a DJ.", + "overview": "Hold CUE and press MIDI to show every track on one screen: a bar of what is left to play, the real time left and the total length. The time left is measured from how fast each voice really plays, so it follows timestretch, repitch and tempo changes. It only reads and draws: no effect slot, no knob, and nothing in the project changes.", + "highlights": [ + "Time left for all eight tracks at once", + "Follows timestretch, repitch and tempo changes", + "The time left flashes in the last 30 seconds", + "Playback keys, track keys, encoders and the crossfader keep working while it shows" + ], + "usage": [ + "Hold CUE and press MIDI from any screen; do the same, or press NO, to close it.", + "LEFT or RIGHT switches the right column between total length and time played." + ] + }, + "controls": [], + "compatibility": { + "firmware": "1.40C", + "location": "Audio tracks", + "conflicts": [], + "uiClaims": [ + "key:CUE+MIDI" + ], + "limitations": [ + "Needs the Modwerk base over USB: it uses the base's draw and key events.", + "Tested on one MKI with the Modwerk bases 24a0ed57 and 9b3ba417 (install, Keep, power cycle and Undo of the published package). Not tested yet: an MKII, Part changes and project reloads with the screen open, timestretch modes other than NORMAL, and other modules installed at the same time.", + "CUE + MIDI no longer switches to MIDI tracks while Tiempos is installed; MIDI alone still does.", + "A track that loops shows the time left to the end of the sample, not to the end of the loop.", + "A track playing backwards (RATE below 0) shows as empty once it reaches its start: the unit clears the voice there.", + "Until a track has played for half a second, its time is shown at the sample's original speed.", + "Thru, Neighbor and Pickup tracks show no time." + ], + "effectId": null + }, + "resources": { + "recorded": "Developer's MKI, 30 Oct 2026; emulator 30 Oct 2026", + "storage": { + "label": "Storage", + "display": "2,892 bytes", + "value": 2892, + "unit": "bytes", + "method": "static", + "conditions": "From the USB package 8c886466: 2,588 bytes of ColdFire code and data and 304 of bss, one instance. No DSP memory, no heap, no card files.", + "source": "TESTING.md" + }, + "processing": { + "label": "CPU load", + "display": "No change on the unit's LOAD page, open or closed", + "value": null, + "unit": "unknown", + "method": "hardware", + "conditions": "Developer's MKI, released base, three tracks playing: CPU 62 % just after a minute with the screen open against a 64 % peak without Tiempos; the base's five-minute records 51.1 % mean with it, 51.3 % without; DSP load and space unchanged. In the emulator the open screen's draw took about 0.3 ms a UI tick with empty rows, estimated at most 4.3 ms with all eight rows playing.", + "source": "evidence/performance.json" + }, + "impact": { + "conditions": "The Tiempos screen open with tracks playing; closed, it only reads eight voice records each UI tick.", + "cpu": { + "level": "low", + "basis": "measured-comparison", + "rationale": "Only while its screen is open: no change on the MKI's LOAD page or in the base's five-minute records with three tracks playing. In the emulator the draw took about 0.3 ms a UI tick with empty rows; scaled by pixel count, at most 4.3 ms with eight playing rows, an overstatement. Closed, about 3 us a tick. Nothing in the frame interrupt.", + "source": "evidence/performance.json" + }, + "dsp": { + "level": "minimal", + "basis": "measured-comparison", + "rationale": "No DSP code. DSP load (33 % / 42 %) and DSP space (32 % / 37 %) read the same with and without Tiempos on the MKI.", + "source": "TESTING.md" + }, + "memory": { + "level": "minimal", + "basis": "source-estimate", + "rationale": "2,892 bytes of ColdFire code, data and state in DRAM, from the package header.", + "source": "TESTING.md" + } + } + }, + "tests": { + "report": "TESTING.md", + "summary": "On the developer's MKI (OS 1.40C, released base 24a0ed57) over USB, 28-30 Oct 2026: timed trials of the exact package 0506a245 and its predecessor showed the time left, totals and elapsed time of whole, trimmed and Flex tracks against a stopwatch at 120 and 140 BPM, the last-30-seconds flash, a retrigger, tempo changes the double press that closes it, and (package 8c886466) reverse playback with RATE below 0; a Keep survived a power cycle and Undo removed it; LOAD showed no CPU or DSP change. Host tests 24/24. Not run: an MKII, Part changes and reloads with the screen open, other modules beside it, a static cycle bound.", + "hardwareStatus": "reported", + "evidenceRevision": "b711e14055b6c46658a9a44ca0ff21580ead55f6", + "gates": [ + "modules/tiempos/verify.py" + ], + "qualification": { + "moduleVersion": "0.1.0-experimental", + "sourceSha256": "45e53efc39e6aba499d312e8e0b26995d2110a6657cbff8f06dc3aaaa9c1f035", + "imageSha256": "0b54a734258945acbf74551b8920ee4bfa760d390964bd04d2877e4382e990b9", + "cycles": [ + { + "processor": "coldfire", + "worstCase": 1133300, + "maxConfiguration": 1133300, + "maxInstances": 1, + "budget": 4330000, + "unit": "cycles/event", + "method": "emulator", + "conditions": { + "parameterExtremes": "Not applicable: no parameters. The dearest layout, eight playing rows in their last 30 s, is estimated from the host build's pixel count (4,653 writes against 341 for eight empty rows).", + "parameterModulation": "Not applicable: LEFT and RIGHT switch the right column; the draw cost does not depend on it.", + "modeSwitching": "Closed and open, stopped and playing, in the emulator; opened and closed while three tracks played on the MKI.", + "maxLoad": "One instance. The cost is the screen's draw on the UI task, once per composed frame while open; closed it draws nothing. Budget: one UI tick, 16.4 ms at 61 ticks a second, 4,330,000 cycles at 264 MHz.", + "inputConditions": "ot_emu with development base 6a44c813: modwerk_cost[22] (runtime module draw) 314.6 us a tick open and playing with eight empty rows, scaled by the pixel count to 4,293 us (1,133,300 cycles at 264 MHz), an overstatement. No static bound; not measured on hardware." + }, + "report": "evidence/performance.json" + } + ], + "memory": { + "regions": [ + { + "name": "ColdFire code and data (tiempos.c, deck_font.h, DRAM)", + "space": "sdram", + "words": 2588, + "wordBits": 8, + "bytes": 2588, + "scope": "shared" + }, + { + "name": "State (bss): eight track records, screen and key state", + "space": "sdram", + "words": 304, + "wordBits": 8, + "bytes": 304, + "scope": "shared" + } + ], + "perInstanceBytes": 0, + "sharedBytes": 2892, + "maxInstances": 1, + "totalBytes": 2892, + "conditions": "From the USB package 8c886466 (published titled as 0b54a734, 2,852 bytes) (2,588 bytes of code and data, 304 of bss, 43 relocations). Reads OS memory only; writes no stock code or data. No DSP memory, no heap. Stack use is the UI task's and was not measured.", + "report": "TESTING.md" + }, + "hardware": { + "kind": "functional", + "status": "reported", + "model": "MKI", + "testedOn": "2026-11-07", + "tester": "imdantelo", + "sourceRevision": "b711e14055b6c46658a9a44ca0ff21580ead55f6", + "imageSha256": "0b54a734258945acbf74551b8920ee4bfa760d390964bd04d2877e4382e990b9", + "summary": "The developer's MKI, OS 1.40C, released Modwerk base 24a0ed57 built from a local checkout, driven over USB by Claude Code. With package 0506a245: a timed trial (single and double presses of track keys, the stock QUICK ASSIGN after a double press), an install with Keep that survived a power cycle and opened with CUE + MIDI, an Undo back to the empty set, and a seven-minute trial with three tracks playing (CPU 62 % just after a minute open against a 64 % peak without it; DSP load and space unchanged; no stall). With the previous package 225a0170 (same timing code): totals 2:08 at 120 BPM and 1:49 at 140 BPM on three 64-bar tones at 100, 120 and 140 BPM, a trimmed Static and a Flex track, 1:25 left and 0:24 elapsed at stopwatch 0:24.28, the flash under 30 s and a hand retrigger. With package 8c886466 (reverse playback): a trial with track 1 at RATE below 0 counted down to 0:00 with the stopwatch, restarted from the end on a trig, measured -10,749 and +7,440 frames a second as RATE changed; tracks 2 and 3 as before. The install with Keep, power cycle and Undo were run with 0506a245, not repeated with 8c886466. With the published package 0b54a734 (the same source titled as ABI 8 by octatrack:module-packages), on a base rebuilt from current main (9b3ba417): install with Keep, the inventory naming it \"tiempos\", CUE + MIDI opening TIEMPOS, the set restored after a power cycle with TIEMPOS opening again, and Undo back to the empty set.", + "limitations": [ + "One MKI; no MKII.", + "The stopwatch figures come from the developer's photos and readings; the voice fields were not read directly (a released base answers no mem request).", + "Part changes, project reloads, timestretch modes other than NORMAL and other modules beside Tiempos were not run.", + "Draw cost estimated in the emulator, not measured on the unit; no static bound and no MIDI flood.", + "Reverse playback: one trial; no stopwatch figure written down for the reversed track; RATE 0 on an active voice covered by the host test only.", + "Timing, reverse and load checks ran on the earlier base 24a0ed57 with packages of the same or earlier sources; on base 9b3ba417 only the install, power cycle and Undo." + ], + "report": "TESTING.md" + }, + "documentation": { + "tutorial": { + "title": "Quick tutorial", + "steps": [ + "**Open it.** Load a sample on track 1, press PLAY, hold CUE and press MIDI. Row 1 shows a filled number, a bar and the time left.", + "**Read the speed.** Change the project tempo. Within two seconds the time left on track 1 changes with it; with timestretch on, a faster tempo leaves less time.", + "**Switch the column and close.** Press RIGHT: the notice says ELAPSED and the right column shows the time played. Press NO: the page you were on comes back." + ] + }, + "screenshots": [ + "media/ot-tiempos-open.png", + "media/ot-tiempos-last-30s.png" + ], + "screenshotStyle": "black-and-white" + } + } + }, + "license": { + "spdx": "GPL-3.0-or-later", + "file": "LICENSE", + "declaration": "Original code by the author, GPL-3.0-or-later. The 3x5 font is original. No Elektron firmware, extracted routines or tables." + }, + "media": [ + { + "path": "media/ot-tiempos-open.png", + "captureType": "hardware", + "caption": "Hold CUE and press MIDI from any page. Each row is one track: a filled number plays, an outlined one is loaded and stopped, a dotted one is empty. The bar shows what is left, then the time left and the total at the current tempo.", + "alt": "Tiempos screen on an Octatrack: tracks 1 to 3 with full bars, 1:48 left and 1:49 total each; tracks 4 to 8 dotted with --:--.", + "credit": "imdantelo; Elektron Octatrack UI", + "license": "LicenseRef-OT-UI-Documentation", + "source": "original", + "otUi": { + "page": "TIEMPOS", + "shows": "location-and-controls", + "firmware": "1.40C", + "moduleVersion": "0.1.0-experimental", + "imageSha256": "739c9d4f228d58bd542563d2d35ccb6f84828f0c87cd914c0505912e42259c89", + "setup": "Phone photograph of the LCD of the developer's Octatrack MKI (OS 1.40C, released Modwerk base 24a0ed57), cropped to the screen and not otherwise edited; three 64-bar test tones at 100, 120 and 140 BPM on tracks 1-3, project at 140 BPM, 30 October 2026. Taken with package 225a0170; package 0506a245 changes only key handling (the double press), and tiempos.c's drawing code is the same in both. Just after PLAY." + } + }, + { + "path": "media/ot-tiempos-last-30s.png", + "captureType": "hardware", + "caption": "In a track's last 30 seconds its time left flashes inverted. Track 1 was retriggered by hand, so it shows 1:15 left while tracks 2 and 3 are almost at the end. LEFT or RIGHT switches the last column between total and elapsed time.", + "alt": "Tiempos screen: track 1 at 1:15 left of 1:49; tracks 2 and 3 with their time left shown inverted; tracks 4 to 8 empty.", + "credit": "imdantelo; Elektron Octatrack UI", + "license": "LicenseRef-OT-UI-Documentation", + "source": "original", + "otUi": { + "page": "TIEMPOS", + "shows": "controls", + "firmware": "1.40C", + "moduleVersion": "0.1.0-experimental", + "imageSha256": "739c9d4f228d58bd542563d2d35ccb6f84828f0c87cd914c0505912e42259c89", + "setup": "Phone photograph of the LCD of the developer's Octatrack MKI (OS 1.40C, released Modwerk base 24a0ed57), cropped to the screen and not otherwise edited; three 64-bar test tones at 100, 120 and 140 BPM on tracks 1-3, project at 140 BPM, 30 October 2026. Taken with package 225a0170; package 0506a245 changes only key handling (the double press), and tiempos.c's drawing code is the same in both. At stopwatch 1:22, during the flash." + } + } + ], + "access": { + "location": "Any screen: hold CUE and press MIDI.", + "steps": [ + "Install Tiempos with the Modwerk base over USB.", + "Load samples on some tracks and press PLAY.", + "Hold CUE and press MIDI. Hold CUE and press MIDI again, or press NO, to return to the page you were on." + ], + "screenshots": [ + "media/ot-tiempos-open.png", + "media/ot-tiempos-last-30s.png" + ] + } +} diff --git a/sdk/octabam/modules/tiempos/ot_state.h b/sdk/octabam/modules/tiempos/ot_state.h new file mode 100644 index 000000000..6158cd809 --- /dev/null +++ b/sdk/octabam/modules/tiempos/ot_state.h @@ -0,0 +1,87 @@ +/* SPDX-License-Identifier: GPL-3.0-or-later + * DECK: todo lo que el módulo lee del OS 1.40C del Octatrack, en un solo sitio. + * + * Cada dirección lleva su fuente y su grado de confianza: + * [OK] usada por código de Modwerk probado en hardware (base o módulos). + * [DOC] documentada en Octabam/Modwerk (lectura estática, emulador o una MK1 + * ajena); hay que confirmarla en TU MK1 con `npm run device -- mem`. + * [??] desconocida: el módulo usa un valor por defecto hasta que se sondee + * (ver PROBES.md). Nada aquí escribe en memoria del OS. + * + * La MK1 y la MKII comparten la imagen 1.40C, así que las direcciones son las + * mismas; lo que cambia es el panel (teclas) y la pantalla (LCD en la MK1). + */ +#ifndef OT_STATE_H +#define OT_STATE_H +#include + +/* ---- Lectura de memoria ------------------------------------------------- */ +#ifdef DECK_HOST +uint32_t host_rd32(uint32_t addr); +uint16_t host_rd16(uint32_t addr); +uint8_t host_rd8(uint32_t addr); +void host_redraw(void); +#define RD32(a) host_rd32(a) +#define RD16(a) host_rd16(a) +#define RD8(a) host_rd8(a) +#define OT_REDRAW() host_redraw() +#else +#define RD32(a) (*(const volatile uint32_t *)(uintptr_t)(a)) +#define RD16(a) (*(const volatile uint16_t *)(uintptr_t)(a)) +#define RD8(a) (*(const volatile uint8_t *)(uintptr_t)(a)) +/* [OK] runtime.c: redibuja la pantalla de pista como hace CUE (0x4004d948(-1)). + * Solo desde la tarea de UI (module_key / module_tick lo son). */ +#define OT_REDRAW() ((void (*)(int))0x4004d948u)(-1) +#endif + +/* ---- Variante de panel --------------------------------------------------- */ +/* [OK] boot_anim.c (PANEL_MKII): palabra que el arranque pone por GPIO; 0 = MK1. */ +#define OT_PANEL_MKII 0x46c8d18cu + +/* ---- Motor de audio ------------------------------------------------------ */ +/* [DOC] Octabam ARCHITECTURE.md §6: estado de voz por pista, 8 x 0xA8 bytes, + * byte 0 = activa. */ +#define OT_VOICE_BASE 0x800049d8u +#define OT_VOICE_STRIDE 0xA8u +#define OT_VOICE_ACTIVE 0x00u /* u8 */ +/* [DOC] Octabam REPITCH.md: "T1's sample position (voice +68)", en frames. */ +#define OT_VOICE_POS 0x44u /* u32 */ +/* [DOC] Octabam STORAGE.md §4: al arrancar la voz, el OS copia la región de + * trim del slot (inicio, fin) a la voz en +40. Leído en ot_emu (MKI, base de + * desarrollo, 26 oct 2026) con un WAV de 120 s en una Static sin trim: + * +0x28 = 0 y +0x2c = 5.292.000 frames (+0x34 y +0x3c también; +0x30 = 0, así + * que +0x30 no es el final). Sin confirmar en una unidad real. */ +#define OT_VOICE_START 0x28u /* u32, frames: inicio del trim */ +#define OT_VOICE_END 0x2cu /* u32, frames: fin del trim, donde la Static se para */ + +/* [DOC] Octabam RECORDER.md: tempo del proyecto, BPM x 24 (720..7200). */ +#define OT_TEMPO24 0x80001814u /* u32 */ + +/* [DOC] Octabam MAINMENU.md §6: pista de audio actual (0..7). */ +#define OT_CUR_TRACK 0x80000000u /* u8 */ + +/* [DOC] Octabam STORAGE.md (MK1): ajustes de cada slot STATIC, paso 0x448; + * REPITCH.md: tempo de la muestra en +0x116 (BPM x 24). */ +#define OT_STATIC_SETTINGS 0x100d5b30u +#define OT_SLOT_STRIDE 0x448u +#define OT_SLOT_TEMPO24 0x116u /* u16 */ + +/* [OK] status.c (DTCN3): contador libre del temporizador de frames, 132 MHz, + * 32 bits (da la vuelta cada 32,5 s). Sirve para medir tiempo real. */ +#define OT_DTCN3 0xfc07c00cu +#define OT_DTCN3_PER_MS 132000u + +/* El Octatrack reproduce a 44,1 kHz; las posiciones de voz son frames. */ +#define OT_RATE 44100u + +/* ---- Desconocidos que hay que sondear (PROBES.md) ------------------------ */ +/* Qué slot STATIC usa cada pista en la Part activa. [??] P4 */ +/* Muteo por pista (FUNC + TRACK). [??] P5 */ +/* Envío a CUE por pista (CUE + TRACK) en modo NORMAL/STUDIO. [??] P6 */ +/* Destinos de Output Matrix (MATRIX): byte de LEVEL/cue de la Part, según su + * README "the choice is stored in the Part". [??] P7 */ +/* Lista de slots, nombres y rutas (para el navegador). [??] P8 */ +/* API de ficheros de la CF para leer los .dkp: + * STORAGE.md §1 (vtable 0x46c823fa..; open 0x46c8242a, size 0x46c8241e). [??] P9 */ + +#endif diff --git a/sdk/octabam/modules/tiempos/presentation/thumbnail.svg b/sdk/octabam/modules/tiempos/presentation/thumbnail.svg new file mode 100644 index 000000000..4d78e30f5 --- /dev/null +++ b/sdk/octabam/modules/tiempos/presentation/thumbnail.svg @@ -0,0 +1,19 @@ +AAAWgmp1bWIAAAAeanVtZGMycGEAEQAQgAAAqgA4m3EDYzJwYQAAABZcanVtYgAAAEdqdW1kYzJtYQARABCAAACqADibcQN1cm46YzJwYTpkY2ZkYWI5Yi04MTI5LTRjZDAtYTkxNS0zMTVkYjZhNWY0ZjIAAAADl2p1bWIAAAApanVtZGMyYXMAEQAQgAAAqgA4m3EDYzJwYS5hc3NlcnRpb25zAAAAALxqdW1iAAAARGp1bWRjYm9yABEAEIAAAKoAOJtxE2MycGEuaW5ncmVkaWVudC52MwAAAAAYYzJzaFmLEi5OKt0tDl6wYJKfLMQAAABwY2JvcqNpZGM6Zm9ybWF0bWltYWdlL3N2Zyt4bWxqaW5zdGFuY2VJRHgseG1wOmlpZDo0NmVmY2FmNS0zZGFjLTQ2OTUtYTMxNS01MTFjNjAxMjI4YzZscmVsYXRpb25zaGlwaHBhcmVudE9mAAAB4mp1bWIAAABBanVtZGNib3IAEQAQgAAAqgA4m3ETYzJwYS5hY3Rpb25zLnYyAAAAABhjMnNooBvFDsBYyxXtefUpG7FIyQAAAZljYm9yomdhY3Rpb25zgqJmYWN0aW9ua2MycGEub3BlbmVkanBhcmFtZXRlcnOha2luZ3JlZGllbnRzgaJjdXJseC1zZWxmI2p1bWJmPWMycGEuYXNzZXJ0aW9ucy9jMnBhLmluZ3JlZGllbnQudjNkaGFzaFggxejELNRBKtL/mhwRc5sdKd7t4csfTwkWxXIZpNCdt1GkZmFjdGlvbngdY29tLmFudGhyb3BpYy5jbGF1ZGUucHJvdmlkZWRqcGFyYW1ldGVyc6F4H2NvbS5hbnRocm9waWMub3JpZ2luLWNvbmZpZGVuY2VndW5rbm93bmtkZXNjcmlwdGlvbnhmQ2xhdWRlIHByb3ZpZGVkIHRoaXMgZmlsZSBhdCB0aGUgcmVxdWVzdCBvZiBhIHVzZXIgYW5kIG1heSBoYXZlIGNyZWF0ZWQgb3IgbW9kaWZpZWQgdGhlIGZpbGUgY29udGVudHMubXNvZnR3YXJlQWdlbnShZG5hbWVmQ2xhdWRlcmFsbEFjdGlvbnNJbmNsdWRlZPUAAADIanVtYgAAAEBqdW1kY2JvcgARABCAAACqADibcRNjMnBhLmhhc2guZGF0YQAAAAAYYzJzaCenKxIatiqegmbb9fGTdv4AAACAY2JvcqVjYWxnZnNoYTI1NmNwYWRNAAAAAAAAAAAAAAAAAGRoYXNoWCDRmrT1D9pE28FlKFVApLNGnjdfvAAFun724sY9Ip2/aWRuYW1lbmp1bWJmIG1hbmlmZXN0amV4Y2x1c2lvbnOBomVzdGFydBjkZmxlbmd0aBkeBAAAAj5qdW1iAAAAJ2p1bWRjMmNsABEAEIAAAKoAOJtxA2MycGEuY2xhaW0udjIAAAACD2Nib3KlY2FsZ2ZzaGEyNTZpc2lnbmF0dXJleE1zZWxmI2p1bWJmPS9jMnBhL3VybjpjMnBhOmRjZmRhYjliLTgxMjktNGNkMC1hOTE1LTMxNWRiNmE1ZjRmMi9jMnBhLnNpZ25hdHVyZWppbnN0YW5jZUlEeCx4bXA6aWlkOmVkY2YwMjcxLTU5NTEtNGEwOS04Y2EwLWY2Yjc5MzkzNzU1ZHJjcmVhdGVkX2Fzc2VydGlvbnODomN1cmx4LXNlbGYjanVtYmY9YzJwYS5hc3NlcnRpb25zL2MycGEuaW5ncmVkaWVudC52M2RoYXNoWCDF6MQs1EEq0v+aHBFzmx0p3u3hyx9PCRbFchmk0J23UaJjdXJseCpzZWxmI2p1bWJmPWMycGEuYXNzZXJ0aW9ucy9jMnBhLmFjdGlvbnMudjJkaGFzaFgg8yTBCasIyHm4m2FtuNceuXyrSwb6oFqPRy0XttCtUnOiY3VybHgpc2VsZiNqdW1iZj1jMnBhLmFzc2VydGlvbnMvYzJwYS5oYXNoLmRhdGFkaGFzaFgg+yX0RXqxa0It+WDONd0FjYI+RXdHeG6Oj9jgX/3jUQp0Y2xhaW1fZ2VuZXJhdG9yX2luZm+jZG5hbWVvQW50aHJvcGljIEZpbGVzZ3ZlcnNpb25lMS4wLjBrc3BlY1ZlcnNpb25lMi40LjAAABA4anVtYgAAAChqdW1kYzJjcwARABCAAACqADibcQNjMnBhLnNpZ25hdHVyZQAAABAIY2JvctKEWQISogEmGCFZAgowggIGMIIBjaADAgECAhRA5aAK7sI50L64g/oGQgU9Z1UTADAKBggqhkjOPQQDAzBJMRcwFQYDVQQKEw5BbnRocm9waWMsIFBCQzEuMCwGA1UEAxMlQW50aHJvcGljIENvbnRlbnQgQ3JlZGVudGlhbHMgUm9vdCBDQTAeFw0yNjA4MDcxODQzNTZaFw0yODA4MDYxOTQzNTZaMEQxFzAVBgNVBAoTDkFudGhyb3BpYywgUEJDMSkwJwYDVQQDEyBBbnRocm9waWMgQ2xhdWRlIENvbnRlbnQgU2lnbmluZzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABJh6CmvLUBgFFNU0vUKlOVtE6djd17L5SuwX0LemFisBM3dkd/3cyjxFA3Qo5S46fX0/ihY0VZ7mfb9KF703t5OjWDBWMA4GA1UdDwEB/wQEAwIHgDAVBgNVHSUEDjAMBgorBgEEAYPoXgIBMAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgwFoAUzlHiBIFOZFsj+OPEz5o+nMHXXMIwCgYIKoZIzj0EAwMDZwAwZAIwMXMdFJ4BetLLVY7ORuE9noqbbAZOZn/aArXyTwFAZfKrPzxF2vPoJNf1+UCdg1XGAjBwX1zd9WGqYkqmL5SFqw1QySjr1zJfpJM9+1rdDwSPLMOPOjKuiXjoU/pUUeG9RwmhY3BhZFkNngAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPZYQLCFjAmLN4Y+t9sVesFmVaG/vQi6Hnsy+Xkjz7l2FLK/GG87HiQzfWDnVHRiFYrxtuIMAHnej3tCiS+FrOiN9QM= +Tiempos — time left on eight tracks +A conceptual diagram of track rows: a solid line for the part of each track still to play, a faint line for what has played, an end mark and the time left. + + + +17:2220:2235:0040:0158:32TIME LEFT · 8 TRACKS + diff --git a/sdk/octabam/modules/tiempos/qualification.example.json b/sdk/octabam/modules/tiempos/qualification.example.json new file mode 100644 index 000000000..f24ba06cd --- /dev/null +++ b/sdk/octabam/modules/tiempos/qualification.example.json @@ -0,0 +1,84 @@ +{ + "moduleVersion": "0.1.0", + "sourceSha256": "REPLACE_WITH_NATIVE_SOURCE_SHA256", + "imageSha256": "REPLACE_WITH_LOCAL_TESTED_IMAGE_SHA256", + "cycles": [ + { + "processor": "dsp", + "worstCase": null, + "maxConfiguration": null, + "maxInstances": null, + "budget": null, + "unit": "cycles/sample", + "method": "emulator", + "conditions": { + "parameterExtremes": "Describe every minimum, maximum and branch boundary tested.", + "parameterModulation": "Describe simultaneous LFOs, p-locks, MIDI CC and scene sweeps; justify each inapplicable mechanism.", + "modeSwitching": "Describe repeated/interrupted mode, bypass and Part changes.", + "maxLoad": "Describe maximum voices/instances, both cores, FX slots, streaming and USB/MIDI load.", + "inputConditions": "Describe silence, impulses, full-scale inputs, feedback and other worst-case signal conditions." + }, + "report": "TESTING.md" + } + ], + "memory": { + "regions": [ + { + "name": "Replace with each code, state, table, buffer, stack/heap and padding allocation", + "space": "dsp-p", + "words": null, + "wordBits": 24, + "bytes": null, + "scope": "shared" + } + ], + "perInstanceBytes": null, + "sharedBytes": null, + "maxInstances": null, + "totalBytes": null, + "conditions": "State exact build options, alignment, accounting convention, allocator/stack bounds and reused stock/shared memory; justify every absent allocation class.", + "report": "TESTING.md" + }, + "hardware": { + "status": "pending", + "model": "MKII", + "testedOn": "YYYY-MM-DD", + "tester": "Your credited tester handle; no email", + "project": { + "name": "Your local stress project", + "sha256": "REPLACE_WITH_PROJECT_FINGERPRINT", + "recipe": "Record generator/tool revision and command, local source template fingerprint, sample recipe, all settings and modifications needed to reproduce this stress project. Keep the project/card/firmware local." + }, + "durationMinutes": null, + "audioTracks": 8, + "midiTracks": null, + "conditions": { + "parameterExtremes": "Describe every minimum, maximum and branch boundary tested.", + "parameterModulation": "Describe simultaneous LFOs, p-locks, MIDI CC and scene sweeps; justify each inapplicable mechanism.", + "modeSwitching": "Describe repeated/interrupted mode, bypass and Part changes.", + "maxLoad": "Describe maximum voices/instances, both cores, FX slots, streaming and USB/MIDI load.", + "inputConditions": "Describe silence, impulses, full-scale inputs, feedback and other worst-case signal conditions." + }, + "checks": { + "audioContinuity": "failed", + "transport": "failed", + "controls": "failed", + "memoryIntegrity": "failed", + "recovery": "failed" + }, + "report": "TESTING.md", + "maxInstances": null + }, + "documentation": { + "tutorial": { + "title": "Quick tutorial", + "steps": [ + "Explain setup and exactly where to select or enable the module.", + "Demonstrate the main controls with a useful example setting.", + "Explain what to hear/observe and how to stop, reset or bypass." + ] + }, + "screenshots": [], + "screenshotStyle": "black-and-white" + } +} diff --git a/sdk/octabam/modules/tiempos/resource-impact.example.json b/sdk/octabam/modules/tiempos/resource-impact.example.json new file mode 100644 index 000000000..8f7457a05 --- /dev/null +++ b/sdk/octabam/modules/tiempos/resource-impact.example.json @@ -0,0 +1,21 @@ +{ + "conditions": "Describe the active workload, expensive modes, changing controls, instance count, and whether shared/stock allocations are included.", + "cpu": { + "level": null, + "basis": "source-estimate", + "rationale": "Choose minimal, low, moderate or high from source inspection or a documented workload comparison. Explain the ColdFire work and cite the record; do not invent a utilization percentage.", + "source": "TESTING.md" + }, + "dsp": { + "level": null, + "basis": "source-estimate", + "rationale": "Choose a relative demand tier covering the expensive DSP modes and modulation. Minimal needs an explanation of the small or absent added DSP path.", + "source": "TESTING.md" + }, + "memory": { + "level": null, + "basis": "source-estimate", + "rationale": "Choose a relative footprint tier covering code, state, tables and buffers. Distinguish shared reservations and reused stock buffers from extra per-instance memory.", + "source": "TESTING.md" + } +} diff --git a/sdk/octabam/modules/tiempos/tiempos.c b/sdk/octabam/modules/tiempos/tiempos.c new file mode 100644 index 000000000..a907db4dd --- /dev/null +++ b/sdk/octabam/modules/tiempos/tiempos.c @@ -0,0 +1,318 @@ +/* SPDX-License-Identifier: GPL-3.0-or-later + * TIEMPOS: el tiempo que le queda a cada una de las 8 pistas, en una pantalla. + * Módulo de runtime de Modwerk para Octatrack MK1 y MKII (OS 1.40C). + * + * python3 -B sdk/runtime/loader/build.py tiempos.c -o tiempos.mwrm + * npm run device -- try tiempos.mwrm --seconds 300 + * + * Solo lee y dibuja: no escribe en memoria del OS ni parchea código de stock. + * No necesita forma de onda, archivos .dkp, tarjeta ni deckprep: solo la posición + * y el final de la muestra de cada voz (sondeos P2 y P3). + * + * Tiempo real sin conocer el BPM de la muestra: el módulo mide a qué velocidad + * avanza la posición de cada voz (frames por segundo de reloj, con el temporizador + * de 132 MHz). Así el tiempo restante ya incluye time-stretch, repitch y cambios de + * tempo, y no hace falta saber qué slot usa cada pista (P4). + * + * Con RATE negativo la voz va hacia atrás: la posición baja (hasta -1 al llegar al + * inicio) y un redisparo salta al final. La velocidad se mide con signo, solo si el + * sentido se mantiene en la ventana; hacia atrás falta lo que hay hasta el inicio del + * trim. Con RATE 0 la voz está quieta y el tiempo restante se muestra como --:--. + * + * Teclas (deck_keys.h): CUE + MIDI abre y cierra · NO cierra · LEFT / RIGHT cambian + * la columna derecha (duración total / tiempo transcurrido) · páginas, BANK y + * PATTERN cierran y llegan al OS · dos pulsaciones de la misma tecla de pista en + * menos de 400 ms cierran y llegan al OS · todo lo demás sigue yendo al OS. + * + * Fila de cada pista (8 px de alto, 8 filas): + * x 0-8 número: relleno = suena; contorno = cargada y parada; punteado = vacía + * x 10 marca de la pista seleccionada + * x 13-80 barra: maciza lo que falta, línea fina lo ya sonado, tope al final + * x 84-103 tiempo restante m:ss (parpadea en negativo bajo 30 s si suena) + * x 108-127 duración total o tiempo transcurrido, al tempo actual + */ +#include +#include "modwerk_module.h" +#include "ot_state.h" +#include "deck_keys.h" +#include "deck_font.h" + +#define TRACKS 8 +#define ROW_H 8 +#define BAR_X0 13 +#define BAR_X1 80 +#define REM_END 103 +#define RIGHT_END 127 +#define WINDOW_MS 500u /* ventana de medida de la velocidad */ +#define BLINK_SECS 30u +#define DOUBLE_MS 400u /* dos pulsaciones de la misma pista: cierra */ +#define STILL_RATE 64u /* frames por segundo: por debajo, la voz está quieta (RATE 0) */ + +/* ---------------------------------------------------------------- dibujo */ +static unsigned char *fb; + +static void px(int x, int y, int on) +{ + if ((unsigned)x > 127u || (unsigned)y > 63u) return; + unsigned char *b = fb + x * 8 + 7 - (y >> 3); + unsigned char m = (unsigned char)(1u << (y & 7)); + if (on) *b |= m; else *b &= (unsigned char)~m; +} + +static void rect(int x0, int y0, int x1, int y1, int on) +{ + for (int x = x0; x <= x1; ++x) + for (int y = y0; y <= y1; ++y) px(x, y, on); +} + +static void text(int x, int y, const char *s, int on) +{ + for (; *s; ++s, x += 4) { + int c = (unsigned char)*s; + if (c < 32 || c >= 96) continue; + unsigned g = deck_font[c - 32]; + for (int r = 0; r < 5; ++r) + for (int k = 0; k < 3; ++k) + if (g & (1u << (14 - r * 3 - k))) px(x + k, y + r, on); + } +} + +static int text_w(const char *s) +{ + int n = 0; + while (s[n]) ++n; + return n ? n * 4 - 1 : 0; +} + +static void fmt_time(char *s, uint32_t secs) +{ + if (secs > 5999u) secs = 5999u; + uint32_t m = secs / 60u; + if (m >= 10u) *s++ = (char)('0' + m / 10u); + *s++ = (char)('0' + m % 10u); + *s++ = ':'; + *s++ = (char)('0' + (secs % 60u) / 10u); + *s++ = (char)('0' + secs % 10u); + *s = 0; +} + +/* ---------------------------------------------------------------- estado */ +struct track { + int32_t pos, last_pos; /* frames, con signo: hacia atrás llega a -1 */ + uint32_t start, len; /* el trim de la voz, frames */ + int32_t win_pos; /* inicio de la ventana de medida */ + uint32_t win_t; + int32_t rate; /* frames por segundo real, con signo (< 0 = hacia atrás) */ + int8_t dir, win_dir; /* sentido del último avance y de la ventana: 1, -1 o 0 */ + uint8_t active, measuring, measured; +}; + +static struct track tr[TRACKS]; +static int open, show_elapsed, cue_held, taken_key = -1; +static int last_track_key = -1; /* última tecla de pista pulsada con la pantalla abierta */ +static uint32_t last_track_at; /* su instante, en cuentas del temporizador de 132 MHz */ +static uint32_t ticks; +static uint8_t cur_track; +static uint32_t toast_until; + +/* Velocidad para los cálculos, sin signo: la medida o, si no hay, la original (44,1 kHz). */ +static uint32_t rate_of(const struct track *t) +{ + if (!t->measured) return OT_RATE; + return t->rate < 0 ? (uint32_t)-t->rate : (uint32_t)t->rate; +} + +/* Hacia atrás: el sentido medido o, sin medida, el del último avance. */ +static int reverse(const struct track *t) { return t->measured && t->rate ? t->rate < 0 : t->dir < 0; } + +/* RATE 0: medida y casi quieta; el tiempo restante no tiene sentido. */ +static int still(const struct track *t) { return t->measured && rate_of(t) < STILL_RATE; } + +static uint32_t secs_for(uint32_t frames, uint32_t rate) +{ + return rate ? frames / rate : 0u; +} + +/* Lee las voces y actualiza la velocidad medida de cada una. */ +static void sample_tracks(void) +{ + uint32_t now = RD32(OT_DTCN3); + cur_track = RD8(OT_CUR_TRACK); + for (unsigned i = 0; i < TRACKS; ++i) { + struct track *t = &tr[i]; + uint32_t v = OT_VOICE_BASE + i * OT_VOICE_STRIDE; + t->active = RD8(v + OT_VOICE_ACTIVE) != 0; + t->pos = (int32_t)RD32(v + OT_VOICE_POS); + t->start = RD32(v + OT_VOICE_START); + t->len = RD32(v + OT_VOICE_END); + + /* Redisparo, cue o muestra nueva: un salto de más de 1 s, o uno en contra del + * sentido en que suena de más de 1/8 s (hacia atrás, el redisparo vuelve al final). + * Un paso corto en contra es un cambio de RATE: cambia el sentido, no es un salto. */ + int32_t step = t->pos - t->last_pos; + uint32_t size = step < 0 ? (uint32_t)-step : (uint32_t)step; + int8_t sign = step > 0 ? 1 : step < 0 ? -1 : 0; + int jumped = size > OT_RATE || (sign && sign == -t->dir && size > OT_RATE / 8u); + if (sign && !jumped) t->dir = sign; + + /* Se empieza otra ventana, conservando la última velocidad medida, tras un salto, + * una parada o un cambio de sentido dentro de la ventana. */ + if (!t->active || jumped || !t->measuring || (sign && t->win_dir && sign != t->win_dir)) { + t->win_pos = t->pos, t->win_t = now, t->measuring = t->active; + t->win_dir = jumped ? 0 : sign; + } else { + if (sign) t->win_dir = sign; + uint32_t dt = (now - t->win_t) / (OT_DTCN3_PER_MS / 10u); /* décimas de ms */ + if (dt >= WINDOW_MS * 10u) { + int32_t dp = t->pos - t->win_pos; /* |dp| < 2 * 44100 en 0,5 s */ + int32_t r = dp * 10000 / (int32_t)dt; /* frames por segundo; |dp| * 1e4 < 2^31 */ + /* suaviza si es parecida a la anterior; si cambia mucho (tempo o RATE nuevos), se toma tal cual */ + int32_t d = r > t->rate ? r - t->rate : t->rate - r; + int32_t m = t->rate < 0 ? -t->rate : t->rate; + t->rate = t->measured && m && d * 50 < m ? (t->rate * 3 + r) / 4 : r; + t->measured = 1; + t->win_pos = t->pos, t->win_t = now, t->win_dir = 0; + } + } + t->last_pos = t->pos; + } +} + +/* ---------------------------------------------------------------- vista */ +static void draw_row(unsigned i) +{ + const struct track *t = &tr[i]; + int y = (int)i * ROW_H, loaded = t->len > t->start && t->pos <= (int32_t)t->len; + /* posición dentro del trim; hacia atrás llega a -1, por debajo del inicio */ + uint32_t at_pos = t->pos > (int32_t)t->start ? (uint32_t)t->pos : t->start; + uint32_t total = loaded ? t->len - t->start : 0u; + int back = reverse(t); + /* hacia delante falta hasta el final; hacia atrás, hasta el inicio del trim */ + uint32_t left = back ? at_pos - t->start : (loaded ? t->len - at_pos : 0u); + uint32_t played = total - left; + char s[8]; + s[0] = (char)('1' + i), s[1] = 0; + + /* número */ + if (loaded && t->active) { + rect(0, y, 8, y + 6, 1); + text(3, y + 1, s, 0); + } else if (loaded) { + rect(0, y, 8, y, 1), rect(0, y + 6, 8, y + 6, 1), rect(0, y, 0, y + 6, 1), rect(8, y, 8, y + 6, 1); + text(3, y + 1, s, 1); + } else { + for (int x = 0; x <= 8; x += 2) px(x, y, 1), px(x, y + 6, 1); + for (int yy = y; yy <= y + 6; yy += 2) px(0, yy, 1), px(8, yy, 1); + text(3, y + 1, s, 1); + } + if (i == cur_track) rect(10, y + 2, 10, y + 4, 1); + + if (!loaded) { + text(REM_END - text_w("--:--") + 1, y + 1, "--:--", 1); + return; + } + + /* barra: escala por longitud; la parte que falta, maciza (hacia atrás, a la izquierda) */ + int w = BAR_X1 - BAR_X0; + int at = BAR_X0 + (int)(((at_pos - t->start) >> 8) * (uint32_t)w / ((total >> 8) + 1u)); + if (at > BAR_X1) at = BAR_X1; + if (back) { + rect(BAR_X0, y + 1, at, y + 5, 1); + if (at < BAR_X1) rect(at + 1, y + 3, BAR_X1, y + 3, 1); + } else { + if (at > BAR_X0) rect(BAR_X0, y + 3, at - 1, y + 3, 1); + rect(at, y + 1, BAR_X1, y + 5, 1); + } + rect(BAR_X1 + 1, y, BAR_X1 + 1, y + 6, 1); /* tope */ + + /* RATE 0: sin tiempo restante ni total que mostrar (al final queda 0:00, quieta o no) */ + if (still(t) && left) { + text(REM_END - text_w("--:--") + 1, y + 1, "--:--", 1); + text(RIGHT_END - text_w("--:--") + 1, y + 1, "--:--", 1); + return; + } + + /* tiempo restante, real */ + uint32_t rate = rate_of(t), rem = secs_for(left, rate); + fmt_time(s, rem); + int x = REM_END - text_w(s) + 1; + /* hacia atrás la voz sigue activa en el inicio: ahí ha terminado y no parpadea */ + if (t->active && left && rem < BLINK_SECS && !((ticks / 30u) & 1u)) { + rect(x - 1, y, REM_END + 1, y + 6, 1); + text(x, y + 1, s, 0); + } else text(x, y + 1, s, 1); + + /* columna derecha: total o transcurrido, a la misma velocidad */ + fmt_time(s, secs_for(show_elapsed ? played : total, rate)); + text(RIGHT_END - text_w(s) + 1, y + 1, s, 1); +} + +/* ---------------------------------------------------------------- eventos */ +void module_tick(struct modwerk_runtime_api *api) +{ + ++ticks; + sample_tracks(); /* también cerrado: así la velocidad ya está medida al abrir */ + if (api) api->value = (uint32_t)tr[0].rate; /* con signo: hacia atrás, negativa */ +} + +void module_draw(unsigned char *frame) +{ + if (!open) return; + fb = frame; + for (unsigned i = 0; i < 1024u; ++i) frame[i] = 0; + for (unsigned i = 0; i < TRACKS; ++i) draw_row(i); + /* aviso al cambiar la columna derecha (no hay sitio para una cabecera) */ + if ((int32_t)(toast_until - ticks) > 0) { + const char *m = show_elapsed ? "ELAPSED" : "TOTAL"; + int w = text_w(m), x = 64 - w / 2; + rect(x - 4, 26, x + w + 3, 36, 0); + rect(x - 4, 26, x + w + 3, 26, 1), rect(x - 4, 36, x + w + 3, 36, 1); + rect(x - 4, 26, x - 4, 36, 1), rect(x + w + 3, 26, x + w + 3, 36, 1); + text(x, 29, m, 1); + } +} + +static void close_view(void) +{ + open = 0; + OT_REDRAW(); +} + +int module_key(int code, int pressed) +{ + if (code == K_CUE) cue_held = pressed; + if (!pressed) { + if (code == taken_key) { taken_key = -1; return 1; } + return 0; + } + if (code == K_OPEN && cue_held) { + if (open) close_view(); else open = 1; + last_track_key = -1; + taken_key = code; + return 1; + } + if (!open) return 0; + /* Pista: una pulsación la selecciona y la pantalla sigue; la segunda de la misma + * pista en menos de DOUBLE_MS cierra. Las dos llegan al OS. */ + if (code >= K_TRACK1 && code <= K_TRACK8) { + uint32_t now = RD32(OT_DTCN3); + if (code == last_track_key && now - last_track_at < DOUBLE_MS * OT_DTCN3_PER_MS) { + last_track_key = -1; + close_view(); + return 0; + } + last_track_key = code, last_track_at = now; + return 0; + } + last_track_key = -1; + if (code == K_NO) { close_view(); taken_key = code; return 1; } + if (code == K_LEFT || code == K_RIGHT) { show_elapsed = !show_elapsed, toast_until = ticks + 75u; taken_key = code; return 1; } + if ((code >= K_SRC && code <= K_FX2) || code == K_BANK || code == K_PATTERN) { close_view(); return 0; } + return 0; +} + +int module_enc(int encoder, int delta) +{ + (void)encoder, (void)delta; + return 0; +} diff --git a/sdk/octabam/modules/tiempos/tiempos_host.c b/sdk/octabam/modules/tiempos/tiempos_host.c new file mode 100644 index 000000000..12c1f6690 --- /dev/null +++ b/sdk/octabam/modules/tiempos/tiempos_host.c @@ -0,0 +1,250 @@ +/* SPDX-License-Identifier: GPL-3.0-or-later + * Host de pruebas de TIEMPOS: memoria del OS simulada, reloj de 132 MHz simulado, + * 60 ticks por segundo, y volcado de la pantalla a PBM. + * + * cc -DDECK_HOST -I.. -o tiempos_host tiempos_host.c ../tiempos.c && ./tiempos_host out/ + */ +#include +#include +#include +#include +#include "modwerk_module.h" +#include "ot_state.h" +#include "deck_keys.h" +#include "deck_font.h" + +static double now_s; /* tiempo real simulado */ +static uint8_t active[8], cur; +static double pos[8], speed[8]; /* frames, frames por segundo (negativa: hacia atrás) */ +static uint32_t start[8], len[8]; /* trim de cada voz, frames */ +static int redraws, fails; + +uint32_t host_rd32(uint32_t a) +{ + if (a == OT_DTCN3) return (uint32_t)(uint64_t)llround(now_s * 132e6); + for (unsigned t = 0; t < 8; ++t) { + uint32_t v = OT_VOICE_BASE + t * OT_VOICE_STRIDE; + if (a == v + OT_VOICE_POS) return (uint32_t)(int32_t)llround(pos[t]); /* hacia atrás llega a -1 */ + if (a == v + OT_VOICE_START) return start[t]; + if (a == v + OT_VOICE_END) return len[t]; + } + return 0; +} +uint16_t host_rd16(uint32_t a) { (void)a; return 0; } +uint8_t host_rd8(uint32_t a) +{ + if (a == OT_CUR_TRACK) return cur; + for (unsigned t = 0; t < 8; ++t) + if (a == OT_VOICE_BASE + t * OT_VOICE_STRIDE + OT_VOICE_ACTIVE) return active[t]; + return 0; +} +void host_redraw(void) { ++redraws; } + +#define BAR_TEST_X0 13 /* BAR_X0 de tiempos.c */ +static unsigned char frame[1024]; +static int pixel(int x, int y) { return (frame[x * 8 + 7 - (y >> 3)] >> (y & 7)) & 1; } +static void check(int ok, const char *what) { printf("%s %s\n", ok ? "OK " : "FALLO", what); if (!ok) ++fails; } + +static void run(double secs) +{ + int n = (int)lround(secs * 60.0); + for (int i = 0; i < n; ++i) { + now_s += 1.0 / 60.0; + for (int t = 0; t < 8; ++t) + if (active[t]) { + pos[t] += speed[t] / 60.0; + if (pos[t] >= len[t]) pos[t] = len[t], active[t] = 0; + /* hacia atrás, como en la MKI: se queda en el frame anterior al inicio, activa */ + if (speed[t] < 0 && pos[t] < start[t]) pos[t] = (double)start[t] - 1; + } + module_tick(0); + } +} +static void draw(void) { memset(frame, 0xA5, sizeof frame); module_draw(frame); } +static void key(int c, int p) { (void)module_key(c, p); } + +static void dump(const char *dir, const char *name) +{ + char path[512]; + snprintf(path, sizeof path, "%s/%s.pbm", dir, name); + FILE *f = fopen(path, "wb"); + fprintf(f, "P1\n128 64\n"); + for (int y = 0; y < 64; ++y) { for (int x = 0; x < 128; ++x) fputc(pixel(x, y) ? '1' : '0', f); fputc('\n', f); } + fclose(f); +} + +/* Lee los 5 caracteres de una zona comparando con la fuente: lo hace sencillo + * reconstruir "m:ss" contando la anchura del texto encendido no basta, así que las + * pruebas de valores miran el estado interno a través de api->value y la pantalla. */ +static int lit_in(int x0, int x1, int y0, int y1) +{ + int n = 0; + for (int x = x0; x <= x1; ++x) for (int y = y0; y <= y1; ++y) n += pixel(x, y); + return n; +} + +/* ¿Muestra la zona que acaba en x_end, en la fila y, exactamente el texto s? */ +static int text_at(int x_end, int y, const char *s) +{ + int n = (int)strlen(s), x0 = x_end - (n * 4 - 1) + 1; + for (int x = x0 - 2; x <= x_end; ++x) /* x0 - 2: no llega al tope de la barra */ + for (int r = 0; r < 5; ++r) { + int want = 0, k = x - x0; + if (k >= 0 && k % 4 < 3) { + int c = (unsigned char)s[k / 4]; + want = (deck_font[c - 32] >> (14 - r * 3 - k % 4)) & 1; + } + if (pixel(x, y + 1 + r) != want) return 0; + } + return 1; +} +static void mmss(char *s, unsigned secs) { snprintf(s, 8, "%u:%02u", secs / 60, secs % 60); } + +int main(int argc, char **argv) +{ + const char *out = argc > 1 ? argv[1] : "."; + const double R = 44100.0; + + /* T1: tema de 10:52 a 126 BPM en proyecto a 128 (time-stretch: avanza 128/126 más rápido) */ + len[0] = (uint32_t)(652 * R); pos[0] = 200 * R; speed[0] = R * 128.0 / 126.0; active[0] = 1; + /* T2: tema de 6:30 a su tempo, trim desde los 30 s, a 25 s del final */ + start[1] = (uint32_t)(30 * R); len[1] = (uint32_t)(390 * R); pos[1] = (390 - 25) * R; speed[1] = R; active[1] = 1; + /* T3: cargado y parado, con el trim empezando a los 10 s (la posición aún no ha llegado) */ + start[2] = (uint32_t)(10 * R); len[2] = (uint32_t)(300 * R); pos[2] = 0; speed[2] = R; active[2] = 0; + /* T4: loop corto de flex que retriguea */ + len[3] = (uint32_t)(4 * R); pos[3] = 0; speed[3] = R; active[3] = 1; + /* T5-T8 vacías; pista seleccionada: T1 */ + cur = 0; + + run(0.2); + draw(); + int untouched = 1; + for (int i = 0; i < 1024; ++i) untouched &= frame[i] == 0xA5; + check(untouched, "cerrado: el marco del OS queda intacto"); + + key(K_CUE, 1); + check(module_key(K_MIDI, 1) == 1, "CUE + MIDI abre y se queda la pulsación"); + key(K_MIDI, 0); key(K_CUE, 0); + run(2.0); + + /* tiempo restante real de T1 */ + { + struct modwerk_runtime_api api = {0}; + module_tick(&api); + double rate = api.value, want = R * 128.0 / 126.0; + check(fabs(rate - want) / want < 0.002, "T1: velocidad medida = 44100 x 128/126 (error < 0,2 %)"); + double rem_true = (len[0] - pos[0]) / want, rem_naive = (len[0] - pos[0]) / R; + printf(" T1 restante real %.1f s (sin corregir serían %.1f s)\n", rem_true, rem_naive); + } + draw(); + dump(out, "t1_ocho_pistas"); + check(lit_in(0, 8, 0, 6) > 40, "T1 suena: número relleno"); + check(pixel(10, 3), "marca de pista seleccionada en T1"); + check(pixel(0, 16) && pixel(8, 22) && !pixel(1, 17), "T3 cargada y parada: contorno"); + check(pixel(0, 32) && !pixel(1, 32), "T5 vacía: punteada"); + check(lit_in(84, 103, 32, 38) > 10, "T5 vacía: muestra --:--"); + + /* parpadeo de T2 (< 30 s) */ + int a, b; + run(0.25); draw(); a = lit_in(83, 104, 8, 14); + run(0.5); draw(); b = lit_in(83, 104, 8, 14); + check(abs(a - b) > 30, "T2: el tiempo parpadea por debajo de 30 s"); + + /* cambio de tempo del proyecto a 132: la medida se adapta en menos de 2 s */ + speed[0] = R * 132.0 / 126.0; + run(2.0); + { + struct modwerk_runtime_api api = {0}; + module_tick(&api); + double want = R * 132.0 / 126.0; + check(fabs(api.value - want) / want < 0.002, "cambio de tempo: nueva velocidad en < 2 s"); + } + + /* retrig del loop de T4: no rompe la medida */ + for (int i = 0; i < 5; ++i) { pos[3] = 0; run(0.3); } + draw(); + check(lit_in(84, 127, 24, 30) > 10, "T4 con retrigs: sigue mostrando tiempos"); + + /* LEFT: columna derecha a transcurrido */ + key(K_LEFT, 1); key(K_LEFT, 0); + draw(); + dump(out, "t2_transcurrido"); + + /* PLAY no se toma; SRC cierra y pide redibujar */ + check(module_key(K_PLAY, 1) == 0, "PLAY sigue al OS"); + module_key(K_PLAY, 0); + int r0 = redraws; + check(module_key(K_SRC, 1) == 0 && redraws == r0 + 1, "SRC cierra y el OS redibuja"); + module_key(K_SRC, 0); + + /* Teclas de pista con la pantalla abierta: llegan siempre al OS; una sola deja la + * pantalla, dos de la misma pista en menos de 400 ms la cierran. */ + key(K_CUE, 1); key(K_MIDI, 1); key(K_MIDI, 0); key(K_CUE, 0); + int pass = module_key(K_TRACK1 + 2, 1) == 0; module_key(K_TRACK1 + 2, 0); + run(0.5); + pass &= module_key(K_TRACK1 + 2, 1) == 0; module_key(K_TRACK1 + 2, 0); + draw(); + check(pass && frame[0] != 0xA5, "T3 dos veces con 500 ms entre medias: llega al OS y la pantalla sigue"); + pass = module_key(K_TRACK1 + 3, 1) == 0; module_key(K_TRACK1 + 3, 0); + run(0.2); + pass &= module_key(K_TRACK1 + 2, 1) == 0; module_key(K_TRACK1 + 2, 0); + draw(); + check(pass && frame[0] != 0xA5, "T4 y luego T3 en 200 ms: llegan al OS y la pantalla sigue"); + r0 = redraws; + run(0.25); + pass = module_key(K_TRACK1 + 2, 1) == 0; module_key(K_TRACK1 + 2, 0); + draw(); + check(pass && frame[0] == 0xA5 && redraws == r0 + 1, "T3 dos veces en 250 ms: llega al OS, cierra y el OS redibuja"); + + /* RATE negativo (MKI, 2 de noviembre): la posición baja, se queda en -1 en el inicio y un + * redisparo salta al final. T1 sigue sonando hacia delante a 132/126. */ + key(K_CUE, 1); key(K_MIDI, 1); key(K_MIDI, 0); key(K_CUE, 0); + key(K_LEFT, 1); key(K_LEFT, 0); /* la columna derecha vuelve a la duración total */ + double fwd = R * 132.0 / 126.0; + speed[0] = -fwd; + run(2.0); + { + struct modwerk_runtime_api api = {0}; + module_tick(&api); + int32_t r = (int32_t)api.value; + check(r < 0 && fabs(-r - fwd) / fwd < 0.002, "de RATE positivo a negativo sonando: velocidad negativa en < 2 s"); + } + draw(); + dump(out, "t3_hacia_atras"); + char want[8], less[8]; + unsigned rem = (unsigned)((pos[0] - start[0]) / fwd); + mmss(want, rem), mmss(less, rem ? rem - 1 : 0); + check(text_at(103, 0, want) || text_at(103, 0, less), "hacia atrás: el restante es lo que queda hasta el inicio del trim"); + mmss(want, (unsigned)((len[0] - start[0]) / fwd)); + check(text_at(127, 0, want), "hacia atrás: el total no cambia"); + check(pixel(BAR_TEST_X0 + 1, 1) && !pixel(79, 1) && pixel(79, 3), "hacia atrás: la barra maciza queda a la izquierda"); + + /* redisparo de la pista invertida: salta al final y sigue hacia atrás sin perder la medida */ + pos[0] = len[0] - 60 * R; + run(0.1); + { + struct modwerk_runtime_api api = {0}; + module_tick(&api); + check((int32_t)api.value < 0, "redisparo de una pista invertida: sigue midiendo hacia atrás"); + } + draw(); + rem = (unsigned)((pos[0] - start[0]) / fwd); + mmss(want, rem), mmss(less, rem - 1); + check(text_at(103, 0, want) || text_at(103, 0, less), "redisparo de una pista invertida: el restante vuelve a contar desde el final"); + + /* llega al inicio: 0:00 fijo, sin parpadeo */ + pos[0] = start[0] + 0.5 * R; + run(1.5); + draw(); a = text_at(103, 0, "0:00"); + run(0.5); draw(); b = text_at(103, 0, "0:00"); + check(pos[0] < 0 && a && b, "hacia atrás al llegar al inicio (-1): 0:00 sin parpadeo"); + + /* RATE 0: la voz quieta no inventa un tiempo */ + pos[0] = 300 * R, speed[0] = 0; + run(1.5); + draw(); + check(text_at(103, 0, "--:--") && text_at(127, 0, "--:--"), "RATE 0: --:-- en el restante y en el total"); + + printf("\n%d fallo(s)\n", fails); + return fails != 0; +} diff --git a/sdk/octabam/modules/tiempos/verify.py b/sdk/octabam/modules/tiempos/verify.py new file mode 100644 index 000000000..cbae75eef --- /dev/null +++ b/sdk/octabam/modules/tiempos/verify.py @@ -0,0 +1,46 @@ +# SPDX-License-Identifier: GPL-3.0-or-later +"""Tiempos: the C module and its USB package. + +1. tiempos_host.c: the module against simulated OS memory and a simulated 132 MHz timer on the host (24 checks: + the stock frame left alone while closed, CUE + MIDI, the measured speed, the row marks, the last 30 seconds, + a tempo change, a retriggered Flex loop, PLAY and SRC reaching the unit, the double press, reverse playback + and RATE 0). +2. The package build.py makes from the sources, titled as octatrack-module-packages.py titles it, is byte for byte the published one + (src/engine/assets/octatrack-module-packages.json). +Needs a host C compiler, and m68k-elf-gcc for the package; host-only checks still run without it. +""" +from pathlib import Path +import hashlib +import importlib.util +import json +import shutil +import subprocess +import sys +import tempfile + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[3] + +with tempfile.TemporaryDirectory() as folder: + host = Path(folder) / 'tiempos_host' + subprocess.run(['cc', '-Wall', '-Wextra', '-Werror', '-DDECK_HOST', '-I', str(HERE), '-I', str(ROOT / 'sdk/runtime/loader'), + '-o', str(host), str(HERE / 'tiempos_host.c'), str(HERE / 'tiempos.c'), '-lm'], check=True) + subprocess.run([str(host), folder], check=True) +if not shutil.which('m68k-elf-gcc'): + sys.exit('[SKIP] package: no m68k-elf-gcc here; the host checks passed.') +row = next(r for r in json.loads((ROOT / 'src/engine/assets/octatrack-module-packages.json').read_text())['packages'] + if r['id'] == 'tiempos') +with tempfile.TemporaryDirectory() as folder: + out = Path(folder) / 'tiempos.mwrm' + subprocess.run([sys.executable, '-B', str(ROOT / 'sdk/runtime/loader/build.py'), *[str(ROOT / s) for s in row['sources']], + *[arg for hook in row.get('subscribe', []) for arg in ('--subscribe', hook)], '-o', str(out)], + check=True, capture_output=True, cwd=ROOT) + spec = importlib.util.spec_from_file_location('packages', ROOT / 'scripts/octatrack-module-packages.py') + packages = importlib.util.module_from_spec(spec); spec.loader.exec_module(packages) + data = packages.titled(out.read_bytes(), 'tiempos') +digest = hashlib.sha256(data).hexdigest() +if 'sha256' not in row: + sys.exit('[FAIL] the package row is not completed yet: run npm run octatrack:module-packages (built %s)' % digest[:16]) +if digest != row['sha256'] or (ROOT / 'public' / row['path']).read_bytes() != data: + sys.exit('[FAIL] the package built from source (%s) is not the published one (%s)' % (digest[:16], row['sha256'][:16])) +print('[PASS] Tiempos %s: host checks, package %s identical to the published one' % (row['version'], digest[:16])) diff --git a/sdk/tiempos-build-approval.json b/sdk/tiempos-build-approval.json new file mode 100644 index 000000000..219c38041 --- /dev/null +++ b/sdk/tiempos-build-approval.json @@ -0,0 +1,11 @@ +{ + "kind": "owner-approved-update", + "id": "tiempos", + "version": "0.1.0-experimental", + "approvedBy": "repeat98", + "approvedOn": "2026-11-07", + "ownerStatement": "I accept the three performance waivers for this experimental release (31 Oct 2026, #1096).", + "reason": "Tiempos runs only on the UI task (tick, draw, key and encoder hooks) and has no MIDI path or frame-interrupt work. Its draw cost is an emulator estimate scaled by pixel count, and the MKI LOAD readings are in TESTING.md. No static bound, no cfmeter capture and no MIDI flood. Every other qualification stays required.", + "waived": ["chip-worst-case-cycles", "current-build-hardware"], + "sourceSha256": "45e53efc39e6aba499d312e8e0b26995d2110a6657cbff8f06dc3aaaa9c1f035" +} diff --git a/src/catalog/compatibility-pairs.json b/src/catalog/compatibility-pairs.json index 5ab83d0f5..ef6e261ec 100644 --- a/src/catalog/compatibility-pairs.json +++ b/src/catalog/compatibility-pairs.json @@ -36,6 +36,7 @@ "tapeecho", "tapehead", "temp-save", + "tiempos", "tuner", "usb-audio-out-tracks-main-cue", "vector" diff --git a/src/catalog/module-documents.json b/src/catalog/module-documents.json index 9d4d98ead..fa4288312 100644 --- a/src/catalog/module-documents.json +++ b/src/catalog/module-documents.json @@ -11754,6 +11754,244 @@ } } ] + }, + { + "schemaVersion": 2, + "id": "tiempos", + "key": "TIEMPOS", + "name": "Tiempos", + "version": "0.1.0-experimental", + "category": "system", + "access": { + "location": "Any screen: hold CUE and press MIDI.", + "steps": [ + "Install Tiempos with the Modwerk base over USB.", + "Load samples on some tracks and press PLAY.", + "Hold CUE and press MIDI. Hold CUE and press MIDI again, or press NO, to return to the page you were on." + ], + "screenshots": [ + "media/ot-tiempos-open.png", + "media/ot-tiempos-last-30s.png" + ] + }, + "author": { + "github": "imdantelo", + "credits": [ + "Diego Antelo Barba (design and specification)" + ] + }, + "nativeManifest": "manifest.py", + "presentation": { + "label": "TIME LEFT", + "family": "Display", + "summary": "One screen with the time left on all eight tracks, for playing long samples like a DJ.", + "overview": "Hold CUE and press MIDI to show every track on one screen: a bar of what is left to play, the real time left and the total length. The time left is measured from how fast each voice really plays, so it follows timestretch, repitch and tempo changes. It only reads and draws: no effect slot, no knob, and nothing in the project changes.", + "highlights": [ + "Time left for all eight tracks at once", + "Follows timestretch, repitch and tempo changes", + "The time left flashes in the last 30 seconds", + "Playback keys, track keys, encoders and the crossfader keep working while it shows" + ], + "usage": [ + "Hold CUE and press MIDI from any screen; do the same, or press NO, to close it.", + "LEFT or RIGHT switches the right column between total length and time played." + ] + }, + "controls": [], + "compatibility": { + "firmware": "1.40C", + "effectId": null, + "location": "Audio tracks", + "conflicts": [], + "uiClaims": [ + "key:CUE+MIDI" + ], + "limitations": [ + "Needs the Modwerk base over USB: it uses the base's draw and key events.", + "Tested on one MKI with the Modwerk bases 24a0ed57 and 9b3ba417 (install, Keep, power cycle and Undo of the published package). Not tested yet: an MKII, Part changes and project reloads with the screen open, timestretch modes other than NORMAL, and other modules installed at the same time.", + "CUE + MIDI no longer switches to MIDI tracks while Tiempos is installed; MIDI alone still does.", + "A track that loops shows the time left to the end of the sample, not to the end of the loop.", + "A track playing backwards (RATE below 0) shows as empty once it reaches its start: the unit clears the voice there.", + "Until a track has played for half a second, its time is shown at the sample's original speed.", + "Thru, Neighbor and Pickup tracks show no time." + ] + }, + "resources": { + "recorded": "Developer's MKI, 30 Oct 2026; emulator 30 Oct 2026", + "storage": { + "label": "Storage", + "display": "2,892 bytes", + "value": 2892, + "unit": "bytes", + "method": "static", + "conditions": "From the USB package 8c886466: 2,588 bytes of ColdFire code and data and 304 of bss, one instance. No DSP memory, no heap, no card files.", + "source": "TESTING.md" + }, + "processing": { + "label": "CPU load", + "display": "No change on the unit's LOAD page, open or closed", + "value": null, + "unit": "unknown", + "method": "hardware", + "conditions": "Developer's MKI, released base, three tracks playing: CPU 62 % just after a minute with the screen open against a 64 % peak without Tiempos; the base's five-minute records 51.1 % mean with it, 51.3 % without; DSP load and space unchanged. In the emulator the open screen's draw took about 0.3 ms a UI tick with empty rows, estimated at most 4.3 ms with all eight rows playing.", + "source": "evidence/performance.json" + }, + "impact": { + "conditions": "The Tiempos screen open with tracks playing; closed, it only reads eight voice records each UI tick.", + "cpu": { + "level": "low", + "basis": "measured-comparison", + "rationale": "Only while its screen is open: no change on the MKI's LOAD page or in the base's five-minute records with three tracks playing. In the emulator the draw took about 0.3 ms a UI tick with empty rows; scaled by pixel count, at most 4.3 ms with eight playing rows, an overstatement. Closed, about 3 us a tick. Nothing in the frame interrupt.", + "source": "evidence/performance.json" + }, + "dsp": { + "level": "minimal", + "basis": "measured-comparison", + "rationale": "No DSP code. DSP load (33 % / 42 %) and DSP space (32 % / 37 %) read the same with and without Tiempos on the MKI.", + "source": "TESTING.md" + }, + "memory": { + "level": "minimal", + "basis": "source-estimate", + "rationale": "2,892 bytes of ColdFire code, data and state in DRAM, from the package header.", + "source": "TESTING.md" + } + } + }, + "tests": { + "report": "TESTING.md", + "summary": "On the developer's MKI (OS 1.40C, released base 24a0ed57) over USB, 28-30 Oct 2026: timed trials of the exact package 0506a245 and its predecessor showed the time left, totals and elapsed time of whole, trimmed and Flex tracks against a stopwatch at 120 and 140 BPM, the last-30-seconds flash, a retrigger, tempo changes the double press that closes it, and (package 8c886466) reverse playback with RATE below 0; a Keep survived a power cycle and Undo removed it; LOAD showed no CPU or DSP change. Host tests 24/24. Not run: an MKII, Part changes and reloads with the screen open, other modules beside it, a static cycle bound.", + "hardwareStatus": "reported", + "evidenceRevision": "b711e14055b6c46658a9a44ca0ff21580ead55f6", + "gates": [ + "modules/tiempos/verify.py" + ], + "qualification": { + "documentation": { + "tutorial": { + "title": "Quick tutorial", + "steps": [ + "**Open it.** Load a sample on track 1, press PLAY, hold CUE and press MIDI. Row 1 shows a filled number, a bar and the time left.", + "**Read the speed.** Change the project tempo. Within two seconds the time left on track 1 changes with it; with timestretch on, a faster tempo leaves less time.", + "**Switch the column and close.** Press RIGHT: the notice says ELAPSED and the right column shows the time played. Press NO: the page you were on comes back." + ] + }, + "screenshots": [ + "media/ot-tiempos-open.png", + "media/ot-tiempos-last-30s.png" + ], + "screenshotStyle": "black-and-white" + }, + "moduleVersion": "0.1.0-experimental", + "sourceSha256": "45e53efc39e6aba499d312e8e0b26995d2110a6657cbff8f06dc3aaaa9c1f035", + "imageSha256": "0b54a734258945acbf74551b8920ee4bfa760d390964bd04d2877e4382e990b9", + "cycles": [ + { + "processor": "coldfire", + "worstCase": 1133300, + "maxConfiguration": 1133300, + "maxInstances": 1, + "budget": 4330000, + "unit": "cycles/event", + "method": "emulator", + "conditions": { + "parameterExtremes": "Not applicable: no parameters. The dearest layout, eight playing rows in their last 30 s, is estimated from the host build's pixel count (4,653 writes against 341 for eight empty rows).", + "parameterModulation": "Not applicable: LEFT and RIGHT switch the right column; the draw cost does not depend on it.", + "modeSwitching": "Closed and open, stopped and playing, in the emulator; opened and closed while three tracks played on the MKI.", + "maxLoad": "One instance. The cost is the screen's draw on the UI task, once per composed frame while open; closed it draws nothing. Budget: one UI tick, 16.4 ms at 61 ticks a second, 4,330,000 cycles at 264 MHz.", + "inputConditions": "ot_emu with development base 6a44c813: modwerk_cost[22] (runtime module draw) 314.6 us a tick open and playing with eight empty rows, scaled by the pixel count to 4,293 us (1,133,300 cycles at 264 MHz), an overstatement. No static bound; not measured on hardware." + }, + "report": "evidence/performance.json" + } + ], + "memory": { + "regions": [ + { + "name": "ColdFire code and data (tiempos.c, deck_font.h, DRAM)", + "space": "sdram", + "words": 2588, + "wordBits": 8, + "bytes": 2588, + "scope": "shared" + }, + { + "name": "State (bss): eight track records, screen and key state", + "space": "sdram", + "words": 304, + "wordBits": 8, + "bytes": 304, + "scope": "shared" + } + ], + "perInstanceBytes": 0, + "sharedBytes": 2892, + "maxInstances": 1, + "totalBytes": 2892, + "conditions": "From the USB package 8c886466 (published titled as 0b54a734, 2,852 bytes) (2,588 bytes of code and data, 304 of bss, 43 relocations). Reads OS memory only; writes no stock code or data. No DSP memory, no heap. Stack use is the UI task's and was not measured.", + "report": "TESTING.md" + }, + "hardware": { + "kind": "functional", + "status": "reported", + "model": "MKI", + "testedOn": "2026-11-07", + "tester": "imdantelo", + "sourceRevision": "b711e14055b6c46658a9a44ca0ff21580ead55f6", + "imageSha256": "0b54a734258945acbf74551b8920ee4bfa760d390964bd04d2877e4382e990b9", + "summary": "The developer's MKI, OS 1.40C, released Modwerk base 24a0ed57 built from a local checkout, driven over USB by Claude Code. With package 0506a245: a timed trial (single and double presses of track keys, the stock QUICK ASSIGN after a double press), an install with Keep that survived a power cycle and opened with CUE + MIDI, an Undo back to the empty set, and a seven-minute trial with three tracks playing (CPU 62 % just after a minute open against a 64 % peak without it; DSP load and space unchanged; no stall). With the previous package 225a0170 (same timing code): totals 2:08 at 120 BPM and 1:49 at 140 BPM on three 64-bar tones at 100, 120 and 140 BPM, a trimmed Static and a Flex track, 1:25 left and 0:24 elapsed at stopwatch 0:24.28, the flash under 30 s and a hand retrigger. With package 8c886466 (reverse playback): a trial with track 1 at RATE below 0 counted down to 0:00 with the stopwatch, restarted from the end on a trig, measured -10,749 and +7,440 frames a second as RATE changed; tracks 2 and 3 as before. The install with Keep, power cycle and Undo were run with 0506a245, not repeated with 8c886466. With the published package 0b54a734 (the same source titled as ABI 8 by octatrack:module-packages), on a base rebuilt from current main (9b3ba417): install with Keep, the inventory naming it \"tiempos\", CUE + MIDI opening TIEMPOS, the set restored after a power cycle with TIEMPOS opening again, and Undo back to the empty set.", + "limitations": [ + "One MKI; no MKII.", + "The stopwatch figures come from the developer's photos and readings; the voice fields were not read directly (a released base answers no mem request).", + "Part changes, project reloads, timestretch modes other than NORMAL and other modules beside Tiempos were not run.", + "Draw cost estimated in the emulator, not measured on the unit; no static bound and no MIDI flood.", + "Reverse playback: one trial; no stopwatch figure written down for the reversed track; RATE 0 on an active voice covered by the host test only.", + "Timing, reverse and load checks ran on the earlier base 24a0ed57 with packages of the same or earlier sources; on base 9b3ba417 only the install, power cycle and Undo." + ], + "report": "TESTING.md" + } + } + }, + "license": { + "spdx": "GPL-3.0-or-later", + "file": "LICENSE", + "declaration": "Original code by the author, GPL-3.0-or-later. The 3x5 font is original. No Elektron firmware, extracted routines or tables." + }, + "media": [ + { + "path": "media/ot-tiempos-open.png", + "captureType": "hardware", + "caption": "Hold CUE and press MIDI from any page. Each row is one track: a filled number plays, an outlined one is loaded and stopped, a dotted one is empty. The bar shows what is left, then the time left and the total at the current tempo.", + "alt": "Tiempos screen on an Octatrack: tracks 1 to 3 with full bars, 1:48 left and 1:49 total each; tracks 4 to 8 dotted with --:--.", + "credit": "imdantelo; Elektron Octatrack UI", + "license": "LicenseRef-OT-UI-Documentation", + "source": "original", + "otUi": { + "page": "TIEMPOS", + "shows": "location-and-controls", + "firmware": "1.40C", + "moduleVersion": "0.1.0-experimental", + "imageSha256": "739c9d4f228d58bd542563d2d35ccb6f84828f0c87cd914c0505912e42259c89", + "setup": "Phone photograph of the LCD of the developer's Octatrack MKI (OS 1.40C, released Modwerk base 24a0ed57), cropped to the screen and not otherwise edited; three 64-bar test tones at 100, 120 and 140 BPM on tracks 1-3, project at 140 BPM, 30 October 2026. Taken with package 225a0170; package 0506a245 changes only key handling (the double press), and tiempos.c's drawing code is the same in both. Just after PLAY." + } + }, + { + "path": "media/ot-tiempos-last-30s.png", + "captureType": "hardware", + "caption": "In a track's last 30 seconds its time left flashes inverted. Track 1 was retriggered by hand, so it shows 1:15 left while tracks 2 and 3 are almost at the end. LEFT or RIGHT switches the last column between total and elapsed time.", + "alt": "Tiempos screen: track 1 at 1:15 left of 1:49; tracks 2 and 3 with their time left shown inverted; tracks 4 to 8 empty.", + "credit": "imdantelo; Elektron Octatrack UI", + "license": "LicenseRef-OT-UI-Documentation", + "source": "original", + "otUi": { + "page": "TIEMPOS", + "shows": "controls", + "firmware": "1.40C", + "moduleVersion": "0.1.0-experimental", + "imageSha256": "739c9d4f228d58bd542563d2d35ccb6f84828f0c87cd914c0505912e42259c89", + "setup": "Phone photograph of the LCD of the developer's Octatrack MKI (OS 1.40C, released Modwerk base 24a0ed57), cropped to the screen and not otherwise edited; three 64-bar test tones at 100, 120 and 140 BPM on tracks 1-3, project at 140 BPM, 30 October 2026. Taken with package 225a0170; package 0506a245 changes only key handling (the double press), and tiempos.c's drawing code is the same in both. At stopwatch 1:22, during the flash." + } + } + ] } ] } diff --git a/src/community/module-changelogs/tiempos.json b/src/community/module-changelogs/tiempos.json new file mode 100644 index 000000000..1a33b48e7 --- /dev/null +++ b/src/community/module-changelogs/tiempos.json @@ -0,0 +1,13 @@ +[ + { + "version": "0.1.0-experimental", + "date": "2026-11-02", + "changes": [ + "New: hold CUE and press MIDI to see the time left on all eight audio tracks on one screen.", + "The time left is real time: it follows timestretch, repitch, tempo changes and RATE, forwards or backwards, and flashes in the last 30 seconds.", + "Close it with NO or CUE + MIDI; a track key pressed twice closes it and opens that track's QUICK ASSIGN, as on stock. LEFT and RIGHT switch the right column between total and time played.", + "Needs the Modwerk base loaded over USB, which is in the beta. Card firmware cannot include it. While installed, CUE + MIDI no longer switches to the MIDI tracks; MIDI alone still does.", + "Known issues: a track shows as empty until it has played once since the project loaded, and again when it reaches its start playing backwards; a looping track shows the time to the end of the sample." + ] + } +] diff --git a/src/engine/assets/octatrack-module-packages.json b/src/engine/assets/octatrack-module-packages.json index e3c45eccc..cca3a9281 100644 --- a/src/engine/assets/octatrack-module-packages.json +++ b/src/engine/assets/octatrack-module-packages.json @@ -537,6 +537,23 @@ "module": "9b41cd3d", "bytes": 196, "sha256": "de7f9caed60bffecc47a33144a223125500c4c8bcbd76e5022d1dc2ee9393600" + }, + { + "id": "tiempos", + "sources": [ + "sdk/octabam/modules/tiempos/tiempos.c" + ], + "version": "0.1.0-experimental", + "path": "octatrack-modules/tiempos/0.1.0-experimental.mwrm", + "abi": 8, + "features": 0, + "sites": 0, + "copies": 0, + "fills": 0, + "name": "tiempos", + "module": "31282ae5", + "bytes": 2852, + "sha256": "0b54a734258945acbf74551b8920ee4bfa760d390964bd04d2877e4382e990b9" } ] } diff --git a/src/engine/elekloader/module-set.test.ts b/src/engine/elekloader/module-set.test.ts index 584d0940d..d0051a8e4 100644 --- a/src/engine/elekloader/module-set.test.ts +++ b/src/engine/elekloader/module-set.test.ts @@ -13,7 +13,7 @@ const empty = { moduleIds: [], removedStockFx: [] } describe('the site’s runtime packages', () => { it('publishes each listed module with its checked runtime identity, ABI and record counts', () => { - expect(USB_MODULE_IDS).toEqual(['everb', 'miniverb', 'tapehead', 'airwindows-chorus', 'lofi2', 'ring-sc', 'previewvol', 'apply-scene', 'repitch', 'poly8', 'vector', 'synth', 'quantizer', 'tapeecho', 'euclid', 'bbd', 'playmodes', 'mute-modes', 'sidechain-compressor', 'output-matrix', 'cc-map', 'quantize-live-rec-toggle', 'direct-jump-kyoti', 'dejavu', 'arp-key-locks', 'recorder-loop-fix', 'analog-bassdrum', 'beat-slicer', 'temp-save', 'slow-lfo', 'bar-led', 'usb-audio-out-tracks-main-cue']) + expect(USB_MODULE_IDS).toEqual(['everb', 'miniverb', 'tapehead', 'airwindows-chorus', 'lofi2', 'ring-sc', 'previewvol', 'apply-scene', 'repitch', 'poly8', 'vector', 'synth', 'quantizer', 'tapeecho', 'euclid', 'bbd', 'playmodes', 'mute-modes', 'sidechain-compressor', 'output-matrix', 'cc-map', 'quantize-live-rec-toggle', 'direct-jump-kyoti', 'dejavu', 'arp-key-locks', 'recorder-loop-fix', 'analog-bassdrum', 'beat-slicer', 'temp-save', 'slow-lfo', 'bar-led', 'tiempos', 'usb-audio-out-tracks-main-cue']) for (const entry of manifest.packages) { const data = file(entry.path), view = new DataView(data.buffer), abi = view.getUint16(4) expect(entry.path).toBe(`octatrack-modules/${entry.id}/${entry.version}.mwrm`)