NSM - A fast plug-in and pathing system for Octamed. Current version: 0.75 Last updated: 18.12.99 INTRODUCTION: Some time ago, I started to look at the arexx- system of Octamed Soundstudio for the amiga. I soon realised that it was extremely powerfull, and that I would use it a lot in the future. But there was one major drawback on it, and that was the speed. Even if I had bought an 060, the responce-time would be awful, so I started peeking and leeking around in the memory trying to find out if I in some way could read and write the data directly. And the result of that is is this new plug-in system. It can not do everything that the arexx-system does, but lucky enough, there are some functions that let you send octarexx-messages to the OCTAREXX-port, and then you can do everything! There are over 80 assembler-functions and c-macros you can use, so the use of octarexx-commands should be very little. I have found out that the nsm plug-ins are sometimes thousends of times faster than the arexx-scripts doing just the same. Plug-ins that only contains sendrexx-commands (quite rare) (the commands that sends an octarexx-command to the OCTAMED_REXX-port) are about 30% faster than an arexx-script doing just the same. USAGE A better description lies in the nsm_short.usage-file, but a more detailed usage-description comes here: 1. Start the nsm-port. Put the following line into your user-startup (or startup-sequence) file: "Run >NIL: (path)/nsm/nsmport/nsmport" 2. Patch Octamed Soundstudio 1.03c. 1.03c is the only version that you can use the nsm plug-ins with. The patch should be quite safe, but if you don't trust me on that; make a copy before you patch! run "nsm/patch/octapatch " 3. Make a directory in RAM:, and assign it as NSM: After that, copy your plug-ins into that directory. This increase the response-time on the plug-ins a lot. Insert the following lines into your user-startup file (or startup-sequence): " makedir ram:NSM assign NSM: "ram:NSM" copy dh2:nsm/plug-ins/#?/~(#?.#?|SCOPTIONS) nsm: " Reset your amiga. 4. Start octamed (the one you patched). Go to the settings- menu, and choose "Keyboard Shortcuts". Add your plug-ins the same way as with your old arexx-scripts, except that instead of choosing "Execute Arexx-file" in the Action-box, choose "Launch Program" instead. PROBLEMS 1. When you try to patch, you get the following message: "This is not the right version of Octamed Soundstudio 1.03c Excpected 246696 bytes, found 443596." This means that you try to patch the uncrunched version of Octamed Soundstudio 1.03c. Earlier this version was submitted on the homepage of octamed (http://www.octamed.co.uk), but now they have changed the archive. It's still the same program, but packed to save some bytes. Ok, now do two things. 1. Download the packed version from the octamed homepage. 2. (optional, but recommended) Mail me your unpacked version of Octamed 1.03c so I can make a patch for that version too. I had that version before, but I managed to destroy it. 2. The patched version of octamed crashes! Oops! that is not supposed to happen. Please mail me your configuration, snoopdos-log, your octamed-file, when it crashes etc. (Note: I have never discovered this happening, and don't excpect it to happen for you either. But you never know...) 3. None of the plug-ins are working. It can be that the shortcut you are trying to use are allready occupied by another plug-in or octamed-command. Octamed will not report about this problem, only ignore your new setting. Try selecting another short-cut. If that doesn't help either, read on: If you are shure that you have started the nsmport, and running the patched version of octamed (you can check that by looking at the size. If octamed is 246856 bytes long, it is patched. If it is 246696 bytes long, its not patched.), send me your configuration and I will answer you as fast as possible. And if you are a beginner to the amiga, it would may be smarter to ask on a newsgroup instead. Allso remember to start the NSM-port in the startup-sequence or in the user-startup file. It doesn't take up any resources, except for about a kilobyte of memory. If you start the nsm-port right before you start octamed (in a script for example), its possible that things wont work. BUGS 1. The isplaying-function doesn't allways work. TODO 1. Make a shared library out of the assembler source-code. 2. Make an amigaguide-file from the "autodoc"-file. 3. Update the nsm-system to work with OSSV2 when that version comes. (hmmm, I really hope OSSV2 will have something like NSM built in instead, to be hounest.) 4. Write a better documentation. 5. Write an installer-script. 6. Write some more plug-ins. (thats for shure, I will do, for certain) Please feel free to do this things, if you want. And send it to me, and I will (ofcourse) credit you. If there are other things you think are missing, feel free to do it. COMPATIBILITY Ofcourse, This system will only work with the ONE program, and that is octamed soundstudio 1.03c, (and not the 1.03c that was included with CU-amiga some years ago). But, as long as you distribute your sources with your plug-ins, it will allways be possible to use them in the future. Why? Because you (or someone else) only have to recompile when a new version of octamed comes out. I will ofcourse update the archive when new versions of octamed comes out. (Whenever that happens, I bet we wont see a new version of octamed on a very long time yet.) But ok. To recompile all the plug-ins for each new release of octamed is a little bit stupid. Therefore, what really has to be done, is to make a shared library out of the assembler- source. If anyone does this, the compatibility with future versions should be very safe. I am not very capable of doing those library-stuff things, and as long as I am the only one supporting this system right now, I have no motivation for doing it. But if people start sending me plug-ins, I will absolutely consider making a shared library for it. Should not be too hard... But; you may think that "updating for new versions" is not necesarry that easy. And yes, you are right. We now know very little about how OSS V2 will look. But it should be safe to presume that all the old REXX-commands will still work on the new versions. And then, if it seems to be extremely difficult to find out how to make that and that command for the new versions in the library-file, its just replacing them with the rexx-commando doing just the same until someone finds out how to implement the function directly. Allso, if this system gets popular, I really hope that the new developers of octamed will support it in some way. (but, well, we will have to see about that one. :) CHANGES Changes from V0.74b to V0.75: 1. Fixed a bug in the isranged function. Previously it only reported true if the range was visible. Bug found by Johan Persson (for nearly a year ago). Has allso recompiled the markrange program so that it now works properly. 1. Made an amigaguide file for the "autodoc", and explained how to process stereo-samples. 2. Added the following functions: getsampletype gethq gettempo gettempolpb gettempomode gettempotpl gettrackvol settrackvol Changes from V0.74 to V0.74b: 1. Included the following function: - editonof 2. Fixed the getoctabase bug. (discovered by Claude Heiland-Allen) 3. Updated the manual a bit. (Its around 10 months since the previous version!) Changes from V0.73b: 1. Included the following functions: - Setlinehiglight - Unsetlinehighlight Changes from V0.73: 1. Updated the manual. Changes from V0.72: 1. Added the following functions: getcurroctave(OCTABASE octabase) 2. Fixed a bug in the following functions: getfinetune gethold getdecay getdefaultpitch getextendedpreset getmidichannel getmidipreset getcurrinstrument getsuppressnoteonof gettranspose getvolume getloopstart getlooplength getloopstate getlooppingpong getdisable Changes from V0.71: 1. Added the following functions: getnumblocks(OCTABASE octabase). This function did actually exsist in the octacontrol.a-file allready, but not in the header-file and in the autodoc-file. istrackon(OCTABASE octabase,WORD track). Does the same as the octarexx-function. isplaying(OCTABASE octabase). Returns 1 if octamed is playing, 0 if not. (beware that this doesn't allways work, so if you want to be absolutely shure, use the octarexx-isplaying function instead.) 2. Fixed the getinname-function. Changes from V0.70: 1. Added 22 new functions: getsamplebase getcurrsamplebase getsamplelength getsample setsample getfinetune gethold getdecay getdefaultpitch getextendedpreset getmidichannel getmidipreset getcurrinstrument getsuppressnoteonof getinname gettranspose getvolume getloopstart getlooplength getloopstate getlooppingpong getdisable 2. Removed the "memory-loss"-problem in the BUGS-section of this manual. The "bug" was in the port-program, and I had allready fixed it before I released V0.70. It wasn't a memory-loss at all, just me being stupid. DEVELOPMENT To make your own plug-ins, you should know either c or E, and a tiny bit of arexx. Look at the example-plug ins included in this package, and read the nsm_autodoc.guide-file. (it's not really an autodoc-file, but that doesn't matter, you can read it anyway.) It's allso possible to use other languages than c or E (even arexx), but there isn't customized anything for other languages. If you do, please send it to me, so I can include it in the next release. Allso; If you make a plug-in you think other people should know about, send it to me, and I will put it on the nsm-homepage. (remember to include the source). It's allso smart to put it on the aminet, I suppose. NEW from V0.74: Claude Heiland-Allen has customized NSM for the E-language, means that it is very easy to program plug-ins for NSM in the e-language, not only in c and assembler anymore. DISCLAIMER 1. Do what you want, but don't rerelease anything related to NSM without crediting me for what I or Claude Heiland-Allen have done. 2. When making plug-ins, you _must_ include the source-file!!! (alternatively release the source in a seperate archive and write in the user-archive where the source can be obtained). Its a very good habit to release the source, and I don't see why you shouldn't. Especially in the Amiga-world, which is actually dying. 3. You are allowed to release commersial software, shareware, etc., using the NSM-system, as long as all the sources for the program are freely available to the public. But you are not allowed to release non-freeware programs if you use source that is based on the playing-source that was released with octamed, written by Teijo Kinnunen. But non of the sources that is in this NSM package is based on that. The NSM midipatches is, though. So, if you don't release the source; I'll sue you!! He he. 4. When making programs based on the sources in this package, you must include this four points into the disclaimer of your program in some way. This can very easely be done by just writing somewhere in your program that your program is made by using the NSM-system and writing the URL to the nsm-page on the internet (http://www.stud.ifi.uio.no/~ksvalast/nsm/). COPYING Yes, you can! FINAL NOTES The plug-ins should be very safe if programmed correctly. (by using the included assembler-functions, not by poking directly). That means there should be a very small risk crashing octamed when using the plug-ins, as long as the plug-ins itself doesn't crash the amiga ofcourse. CREDITS Kjetil S. Matheussen - Main hacker. Claude Heiland-Hallen - E development kit. Allso thanks to RBF-soft for letting me put the patched version of Octamed on the NSM-homepage, Tony Horgan for writing a nice two-page article in Amiga Format about the NSM-system, Johan Persson for finding some bugs, and to various other people for support and suggestions. CONTACT Kjetil S. Matheussen 5423 Sogn Studentby 0858 Oslo Norway e-mail: ksvalast@ifi.uio.no nsm-homepage: http://www.stud.ifi.uio.no/~ksvalast/nsm/ octamed-homepage: http://www.octamed.co.uk/ Kjetil S. Matheussen.