diff options
author | Steve M. Robbins <smr@debian.org> | 2011-10-22 04:54:51 +0200 |
---|---|---|
committer | Steve M. Robbins <smr@debian.org> | 2011-10-22 04:54:51 +0200 |
commit | dd657ad3f1428b026486db3ec36691df17ddf515 (patch) | |
tree | 6ffb465595479fb5a76c1a6ea3ec992abaa8c1c1 /sys |
Import nyquist_3.05.orig.tar.gz
[dgit import orig nyquist_3.05.orig.tar.gz]
Diffstat (limited to 'sys')
82 files changed, 12898 insertions, 0 deletions
diff --git a/sys/mac/MacAE.c b/sys/mac/MacAE.c new file mode 100644 index 0000000..34b9224 --- /dev/null +++ b/sys/mac/MacAE.c @@ -0,0 +1,58 @@ +/* Handle required apple events -EAD */ + +#include <Files.h> +#include <string.h> +#include <AppleEvents.h> +#include "macstuff.h" +#include "MacCommandWin.h" +#include "MacFileUtils.h" +//#include "MiscellaneousUtilities.h" + +#define TEXTREC (*hTERec) // the command +extern TEHandle hTERec; // window text record + + +//========================================================================= +// Handle quit apple event +//========================================================================= + +pascal OSErr AEQuit (AppleEvent *theAppleEvent, AppleEvent *theReply, long Refcon) +{ + osfinish(); +} + +//========================================================================= +// Handle Open Document apple event by trying to load it. +//========================================================================= +extern xlload (char *, int, int); +extern xlabort(char *); + +pascal OSErr AEOpenFiles(AppleEvent *theAppleEvent, AppleEvent *theReply, + long Refcon) +{ + AEDescList docList; + AEKeyword keywd; + DescType returnedType; + Size actualSize; + long itemsInList; + FSSpec theSpec; + CInfoPBRec pb; + Str255 name; + short i; + + if (AEGetParamDesc(theAppleEvent, keyDirectObject, typeAEList, &docList) != + noErr) return; + if (AECountItems (&docList, &itemsInList) != noErr) return; + + SetSelection (TEXTREC->teLength, TEXTREC->teLength); + for (i = 1; i <= itemsInList; i++) { + AEGetNthPtr (&docList, i, typeFSS, &keywd, &returnedType, + (Ptr) &theSpec, sizeof(theSpec), &actualSize); + + GetFullPath(&theSpec, name); + P2CStr(name); // was: pstrterm(name); + if (xlload ((char *)name + 1, 1, 0) == 0) xlabort ("load error"); + } + macputs ("> "); + PrepareForInput (); +} diff --git a/sys/mac/MacCommandWin.c b/sys/mac/MacCommandWin.c new file mode 100644 index 0000000..c3336aa --- /dev/null +++ b/sys/mac/MacCommandWin.c @@ -0,0 +1,764 @@ +//============================================================================= +// All command window updates, input, etc happen here -EAD +//============================================================================= +#include <Controls.h> +/* #include <ControlDefinitions.h> */ +#include <Events.h> +#include <Fonts.h> +#include <MacWindows.h> +#include "MacGlobals.h" +#include "macint.h" +#include <ctype.h> +#define NIL ((void *) 0) + +//============================================================================= +// local variables +//============================================================================= + +ControlHandle vScroll; +int cursorPos; /* the cursor's position on the line */ +short linesInView; /* how many lines are in the window */ +int cmdStart; /* where (in text record) the current command starts */ +TextStyle textStyle[2]; /* styles: bold for user input, plain for output */ +/* output is buffered */ +Handle hOutputBuffer = NULL; +enum currentStyle { plainStyle, boldStyle } currentStyle; + +static void GoStartOfLine (void); +static void GoEndOfLine (void); +static void GoBackOneWord (void); +static void GoForwardOneWord (void); + +//============================================================================= +// static void DoScrollBar (ControlHandle control, short change) +//============================================================================= +/* keep track of the user as he fiddles with the scroll bar */ +/* This routine is called while the user has the mouse down. */ +/* It makes sure the thumb isn't dragged out-of-bounds. */ +//============================================================================= + +static void DoScrollBar (ControlHandle control, short change) { + short value = GetControlValue (control), max = GetControlMaximum (control); + long newval = value + change; /* this is a long in case we try to go past MAX_INT */ + if (newval < 0) newval = 0; else if (newval > max) newval = max; + SetControlValue (control, (short) newval); + if (newval != value) TEScroll (0, (short) (value - newval) * LINEHEIGHT, hTERec); +} + +//============================================================================= +// pascal Boolean ScrollClickLoop (void) +//============================================================================= +// +//============================================================================= + +pascal Boolean ScrollClickLoop (void) { + Rect tempRect; + Point mouse; + GrafPtr oldPort; + RgnHandle oldClip; + short amount = 0; + + if (FrontWindow () != gCommandWin) return false; + + GetPort (&oldPort); + SetPort (gCommandWin); + GetClip (oldClip = NewRgn ()); + SetRect (&tempRect, INT_MIN, INT_MIN, INT_MAX, INT_MAX); + ClipRect (&tempRect); + + GetMouse (&mouse); + if (mouse.v < TEXTREC->viewRect.top) DoScrollBar (vScroll, -1); + else if (mouse.v > TEXTREC->viewRect.bottom) DoScrollBar (vScroll, 1); + + SetClip (oldClip); + DisposeRgn (oldClip); + SetPort (oldPort); + return true; +} + +//============================================================================= +// static pascal void ScrollProc (ControlHandle control, short thePart) +//============================================================================= +// for clicks in the scroll bar or arrows; update the window properly +//============================================================================= + +pascal void ScrollProc (ControlHandle control, short thePart) { + short amount; + WindowPtr window; + + if (!thePart) return; + window = (*control)->contrlOwner; + switch (thePart) { + case kControlUpButtonPart: amount = -1; break; + case kControlDownButtonPart: amount = 1; break; + case kControlPageUpPart: amount = -linesInView; break; + case kControlPageDownPart: amount = linesInView; break; + } + DoScrollBar (control, amount); +} + +//============================================================================= +// Rect SetTERect (void) +//============================================================================= +// set the dimensions of the text record in its window +//============================================================================= + +Rect SetTERect (void) { + Rect teRect = gCommandWin->portRect; + teRect.right -= SCROLLER_WIDTH; + InsetRect (&teRect, TEXT_MARGIN, TEXT_MARGIN); + linesInView = (teRect.bottom - teRect.top) / LINEHEIGHT; + teRect.bottom = teRect.top + linesInView * LINEHEIGHT; /* round off */ + return teRect; +} + +//============================================================================= +// static void AdjustCursor (EventRecord *theEvent) +//============================================================================= +// make the pointer an I-beam iff it's in the text window +//============================================================================= + +void AdjustCursor (Point theLoc, RgnHandle theRgn) +{ + RgnHandle arrowRgn, iBeamRgn, hiliteRgn, tempRgn; + Rect theRect; + Point thePoint; + + if (gInBackground) + return; + + arrowRgn = NewRgn(); + SetRectRgn(arrowRgn, -32767, -32767, 32767, 32767); + +// GlobalToLocal ((theLoc); ??? + + if (gCommandWin == FrontWindow () ) { + SetPort(gCommandWin); + iBeamRgn = NewRgn(); + hiliteRgn = NewRgn(); + + theRect = TEXTREC->viewRect; + LocalToGlobal((Point *)&(theRect.top)); + LocalToGlobal((Point *)&(theRect.bottom)); + RectRgn(iBeamRgn, &theRect); + + TEGetHiliteRgn(hiliteRgn, hTERec); + thePoint.h = thePoint.v = 0; + LocalToGlobal(&thePoint); + OffsetRgn(hiliteRgn, thePoint.h, thePoint.v); + + DiffRgn(arrowRgn, hiliteRgn, arrowRgn); + DiffRgn(arrowRgn, iBeamRgn, arrowRgn); + + DiffRgn(iBeamRgn, hiliteRgn, iBeamRgn); + + if (PtInRgn(theLoc, iBeamRgn)) { + SetCursor(*GetCursor(iBeamCursor)); + CopyRgn(iBeamRgn, theRgn); + } else if (PtInRgn(theLoc, hiliteRgn)) { + SetCursor(&qd.arrow); + CopyRgn(hiliteRgn, theRgn); + } else { + SetCursor(&qd.arrow); + CopyRgn(arrowRgn, theRgn); + } + + DisposeRgn(iBeamRgn); + DisposeRgn(hiliteRgn); + + } else { + SetCursor(&qd.arrow); + CopyRgn(arrowRgn, theRgn); + } + + DisposeRgn(arrowRgn); +} + + + +//============================================================================= +// static void SetScrollRect (void) +//============================================================================= +// Set Scroll bar rec size +//============================================================================= + +void SetScrollRect (void) { + /* set the dimensions of the scroll bar in its window */ + +// This change fixes the double flash on window resize -EAD + +// MoveControl (vScroll, commandWin->portRect.right - SCROLLER_WIDTH, -1); +// SizeControl (vScroll, SCROLLER_WIDTH + 1, +// (commandWin->portRect.bottom - commandWin->portRect.top) - (SCROLLER_WIDTH - 2)); + (*vScroll)->contrlRect.left = gCommandWin->portRect.right - SCROLLER_WIDTH; + (*vScroll)->contrlRect.top = -1; + (*vScroll)->contrlRect.right = gCommandWin->portRect.right + 1; + (*vScroll)->contrlRect.bottom = gCommandWin->portRect.bottom - (SCROLLER_WIDTH - 1); + +} + +//============================================================================= +// static void AdjustScrollBar (void) +//============================================================================= +// Set the thumb on scrollbar +//============================================================================= + +static void AdjustScrollBar (void) { + /* adjust the scroll bar to match the position of the text view */ + short oldval = GetControlValue (vScroll), oldmax = GetControlMaximum (vScroll); + short value, max; + short test; + + max = TEXTREC->nLines - linesInView; + if ((TEXTREC->teLength > 0) && (*(*TEXTREC->hText + TEXTREC->teLength - 1) == '\r')) max++; + if (max < 0) max = 0; + if (max != oldmax) SetControlMaximum (vScroll, max); + value = (short)((TEXTREC->viewRect.top - TEXTREC->destRect.top) / LINEHEIGHT); +// value = roundup ((TEXTREC->viewRect.top - TEXTREC->destRect.top) / LINEHEIGHT); + if (value < 0) value = 0; else if (value > max) value = max; + if (value != oldval) SetControlValue (vScroll, value); +} + +static short roundup (float x) { /* a kludge to round up a float to an int */ + if (((int) x) != ((int) (x += 0.5))) x += 0.5; + return (int) x; +} + +//============================================================================= +// void DoKeyPress (EventRecord *theEvent) +//============================================================================= +// Hanlde Keyboard Input +//============================================================================= + +void DoKeyPress (EventRecord *theEvent) { + short whatKey = theEvent->message & charCodeMask; + if (theEvent->modifiers & cmdKey) { + long choice; + AdjustMenus (); + if (choice = MenuKey (theEvent->message)) DoMenu (choice); + else if (((whatKey == 'w') || (whatKey == 'W')) && (FrontWindow () == gGraphicsWin)) + HideGrafWin (); + else if (whatKey == LEFTARROW) GoStartOfLine (); + else if (whatKey == RIGHTARROW) GoEndOfLine (); + else if (whatKey == UPARROW) DoScrollBar (vScroll, - linesInView); + else if (whatKey == DOWNARROW) DoScrollBar (vScroll, linesInView); + } + else if (theEvent->modifiers & optionKey) { + if (whatKey == LEFTARROW) GoBackOneWord (); + else if (whatKey == RIGHTARROW) GoForwardOneWord (); + } + else switch (whatKey) { + case PAGEUP: DoScrollBar (vScroll, -linesInView); break; + case PAGEDN: DoScrollBar (vScroll, linesInView); break; + case HOMEKEY: DoScrollBar (vScroll, INT_MIN); break; + case ENDKEY: DoScrollBar (vScroll, INT_MAX); break; + case FNKEY: break; + case HELPKEY: break; + default: recentChar = theEvent->message & charCodeMask; + } +} + +//============================================================================= +// static void DrawOnlyGrowIcon (WindowPtr window) +//============================================================================= +// draw growbox on command window with no scoll bars +//============================================================================= + +static void DrawOnlyGrowIcon (WindowPtr window) +{ + RgnHandle saveRgn; + Rect growRect; + + growRect = window->portRect; + growRect.top = growRect.bottom - SCROLLER_WIDTH; + growRect.left = growRect.right - SCROLLER_WIDTH; + GetClip (saveRgn = NewRgn ()); + ClipRect (&growRect); + DrawGrowIcon (window); + SetClip (saveRgn); + DisposeRgn (saveRgn); +} + +//============================================================================= +// void SetSelection (short start, short end) +//============================================================================= +// set text selection in the command window +//============================================================================= + +void SetSelection (short start, short end) { + TEXTREC->clikStuff = 255; /* to make sure the caret appears at the start of a line when it should */ + /* see tech note "TextEdit EOL Ambiguity" for more information */ + TESetSelect (start, end, hTERec); +} + +//============================================================================= +// static void CancelFlash (void) +//============================================================================= +// cancel the matching-paren flashing +//============================================================================= + +static void CancelFlash (void) { + if (flashTime) { + flashTime = 0; + SetSelection (cursorBeforeFlash, cursorBeforeFlash); + } +} + +//============================================================================= +// static void StopPasting (void) +//============================================================================= +// clean up after finishing a paste +//============================================================================= + +void StopPasting (void) { + pastedLength = 0; + if (pastedTextH) { + DisposeHandle (pastedTextH); + pastedTextH = NULL; + } +} + +//============================================================================= +// static void DoStyle (int whatStyle) +//============================================================================= +// set the text to a certain style +//============================================================================= + +static void DoStyle (int whatStyle) { + TESetStyle (doFace, &(textStyle[whatStyle]), false, hTERec); +} + +//============================================================================= +// static void FlushOutput (void) +//============================================================================= +// clear out the output buffer, dumping its contents to the window +//============================================================================= + +void FlushOutput (void) { + short totalLines, scrollAmount, max; + + if (outputBufferLength == 0) return; + CancelFlash (); + DoStyle (plainStyle); + HLock (hOutputBuffer); + TEInsert (*hOutputBuffer, outputBufferLength, hTERec); + HUnlock (hOutputBuffer); + outputBufferLength = 0; + + if (TEXTREC->teLength > SCROLLBACK_THRESHHOLD) { + /* make sure TE record isn't too long */ +#ifdef ORIGINALCODE + /* I replaced this because Nyquist was crashing after the + buffer got filled. The replacement below is simpler and + eliminates the crashes, although it probably could cause + problems by clearing the selection. + */ + int i = 1, newLength; + TEPtr textPtr; + while ((TEXTREC->teLength - TEXTREC->lineStarts[i]) > + (SCROLLBACK_THRESHHOLD - DELETE_BLOCK)) i++; + i = TEXTREC->lineStarts[i]; + newLength = TEXTREC->teLength - i; + textPtr = (TEPtr)(*(TEXTREC->hText)); + BlockMoveData ((Ptr)((long)textPtr + i), textPtr, newLength); + SetHandleSize (TEXTREC->hText, newLength); + TEXTREC->destRect.top += LINEHEIGHT; + TECalText (hTERec); + TEUpdate (&(TEXTREC->viewRect), hTERec); +#else + /* find the line start after DELETE_BLOCK */ + int i = 1; + while (TEXTREC->lineStarts[i] < DELETE_BLOCK) i++; + TESetSelect(0, TEXTREC->lineStarts[i], hTERec); + TEDelete(hTERec); + /* after deletion, put cursor back at end of buffer */ + TESetSelect(TEXTREC->teLength, TEXTREC->teLength, hTERec); +#endif + } + TESelView (hTERec); + AdjustScrollBar (); +} + +//============================================================================= +// void PrepareForInput (void) +//============================================================================= +// get ready to take input +//============================================================================= + +void PrepareForInput (void) { + FlushOutput (); + cmdStart = TEXTREC->selStart; +} + +//============================================================================= +// static void DeleteRange (void) +//============================================================================= +// delete the selected range of text, updating cmdStart as necessary +//============================================================================= + +void DeleteRange (void) { + if (TEXTREC->selEnd <= cmdStart) return; + if (TEXTREC->selStart < cmdStart) SetSelection (cmdStart, TEXTREC->selEnd); + TEDelete (hTERec); +} + +//============================================================================= +// static void CopyThisLineToEnd (void) +//============================================================================= +// copy the line the caret is on to the end +//============================================================================= + +static void CopyThisLineToEnd (void) { + char *buffer; + short b, i, caretOffset; + + /* first find out exactly where it starts */ + i = TEXTREC->nLines-1; /* first find which line */ + while (TEXTREC->selStart < TEXTREC->lineStarts[i]) i--; + while ((i > 0) && ((*(TEXTREC->hText))[TEXTREC->lineStarts[i]-1] != '\r')) + i--; /* for wrapped lines */ + i = TEXTREC->lineStarts[i]; /* now zero in on the exact character where it begins */ + while ((TEXTCHAR(i) >= '0') && (TEXTCHAR(i) <= '9')) i++; /* skip error level */ + if ((TEXTCHAR(i) == '>') && (TEXTCHAR(i+1) == ' ')) i+=2; /* get rid of leading prompt */ + + caretOffset = TEXTREC->selStart - i; /* how many characters in is the caret? */ + + /* now put the line into the buffer */ + b = 0; + while ((TEXTCHAR(i+b) != '\r') && (i+b < TEXTREC->teLength)) b++; /* find the end of the line */ + buffer = (char *) NewPtr (b); + BlockMoveData (*TEXTREC->hText + i, buffer, b); + buffer[b] = '\0'; + + /* delete whatever's already on the last line */ + SetSelection (cmdStart, TEXTREC->teLength); + TEDelete (hTERec); + + DoStyle (boldStyle); + TEInsert (buffer, b, hTERec); + DisposePtr (buffer); + + if (caretOffset < 0) caretOffset = b; + SetSelection (cmdStart + caretOffset, cmdStart + caretOffset); +} + +//============================================================================= +// Next four functions possition cursor in text +//============================================================================= + +static void GoStartOfLine (void) { + short whichLine = TEXTREC->nLines - 1; /* look for the caret; start at the end and go up */ + while (TEXTREC->lineStarts[whichLine] > TEXTREC->selStart) whichLine--; + SetSelection (TEXTREC->lineStarts[whichLine], TEXTREC->lineStarts[whichLine]); + AdjustScrollBar (); +} + +static void GoEndOfLine (void) { + short whichLine = TEXTREC->nLines - 1; /* look for the caret; start at the end and go up */ + while (TEXTREC->lineStarts[whichLine] > TEXTREC->selStart) whichLine--; + if (whichLine == TEXTREC->nLines - 1) + SetSelection (TEXTREC->teLength, TEXTREC->teLength); + else SetSelection (TEXTREC->lineStarts[whichLine+1] - 1, TEXTREC->lineStarts[whichLine+1] - 1); + AdjustScrollBar (); +} + +static void GoBackOneWord (void) { + short i = TEXTREC->selStart; + while ((i > 0) && !isalnum (TEXTCHAR(i-1))) i--; + while ((i > 0) && isalnum (TEXTCHAR(i-1))) i--; + SetSelection (i, i); +} + +static void GoForwardOneWord (void) { + short i = TEXTREC->selStart; + while ((i < TEXTREC->teLength) && !isalnum (TEXTCHAR(i))) i++; + while ((i < TEXTREC->teLength) && isalnum (TEXTCHAR(i))) i++; + SetSelection (i, i); +} + + +//============================================================================= +// static void EditFreely (void) +//============================================================================= +// Enter text into the command windows +//============================================================================= + +static void EditFreely (void) { + Boolean done; + do { + done = false; + DoEvent (); + if (pastedLength > 0) { /* if there is still text to paste, paste it */ + int i = 0; + CancelFlash (); + if (TEXTREC->selStart < cmdStart) StopPasting (); + else { + while ((i < pastedLength) && (((char *)(*pastedTextH))[i] != '\r')) i++; + DoStyle (boldStyle); + TEInsert (*pastedTextH, i, hTERec); + AdjustScrollBar (); + if (i < pastedLength) { /* we were stopped by a carriage return, so eat it */ + i++; + done = true; + } + pastedLength -= i; + if (pastedLength > 0) { + BlockMoveData ((Ptr)((long)(*pastedTextH) + i), *pastedTextH, pastedLength); + SetHandleSize (pastedTextH, pastedLength); + } else StopPasting (); + } + } + else if (recentChar) { /* if the last event got us a character, process it */ + int i; + Boolean wasOnLastLine; + CancelFlash (); + + if ((TEXTREC->selEnd <= cmdStart) && (TEXTREC->selStart != TEXTREC->selEnd)) continue; + if (TEXTREC->selStart < cmdStart) SetSelection (cmdStart, TEXTREC->selEnd); + wasOnLastLine = (TEXTREC->selStart >= cmdStart); + + if ((recentChar & 0xfc) == 0x1c) { /* was this an arrow key? */ + TEXTREC->clikStuff = 255; /* to make sure the caret appears where it should */ + TEKey (recentChar, hTERec); + AdjustScrollBar (); + continue; + } + if (!wasOnLastLine) CopyThisLineToEnd (); + switch (recentChar) { + case FWDDEL: + if (TEXTREC->selStart != TEXTREC->selEnd) DeleteRange (); + else if ((TEXTREC->selStart >= cmdStart) && (TEXTREC->selStart < TEXTREC->teLength)) { + TEDeactivate (hTERec); + SetSelection (TEXTREC->selStart, TEXTREC->selStart + 1); + TEDelete (hTERec); + if (FrontWindow () == gCommandWin) TEActivate (hTERec); + } + break; + case CLRKEY: + if (TEXTREC->selStart != TEXTREC->selEnd) DeleteRange (); + break; + case DELETE: + if (TEXTREC->selStart != TEXTREC->selEnd) DeleteRange (); + else if (TEXTREC->selStart > cmdStart) { + TEXTREC->clikStuff = 255; /* to make sure the caret appears where it should */ + TEKey (DELETE, hTERec); + } + break; + case RETURN: + if (wasOnLastLine) done = true; + break; + case ENTER: /* ENTER ends command no matter what */ + done = true; + break; + default: + DoStyle (boldStyle); + TEXTREC->clikStuff = 255; /* to make sure the caret appears where it should */ + TEKey (recentChar, hTERec); + if ((recentChar == ')') && (TEXTREC->selStart > cmdStart)) { + short parenCount = -1; + Boolean inQuotes = false; + i = TEXTREC->selStart - 1; + while ((--i >= cmdStart) && (parenCount != 0)) + switch ((*TEXTREC->hText)[i]) { + case DBLQUOTE: inQuotes = !inQuotes; break; + case '(': if (!inQuotes) parenCount++; break; + case ')': if (!inQuotes) parenCount--; break; + } + if (parenCount == 0) { + cursorBeforeFlash = TEXTREC->selStart; + SetSelection (i+1, i+2); /* flash the matching open-paren */ + flashTime = 10; + } + } else if ((recentChar == DBLQUOTE) && (TEXTREC->selStart > cmdStart)) { + i = TEXTREC->selStart - 1; + while ((--i >= cmdStart) && ((*TEXTREC->hText)[i] != DBLQUOTE)) ; + if ((*TEXTREC->hText)[i] == DBLQUOTE) { + cursorBeforeFlash = TEXTREC->selStart; + SetSelection (i, i+1); /* flash the matching double-quote */ + flashTime = 10; + } + } + } + AdjustScrollBar (); + } + } while (!done); +} + +char *macgets (void) { + /* retrieve a typed character */ + /* Note that this uses some extensive (and clever, if I may say so myself) buffering. */ + int i, b, bufSize; + char *ptr, *buffer; + Boolean done, onLastLine; + + PrepareForInput (); + do { /* repeat until a full expression has been typed */ + EditFreely (); /* allow free editing for a while */ + + /* Now, we have a complete command to parse, if and only if: */ + /* - the cursor was on the last line when the user pressed Return or Enter, and */ + /* - the user either pressed Enter, or else every '(' since the beginning */ + /* of the command is matched by a ')'. */ + /* Quoting is watched for. ( ") is not a complete expression. */ + + done = true; + if (TEXTREC->selStart != TEXTREC->teLength) /* if we're not at the end already */ + SetSelection (TEXTREC->teLength, TEXTREC->teLength); /* send cursor to end */ + TEXTREC->clikStuff = 255; /* to make sure the caret appears where it should */ + TEKey ('\r', hTERec); + + /* check and see if we've completed the command yet */ + if (recentChar != ENTER) { + Boolean inQuotes = false; + short parenCount = 0; + for (i = cmdStart; i < TEXTREC->teLength; i++) + switch ((*TEXTREC->hText)[i]) { + case DBLQUOTE: inQuotes = !inQuotes; break; + case '(': if (!inQuotes) parenCount++; break; + case ')': if (!inQuotes) parenCount--; break; + } + if ((parenCount > 0) || inQuotes) done = false; + } + + AdjustScrollBar (); + } while (!done); + + /* put the entire command into the buffer, and return it */ + bufSize = TEXTREC->teLength - cmdStart; + buffer = (char *) NewPtr (bufSize + 1); + BlockMoveData (*TEXTREC->hText + cmdStart, buffer, bufSize); + buffer[bufSize] = '\0'; + return buffer; +} + +void macputc (int ch) { + /* put a char into the output buffer, and flush the buffer if necessary */ + switch (ch) { + case '\t': + do { macputc (' '); } while (cursorPos & 7); + break; + case DELETE: + if (cursorPos) cursorPos--; /* and fall through to default */ + default: + if (outputBufferLength == MAX_BUF) FlushOutput (); + if (ch == '\n') { + cursorPos = 0; + (*hOutputBuffer)[outputBufferLength++] = '\r'; + } else { + cursorPos++; + (*hOutputBuffer)[outputBufferLength++] = ch; + } + } +} + +void macputs (char *s) { + /* for completeness */ + while (*s) macputc (*s++); +} + +void scrflush (void) { + extern void osflush (void); + /* clear out everything */ + FlushOutput (); + osflush (); +} + +void scrclear (void) { + /* clear text window -- not implemented */ +} + +//============================================================================= +// static void UpdateCmdWindow (void) +//============================================================================= +// main command window update procedure +//============================================================================= + + +void UpdateCmdWindow (void) { + long textBottom; + Rect tempRect; + + InvalRect (&(gCommandWin->portRect)); + BeginUpdate (gCommandWin); + BlockMoveData(&(gCommandWin->portRect), &tempRect, sizeof(Rect)); + tempRect.right -= SCROLLER_WIDTH; + EraseRect (&tempRect); + if (gCommandWinResized) { + TEXTREC->viewRect = SetTERect (); + TEXTREC->destRect.right = TEXTREC->viewRect.right; + TECalText (hTERec); + SetScrollRect (); + gCommandWinResized = false; + } + DrawOnlyGrowIcon (gCommandWin); + FlushOutput (); + + TEXTREC->viewRect = SetTERect (); /* adjust for possible change in height of status line */ + + textBottom = TEXTREC->destRect.top + (TEXTREC->nLines * LINEHEIGHT); + if (TEXTREC->destRect.top > TEXTREC->viewRect.top) + TEScroll (0, (TEXTREC->viewRect.top - TEXTREC->destRect.top), hTERec); + + if (TEXTREC->destRect.top < TEXTREC->viewRect.top) { /* make sure we don't get fractions of lineheights */ + int amountOffTheTop = TEXTREC->viewRect.top - TEXTREC->destRect.top; + if (amountOffTheTop % LINEHEIGHT) TEScroll (0, amountOffTheTop % LINEHEIGHT, hTERec); + } + TEUpdate (&(TEXTREC->viewRect), hTERec); + AdjustScrollBar (); + UpdateControls (gCommandWin, gCommandWin->visRgn); + EndUpdate (gCommandWin); +} + +void ActivateCmdWindow(void) +{ + TEActivate (hTERec); + HiliteControl (vScroll, 0); + DrawOnlyGrowIcon (gCommandWin); +} + +void DeactivateCmdWindow(void) +{ + TEDeactivate (hTERec); + HiliteControl (vScroll, 255); + DrawOnlyGrowIcon (gCommandWin); +} + +void InitalizeCmdWindow(void) +{ + + /* setup the font, size and writing mode for the command window */ + TextFont (kFontIDMonaco); + TextSize (9); + TextFace (0); + TextMode (srcCopy); + textStyle[plainStyle].tsFace = 0; + textStyle[boldStyle].tsFace = bold; + + currentStyle = plainStyle; + + { /* set up scroll bar */ + Rect scrollRect; + vScroll = NewControl (gCommandWin, &scrollRect, "\p", 0, 0, 0, 0, scrollBarProc, 0L); + SetScrollRect (); + ShowControl (vScroll); + } + + { /* set up command text record */ + Rect teRect = SetTERect (); + hTERec = (TEHandle)TEStyleNew (&teRect, &teRect); + TECalText (hTERec); + TEAutoView (true, hTERec); + TESetClickLoop (uppScrollClickLoop, hTERec); + TEActivate (hTERec); + } + + hOutputBuffer = NewHandle (MAX_BUF); /* a handle to a buffer for text to be displayed */ +} + +void CleanupCmdWindow(void) +{ + StopPasting (); + CloseWindow (gCommandWin); + TEDispose (hTERec); + DisposeHandle (hOutputBuffer); +} diff --git a/sys/mac/MacCommandWin.h b/sys/mac/MacCommandWin.h new file mode 100644 index 0000000..20b7775 --- /dev/null +++ b/sys/mac/MacCommandWin.h @@ -0,0 +1,17 @@ +/* MacCommandWin.h -- headers for more mac stuff */ + +void SetSelection (short start, short end); +void macputc(int ch); +void macputs(char *s); +void PrepareForInput(void); +void InitalizeCmdWindow(void); +void UpdateCmdWindow(void); +void StopPasting(void); +void DeleteRange(void); +void scrflush(void); +void SetScrollRect(void); +void AdjustCursor(Point theLoc, RgnHandle theRgn); +void DoKeyPress(EventRecord *theEvent); +void ActivateCmdWindow(void); +void DeactivateCmdWindow(void); +void CleanupCmdWindow(void); diff --git a/sys/mac/MacDrag.h b/sys/mac/MacDrag.h new file mode 100644 index 0000000..15a48ca --- /dev/null +++ b/sys/mac/MacDrag.h @@ -0,0 +1,3 @@ +/* MacDrag.h -- drag text */ + +Boolean DragText(EventRecord *ev); diff --git a/sys/mac/MacFileUtils.c b/sys/mac/MacFileUtils.c new file mode 100644 index 0000000..dae8ea4 --- /dev/null +++ b/sys/mac/MacFileUtils.c @@ -0,0 +1,81 @@ +// Routines that deal with some mac file system stuff -EAD + +#include <Files.h> +#include <TextUtils.h> +#include <string.h> +//#include "MiscellaneousUtilities.h" + +//========================================================================= +// Function prototypes +//========================================================================= + +void set_mac_file_type(char *filename); +void GetFullPath(FSSpec *theSpec, StringPtr theName); +void PathNameFromDirID(long dirID, short vRefNum, StringPtr fullPathName); + + + +//========================================================================= +// Set the output soundfile type and creator +//========================================================================= + +void set_mac_file_type(char *filename) +{ + Str255 fName; + FSSpec fSpec; + FInfo fFInfo; + + fFInfo.fdType = 'AIFF'; + fFInfo.fdCreator = 'Sd2a'; + + BlockMoveData(filename, &fName[1], 256); + fName[0] = strlen(filename); + FSMakeFSSpec(0, 0, fName, &fSpec); + FSpSetFInfo(&fSpec, &fFInfo); +} + +//================================================================================================================================== +// void GetFullPath(FSSpec *theSpec, StringPtr theName) +//================================================================================================================================== +// Extracts the full pathname for the file pointed to by theSpec and returns it in theName. +//================================================================================================================================== + +void GetFullPath(FSSpec *theSpec, StringPtr theName) +{ + *theName = 0; + if (theSpec->parID != 1) PathNameFromDirID(theSpec->parID, theSpec->vRefNum, theName); + // was: pstrcat(theName, theSpec->name); + strcat(P2CStr(theName), P2CStr(theSpec->name)); + C2PStr((char *) theName); + C2PStr((char *) theSpec->name); + //pstrcat(theName, "\p:"); + theName[*theName + 1] = 0; +} + +//================================================================================================================================== +// void PathNameFromDirID(long dirID, short vRefNum, StringPtr fullPathName) +//================================================================================================================================== +// Given a vRefNum and a directory ID, creates a full path specification. +//================================================================================================================================== + +void PathNameFromDirID(long dirID, short vRefNum, StringPtr fullPathName) +{ + Str255 directoryName; + DirInfo block; + OSErr err; + fullPathName[0] = 0; + block.ioDrDirID = block.ioDrParID = dirID; + block.ioNamePtr = directoryName; + do { + block.ioVRefNum = vRefNum; + block.ioFDirIndex = -1; + block.ioDrDirID = block.ioDrParID; + err = PBGetCatInfo((CInfoPBPtr)&block, false); + //pstrcat(directoryName, (StringPtr)"\p:"); + //pstrinsert(fullPathName, directoryName); + strcat(P2CStr(directoryName), ":"); + strcat((char *) directoryName, (char *) fullPathName); + strcpy((char *)fullPathName, (char *) directoryName); + } while (block.ioDrDirID != 2); + C2PStr((char *) fullPathName); +} diff --git a/sys/mac/MacFileUtils.h b/sys/mac/MacFileUtils.h new file mode 100644 index 0000000..581ff07 --- /dev/null +++ b/sys/mac/MacFileUtils.h @@ -0,0 +1,3 @@ +/* MacFileUtils.h -- more mac stuff */ + +void GetFullPath(FSSpec *theSpec, StringPtr theName); diff --git a/sys/mac/MacGlobals.h b/sys/mac/MacGlobals.h new file mode 100644 index 0000000..e0c8573 --- /dev/null +++ b/sys/mac/MacGlobals.h @@ -0,0 +1,50 @@ +// Window pointers + +extern WindowPtr gCommandWin, gGraphicsWin; + +extern Boolean gCommandWinResized; + + + +// Menu Handles + +extern MenuHandle appleMenu, fileMenu, editMenu, controlMenu; + + + +// The command window text handle + +extern TEHandle hTERec; + +#define TEXTREC (*hTERec) + +#define TEXTCHAR(i) ((*(TEXTREC->hText))[i]) + + + +// more comand window text stuff + +extern CharsHandle pastedTextH; /* a handle to pasted text */ + +extern int pastedLength; /* how many chars there are in the paste buffer */ + +extern int outputBufferLength; + +extern Rect dragRect, sizeRect; + +extern int flashTime, cursorBeforeFlash; + +extern char recentChar; /* the last character typed */ + + + +// Allocate space for UPPs + +extern ControlActionUPP uppScrollProc; + +extern TEClickLoopUPP uppScrollClickLoop; + + + +extern Boolean gInBackground; + diff --git a/sys/mac/MacHandleEv.c b/sys/mac/MacHandleEv.c new file mode 100644 index 0000000..d6516c0 --- /dev/null +++ b/sys/mac/MacHandleEv.c @@ -0,0 +1,64 @@ +#include <MacTypes.h> +#include <Quickdraw.h> +#include <Windows.h> +#include <Controls.h> +#include <ToolUtils.h> +#include "macint.h" + +extern WindowPtr gCommandWin, gGraphicsWin; +extern Boolean gCommandWinResized; +extern Rect dragRect, sizeRect; + +//============================================================================= +// Hanlde Mouse Down Events +//============================================================================= + +void DoMouseDown (EventRecord *theEvent) { + WindowPtr whichWindow; + short int thePart = FindWindow (theEvent->where, &whichWindow); + + switch (thePart) { + case inSysWindow: + SystemClick (theEvent, whichWindow); + break; + case inDrag: + DragWindow (whichWindow, theEvent->where, &dragRect); + break; + case inMenuBar: { + long choice; + AdjustMenus (); + choice = MenuSelect (theEvent->where); + if (choice) DoMenu (choice); + break; + } + case inGoAway: + if ((whichWindow == gGraphicsWin) + && (TrackGoAway (whichWindow, theEvent->where))) + HideGrafWin (); + break; + case inContent: + if ((FrontWindow () == gCommandWin) && (whichWindow == gCommandWin)) + DoContent (theEvent); + else SelectWindow (whichWindow); + break; + case inGrow: + case inZoomIn: + case inZoomOut: { + long newSize; + GrafPtr oldPort; + if (thePart == inGrow) newSize = GrowWindow (whichWindow, theEvent->where, &sizeRect); + if (((thePart == inGrow) && newSize) + || ((thePart != inGrow) && TrackBox (whichWindow, theEvent->where, thePart))) { + GetPort (&oldPort); + SetPort (whichWindow); + EraseRect (&whichWindow->portRect); + if (thePart == inGrow) SizeWindow (whichWindow, LoWord (newSize), HiWord (newSize), -1); + else ZoomWindow (whichWindow, thePart, 0); + gCommandWinResized = true; + InvalRect (&whichWindow->portRect); + SetPort (oldPort); + } + break; + } + } +} diff --git a/sys/mac/MacHandleEv.h b/sys/mac/MacHandleEv.h new file mode 100644 index 0000000..73eff48 --- /dev/null +++ b/sys/mac/MacHandleEv.h @@ -0,0 +1,3 @@ +/* MacHandelEv.h -- event handlers */ + +void DoMouseDown(EventRecord *theEvent); diff --git a/sys/mac/README.txt b/sys/mac/README.txt new file mode 100644 index 0000000..bf634d9 --- /dev/null +++ b/sys/mac/README.txt @@ -0,0 +1,55 @@ +README.txt -- information on Nyquist for Mac OS X + +Installation +------------ +The simplest way to install and run Nyquist is to get the pre-compiled +NyquistIDE application, which includes executables, documentation, and +libraries all in one package. + +You will probably run Nyquist using the NyquistIDE application, but +you can also run nyquist from the command line. The executable is +located in + + NyquistIDE.app/Contents/Resources/Java/ny + +To run from the command line, you will need to set the XLISPPATH +environment variable using this command line (if you use the C shell, +e.g. csh): + + setenv XLISPPATH `pwd`/runtime:`pwd`/lib + +If you use the bash shell, use: + + export XLISPPATH=`pwd`/runtime:`pwd`/lib + +Note that this sets XLISPPATH in the environment of the current +command line shell. If you exit the shell or switch to another shell, +the XLISPPATH variable will not be set. Your shell reads an +initialization file when it starts. You can add the XLISPPATH +initialization command to this file if you want the variable to be set +automatically in every instance of your command line shell. + +On the topic of the XLISPPATH, note that this variable is set by +NyquistIDE when running with that application, overriding any other +value. You can extend the search path by creating the file xlisppath +in the same directory as the nyquist executable ny. The xlisppath file +should have colon-separated paths on a single line of text. + +You can also build Nyquist from sources, as described below. + + +How To Build Nyquist on Mac OS X +-------------------------------- +You need to install Xcode, Apple's free software development system +for OS X. + +The project file is in nyquist/macosxproject/nyquist.xcodeproj + +To build Nyquist or NyquistIDE: + - Open nyquist.xcodeproj in Xcode + - Set the active target to "Nyquist" or "NyquistIDE" + - Click on "build active target" + - ny or NyquistIDE will be produced in MacOSXProject/build/ + + + diff --git a/sys/mac/macaboutbox.c b/sys/mac/macaboutbox.c new file mode 100644 index 0000000..8acdbf4 --- /dev/null +++ b/sys/mac/macaboutbox.c @@ -0,0 +1,123 @@ +/* macaboutbox.c - Display the "about box" of the application. */ +/* Written by Brian Kendig. */ +/* The functions here are only used by macint.c. */ + +//#include <THINK.h> +#include <Dialogs.h> +#include <Fonts.h> +#include <Menus.h> +#include <Quickdraw.h> +#include <Resources.h> +#include <ToolUtils.h> +#include <Traps.h> +#include <Windows.h> +#include "macint.h" +#define NIL ((void *) 0) + +static DialogPtr aboutBox; +extern Boolean hasColorQD; + +static enum { + theOKButton = 1, + theOKOutline = 2, + theIcon = 3, + theName = 4, + theAboutText = 5, + theCopyright = 6 +} ; + +pascal void DrawOKOutline (WindowPtr dialogWindow, short theItem) { + PenState oldPen; + short iType; + Handle iHandle; + Rect iRect; + + GetPenState (&oldPen); + PenNormal (); + PenSize (3,3); + + GetDialogItem (aboutBox, theOKButton, &iType, &iHandle, &iRect); + InsetRect (&iRect, -4, -4); + FrameRoundRect (&iRect, 16, 16); + + SetPenState (&oldPen); +} + +pascal void DrawIcon (WindowPtr dialogWindow, short theItem) { + short iType; + Handle iHandle; + Rect iRect; + + GetDialogItem (aboutBox, theIcon, &iType, &iHandle, &iRect); + PlotIcon (&iRect, GetResource ('ICN#', 128)); +} + +pascal void DrawName (WindowPtr dialogWindow, short theItem) { + short iType; + Handle iHandle; + Rect iRect; + Str255 string; + + TextFont (kFontIDHelvetica); + TextSize (24); + TextFace (0); + GetDialogItem (aboutBox, theName, &iType, &iHandle, &iRect); + GetIndString (string, STRINGS_RES, 1); + TETextBox (string+1, string[0], &iRect, teFlushLeft); +} + +pascal void DrawAboutText (WindowPtr dialogWindow, short theItem) { + short iType; + Handle iHandle; + Rect iRect; + Str255 string; + + TextFont (kFontIDMonaco); + TextSize (9); + TextFace (0); + GetDialogItem (aboutBox, theAboutText, &iType, &iHandle, &iRect); + GetIndString (string, STRINGS_RES, 2); + TETextBox (string+1, string[0], &iRect, teFlushLeft); +} + +pascal void DrawCopyright (WindowPtr dialogWindow, short theItem) { + short iType; + Handle iHandle; + Rect iRect; + Str255 string; + + TextFont (systemFont); + TextSize (12); + TextFace (0); + GetDialogItem (aboutBox, theCopyright, &iType, &iHandle, &iRect); + GetIndString (string, STRINGS_RES, 3); + TETextBox (string+1, string[0], &iRect, teFlushLeft); +} + +void DoAboutBox (void) { + short itemType, itemHit = 0; + Handle itemHandle; + Rect aboutRect; + short width, hight; + PicHandle aboutPict; + + aboutPict = GetPicture(ABOUT_PICT); + aboutRect = (*aboutPict)->picFrame; + width = aboutRect.right - aboutRect.left; + hight = aboutRect.bottom - aboutRect.top; + + aboutBox = GetNewDialog (ABOUT_BOX, NIL, (WindowPtr) -1); + SizeWindow(aboutBox, width, hight, false); + + ShowWindow (aboutBox); + SetPort(aboutBox); + DrawPicture(aboutPict, &(*aboutPict)->picFrame); + + //itemHit = 0; + //while (itemHit != ok) ModalDialog (NIL, &itemHit); + while (!Button()); + + DisposeDialog (aboutBox); + + FlushEvents(everyEvent, 0); // dmazzoni +} diff --git a/sys/mac/macaboutbox.h b/sys/mac/macaboutbox.h new file mode 100644 index 0000000..76f699a --- /dev/null +++ b/sys/mac/macaboutbox.h @@ -0,0 +1,3 @@ +/* macaboutbox.h -- header for about box implementation */ + +void DoAboutBox(void); diff --git a/sys/mac/macdrag.c b/sys/mac/macdrag.c new file mode 100644 index 0000000..559a278 --- /dev/null +++ b/sys/mac/macdrag.c @@ -0,0 +1,161 @@ +#include <Drag.h> +#include <Errors.h> +#include <TextEdit.h> +#include <QuickDraw.h> + +extern TEHandle hTERec; +// Handle drag from newswatcher -EAD + +/*---------------------------------------------------------------------------- + DragText + + Drag selected text. + + Entry: ev = pointer to mouse down event record. + where = location of mouse down event in local coords. + theTE = handle to TextEdit record. + + Exit: function result = error code. + *dragged = + true if text was dragged. + false if mouse down was not over text selection, or + user did not move the mouse before releasing the + mouse button. + *trashed = true if text was dragged to trash. +----------------------------------------------------------------------------*/ +extern RgnHandle rgn; +//extern EventRecord theEvent; + +Boolean DragText (EventRecord *ev) +{ + DragReference dragRef; + OSErr err = noErr; + Boolean haveDragRef = false; + Handle hText; + RgnHandle dragRgn, tempRgn; + short selStart, selEnd; + char state; + Point theLoc; + GrafPtr curPort; + +// if (!PtInTEHiliteRgn(where, hTERec)) return noErr; + if (!WaitMouseMoved(ev->where)) return noErr; + + GetPort(&curPort); + + CopyRgn(rgn, dragRgn = NewRgn()); + SetPt(&theLoc, 0, 0); + LocalToGlobal(&theLoc); + OffsetRgn(dragRgn, theLoc.h, theLoc.v); + + hText = (**hTERec).hText; + selStart = (**hTERec).selStart; + selEnd = (**hTERec).selEnd; + + err = NewDrag(&dragRef); + if (err != noErr) goto exit; + haveDragRef = true; + state = HGetState(hText); + HLock(hText); + err = AddDragItemFlavor(dragRef, 1, 'TEXT', *hText + selStart, selEnd - selStart, 0); + HSetState(hText, state); + if (err != noErr) goto exit; +// dragRgn = NewRgn(); +// err = TEGetHiliteRgn(dragRgn, hTERec); +// if (err != noErr) goto exit; +// LocalToGlobalRgn(dragRgn); +// OutlineRegion(dragRgn); + SetDragItemBounds(dragRef, 1, &(**dragRgn).rgnBBox); + tempRgn = NewRgn(); + CopyRgn(dragRgn, tempRgn); + InsetRgn(tempRgn, 1, 1); + DiffRgn(dragRgn, tempRgn, dragRgn); + DisposeRgn(tempRgn); + + err = TrackDrag(dragRef, ev, dragRgn); + if (err != noErr && err != userCanceledErr) goto exit; + //*trashed = DragTargetWasTrash(dragRef); +// DisposeRgn(dragRgn); + + DisposeDrag(dragRef); + return true; + +exit: + + if (haveDragRef) DisposeDrag(dragRef); +// if (dragRgn != nil) DisposeRgn(dragRgn); + return false; +} + + + +/*---------------------------------------------------------------------------- + LocalToGlobalRgn + + Convert a region from local to global coordinates. + + Entry: rgn = handle to region. +----------------------------------------------------------------------------*/ + +void LocalToGlobalRgn (RgnHandle rgn) +{ + Point where; + + SetPt(&where, 0, 0); + LocalToGlobal(&where); + OffsetRgn(rgn, where.h, where.v); +} + +/*---------------------------------------------------------------------------- + OutlineRegion + + Change a region into a tracing of its border which is appropriate + for normal dragging. + + Entry: theRgn = handle to region. + + Exit: Region changed to outline of region. + + From Apple "HFS Drag Sample" sample code. +----------------------------------------------------------------------------*/ + +void OutlineRegion (RgnHandle theRgn) +{ + RgnHandle tempRgn; + + tempRgn = NewRgn(); + CopyRgn(theRgn, tempRgn); + InsetRgn(tempRgn, 1, 1); + DiffRgn(theRgn, tempRgn, theRgn); + DisposeRgn(tempRgn); +} + +/*---------------------------------------------------------------------------- + PtInTEHiliteRgn + + Determine whether or not a point is in the current TextEdit hilite + region. + + Entry: where = point in local coords. + theTE = handle to TextEdit record. + + Exit: function result = true if point is in the hilite region. +----------------------------------------------------------------------------*/ + +Boolean PtInTEHiliteRgn (Point where, TEHandle theTE) +{ + Boolean result = false; + RgnHandle rgn = nil; + OSErr err = noErr; + + //if (!HaveTEGetHiliteRgn()) return false; + rgn = NewRgn(); + err = TEGetHiliteRgn(rgn, theTE); + if (err != noErr) goto exit; + result = PtInRgn(where, rgn); + +exit: + + if (rgn != nil) DisposeRgn(rgn); + return result; +} diff --git a/sys/mac/macfun.c b/sys/mac/macfun.c new file mode 100644 index 0000000..e92461d --- /dev/null +++ b/sys/mac/macfun.c @@ -0,0 +1,222 @@ +/* macfun.c - macintosh user interface functions for xlisp */ +/* Written by Brian Kendig. */ + +#include <Quickdraw.h> +#include <Windows.h> +#include <Memory.h> +#include "xlisp.h" +#include "macint.h" + +/* externals */ +extern WindowPtr gCommandWin, gGraphicsWin; +extern Boolean hasColorQD; +extern unsigned long startupTicks; +extern void ShowGrafWin (void); + +unsigned long ticks_per_second (void) { return 60; } +unsigned long run_tick_count (void) { return ((unsigned long) TickCount ()) - startupTicks; } +unsigned long real_tick_count (void) { return (unsigned long) TickCount (); } + +LVAL xrealtime (void) { return cvfixnum ((FIXTYPE)real_tick_count()); } /* get-internal-real-time */ +LVAL xruntime (void) { return cvfixnum ((FIXTYPE)run_tick_count()); } /* get-internal-run-time */ +LVAL xtime (void) { return cvfixnum ((FIXTYPE)real_tick_count()); } /* time */ + +/* get an integer parameter */ +LOCAL int getNumber () { + LVAL num = xlgafixnum (); + return ((int) getfixnum (num)); +} + +/* handle commands that require integer arguments */ +LOCAL LVAL GrafCmd (char funct, int nArgs) { + short x, y, z; + if (nArgs > 0) x = getNumber (); + if (nArgs > 1) y = getNumber (); + if (nArgs > 2) z = getNumber (); + xllastarg (); + SetPort (gGraphicsWin); + switch (funct) { + case 'G': ShowGrafWin (); break; + case 'g': HideGrafWin (); break; + case 'x': EraseRect (&gGraphicsWin->portRect); break; + case 's': ShowPen (); break; + case 'h': HidePen (); break; + case 'd': PenMode (x); break; + case 'M': Move (x, y); break; + case 'm': MoveTo (x, y); break; + case 'L': Line (x, y); break; + case 'l': LineTo (x, y); break; + case 'S': PenSize (x, y); break; + case 'p': PenNormal (); break; + case 'c': + if (hasColorQD) { + RGBColor col; col.red = x; col.green = y; col.blue = z; + RGBForeColor (&col); + } break; + } + SetPort (gCommandWin); + return NIL; +} + +LVAL xshowgraphics (void) { return GrafCmd ('G', 0); } /* show graphics win */ +LVAL xhidegraphics (void) { return GrafCmd ('g', 0); } /* hide graphics win */ +LVAL xcleargraphics (void) { return GrafCmd ('x', 0); } /* clear graphics win */ +LVAL xshowpen (void) { return GrafCmd ('s', 0); } /* show the pen */ +LVAL xhidepen (void) { return GrafCmd ('h', 0); } /* hide the pen */ +LVAL xpenmode (void) { return GrafCmd ('d', 1); } /* set the pen mode */ +LVAL xmove (void) { return GrafCmd ('M', 2); } /* move pen in a specified direction */ +LVAL xmoveto (void) { return GrafCmd ('m', 2); } /* move pen to a screen location */ +LVAL xdraw (void) { return GrafCmd ('L', 2); } /* draw a line in a specified direction */ +LVAL xdrawto (void) { return GrafCmd ('l', 2); } /* draw a line to a screen location */ +LVAL xpensize (void) { return GrafCmd ('S', 2); } /* set the pen size */ +LVAL xpennormal (void) { return GrafCmd ('p', 0); } /* set the pen to normal */ +LVAL xcolor (void) { return GrafCmd ('c', 3); } /* set RGB color of pen */ + + +LVAL xgetpen (void) { /* get the pen position */ + LVAL val; + Point p; + xllastarg (); + SetPort ((GrafPtr)gGraphicsWin); + GetPen (&p); + SetPort (gCommandWin); + xlsave1 (val); + val = consa (NIL); + rplaca (val,cvfixnum ((FIXTYPE)p.h)); + rplacd (val,cvfixnum ((FIXTYPE)p.v)); + xlpop (); + return val; +} + +LVAL xpenpat (void) { /* set the pen pattern */ + LVAL plist; + Pattern pat; + int i; + plist = xlgalist (); + xllastarg (); + for (i = 0; i < 8 && consp (plist); ++i, plist = cdr (plist)) +// if (fixp (car (plist))) pat[i] = getfixnum (car (plist)); + SetPort ((GrafPtr)gGraphicsWin); + PenPat (&pat); + SetPort (gCommandWin); + return NIL; +} + + +/* The functions below are not yet implemented. */ + +LVAL xtool (void) { /* call the toolbox */ + int trap = getNumber (); + LVAL val; + +/* asm { + move.l args(A6),D0 + beq L2 + L1: move.l D0,A0 + move.l 2(A0),A1 + move.w 4(A1),-(A7) + move.l 6(A0),D0 + bne L1 + L2: lea L3,A0 + move.w trap(A6),(A0) + L3: dc.w 0xA000 + clr.l val(A6) + } + + return val; */ + return cvfixnum ((FIXTYPE) trap); +} + +LVAL xtool16 (void) { /* call the toolbox with a 16 bit result */ + int trap = getNumber (); + int val; + +/* asm { + clr.w -(A7) + move.l args(A6), D0 + beq L2 + L1: move.l D0, A0 + move.l 2(A0), A1 + move.w 4(A1), -(A7) + move.l 6(A0), D0 + bne L1 + L2: lea L3, A0 + move.w trap(A6), (A0) + L3: dc.w 0xA000 + move.w (A7)+, val(A6) + } + + return cvfixnum ((FIXTYPE) val); */ + return cvfixnum ((FIXTYPE) trap); +} + +LVAL xtool32 (void) { /* call the toolbox with a 32 bit result */ + int trap = getNumber (); + long val; + +/* asm { + clr.l -(A7) + move.l args(A6),D0 + beq L2 + L1: move.l D0,A0 + move.l 2(A0),A1 + move.w 4(A1),-(A7) + move.l 6(A0),D0 + bne L1 + L2: lea L3,A0 + move.w trap(A6),(A0) + L3: dc.w 0xA000 + move.l (A7)+,val(A6) + } + + return cvfixnum ((FIXTYPE) val); */ + return cvfixnum ((FIXTYPE) trap); +} + +LVAL xnewhandle (void) { /* allocate a new handle */ + LVAL num = xlgafixnum (); + long size = getfixnum (num); + xllastarg (); + return cvfixnum ((FIXTYPE) NewHandle (size)); +} + +LVAL xnewptr (void) { /* allocate memory */ + LVAL num = xlgafixnum (); + long size = getfixnum (num); + xllastarg (); + return cvfixnum ((FIXTYPE) NewPtr (size)); +} + +LVAL xhiword (void) { /* return the high order 16 bits of an integer */ + unsigned int val = (unsigned int) (getNumber () >> 16); + xllastarg (); + return cvfixnum ((FIXTYPE) val); +} + +LVAL xloword (void) { /* return the low order 16 bits of an integer */ + unsigned int val = (unsigned int) getNumber (); + xllastarg (); + return cvfixnum ((FIXTYPE) val); +} + +LVAL xrdnohang (void) { /* get the next character in the look-ahead buffer */ + int ch = 0; + xllastarg (); +/* if ((ch = scrnextc ()) == EOF) return NIL; */ + return cvfixnum ((FIXTYPE) ch); +} + +void ossymbols (void) { /* ossymbols - enter important symbols */ + LVAL sym; + + /* setup globals for the window handles */ + sym = xlenter ("*COMMAND-WINDOW*"); + setvalue (sym, cvfixnum ((FIXTYPE) gCommandWin)); + sym = xlenter ("*GRAPHICS-WINDOW*"); + setvalue (sym, cvfixnum ((FIXTYPE) gGraphicsWin)); +} + +void xoserror (char *msg) { /* do nothing */ } + +LVAL xsystem (V) { return NIL; } +LVAL xgetkey (V) { return NIL; } diff --git a/sys/mac/macint.c b/sys/mac/macint.c new file mode 100644 index 0000000..bd76af8 --- /dev/null +++ b/sys/mac/macint.c @@ -0,0 +1,521 @@ +/* macint.c - macintosh interface routines for xlisp 2.1e */ +/* Written by Brian Kendig. */ +/* The functions here are only called by macstuff.c. */ + +#include <Events.h> +#include <Gestalt.h> +#include <Memory.h> +#include <Menus.h> +#include <Events.h> +#include <Quickdraw.h> +#include <StandardFile.h> +#include <TextEdit.h> +#include <ToolUtils.h> +#include <Traps.h> +#include <Windows.h> +#include <Controls.h> +/* #include <ControlDefinitions.h> */ +#include <SIOUX.h> +#include <AppleEvents.h> +#include "macint.h" +/* #define FALSE 0 +#define TRUE 1 */ +#define NIL ((void *) 0) + + +#include "MacCommandWin.h" +#include "macaboutbox.h" +#include "MacDrag.h" +#include "MacHandleEv.h" +#include "macstuff.h" +#include "stdio.h" +#define TEXTREC (*hTERec) /* the command window text record */ +#define TEXTCHAR(i) ((*(TEXTREC->hText))[i]) + +// Struct for apple event handling +typedef struct AEventList { + AEEventClass evclass; + AEEventID evid; + void *handler; + long refcon; +} AEventList, *AEventListPtr; + +//=========================================================================== +// GLOBALS DEFINED HERE USE MacGlobals.h FOR ACCESS +//=========================================================================== + +// Menu handles +MenuHandle appleMenu, fileMenu, editMenu, controlMenu; + +/* command and graphics windows */ +WindowPtr gCommandWin, gGraphicsWin; +WindowRecord commandWinRec, bwGraphicsWinRec; +CWindowRecord colorGraphicsWinRec; +Boolean gGraphicsShown, gCommandWinResized = false; + +// Screen size stuff +Rect dragRect, sizeRect; +int screenWidth, screenHeight; /* screen dimensions */ +int sHorizontal, sVertical, sWidth, sHeight; /* command win, split screen */ +int gHorizontal, gVertical, gWidth, gHeight; /* graphics win, split screen */ + +// The Text handle +TEHandle hTERec; + +/* output is buffered */ +//Handle hOutputBuffer = NULL; +int outputBufferLength = 0; + +// Allocate space for UPPs +ControlActionUPP uppScrollProc; +TEClickLoopUPP uppScrollClickLoop; +//AEEventHandlerUPP uppAEOpenFiles, uppAEQuit; + +// Text related globals +CharsHandle pastedTextH = NULL; /* a handle to pasted text */ +int pastedLength = 0; /* how many chars there are in the paste buffer */ +int flashTime = 0, cursorBeforeFlash; /* for flashing cursor when parens match */ +char recentChar; /* the last character typed */ +RgnHandle gMouseRgn; // holds current mouse regin + +/* miscellaneous stuff */ +Boolean gInBackground; /* are we in background or not */ +int wneImplemented; +unsigned long startupTicks; +Boolean hasColorQD; + +short howManyFiles = 0, whichFile = 0; /* keep track of files opened from Finder */ + + +// Prototypes +static pascal OSErr AEQuit (AppleEvent *theAppleEvent, AppleEvent *theReply, long Refcon); +static pascal OSErr AEOpenFiles (AppleEvent *theAppleEvent, AppleEvent *theReply, long Refcon); +pascal Boolean ScrollClickLoop (void); +pascal void ScrollProc (ControlHandle control, short thePart); +Rect SetTERect (void); +void FlushOutput (void); + +void ShowGrafWin (void) { + /* make the graphics window visible */ + ShowWindow (gGraphicsWin); + SelectWindow (gGraphicsWin); + SetMenuItemText (controlMenu, SHOW_GRAPHICS, "\pHide Graphics"); + //AdjustCursor (); + gGraphicsShown = true; +} + +void HideGrafWin (void) { + /* hide the graphics window */ + HideWindow (gGraphicsWin); + SetMenuItemText (controlMenu, SHOW_GRAPHICS, "\pShow Graphics"); + gGraphicsShown = false; +} + + +static void UpdateGraphWindow () +{ + BeginUpdate (gGraphicsWin); + EndUpdate (gGraphicsWin); +} +void InitMac (void) { +// { /* set up memory properly */ +// int i; + // fix this later. -EAD + //if (DefltStack < STACKMIN) SetApplLimit (CurStackBase - STACKMIN); +// MaxApplZone (); +// for (i = 0; i < MASTERS; i++) MoreMasters (); +// } + AEventListPtr theAppleEvent; + AEventList theEventList[] = { + { kCoreEventClass, kAEOpenDocuments, AEOpenFiles, 0 }, + { kCoreEventClass, kAEQuitApplication, AEQuit, 0 }, + { 0, 0, nil, 0 } + }; + int i; + + /* do all the necessary initialization mumbo-jumbo */ + if (StackSpace() < STACKMIN) + SetApplLimit(GetApplLimit() - STACKMIN); + MaxApplZone(); + /* printf("New StackSpace %lx GetApplLimit %lx\n", + StackSpace(), GetApplLimit()); */ + for (i = 0; i < MASTERS; i++) MoreMasters (); + /* getchar(); */ + + /* initialize the toolbox */ + InitGraf (&qd.thePort); + InitFonts (); + FlushEvents (everyEvent, 0); + InitWindows (); + InitMenus (); + TEInit (); + InitDialogs (NIL); + InitCursor (); + + // Setup Callbacks + uppScrollClickLoop = NewTEClickLoopProc(ScrollClickLoop); + uppScrollProc = NewControlActionProc(ScrollProc); + + // Handlers for core apple events + for (theAppleEvent = theEventList; theAppleEvent->handler; theAppleEvent++) + if (AEInstallEventHandler(theAppleEvent->evclass, theAppleEvent->evid, NewAEEventHandlerProc((ProcPtr)theAppleEvent->handler), + theAppleEvent->refcon, 0) != noErr); + + // Set up the SIOUX window + SIOUXSettings.initializeTB = FALSE; //Toolbox is alread inited + SIOUXSettings.setupmenus = FALSE; //keep the csound menus + SIOUXSettings.autocloseonquit = TRUE; //close sioux without asking for save + SIOUXSettings.showstatusline = FALSE; //no status line + SIOUXSettings.asktosaveonclose = FALSE; //don't ask to save + SIOUXSettings.toppixel = 40; + SIOUXSettings.leftpixel = 5; + + /* see if we have WaitNextEvent and Color Quickdraw */ + wneImplemented = (NGetTrapAddress (_WaitNextEvent, ToolTrap) != NGetTrapAddress (_Unimplemented, ToolTrap)); + if (NGetTrapAddress ((short) Gestalt, ToolTrap) != NGetTrapAddress (_Unimplemented, ToolTrap)) { + long returnCode; + OSErr err = Gestalt (gestaltQuickdrawVersion, &returnCode); + hasColorQD = ((err == noErr) && (returnCode >= gestalt8BitQD)); + } else hasColorQD = false; + + { /* set up menus */ + Handle theMenuBar = GetNewMBar (MBAR_RES); + SetMenuBar (theMenuBar); + appleMenu = (MenuHandle)GetMenuHandle (APPLE_MENU_RES); + fileMenu = (MenuHandle)GetMenuHandle (FILE_MENU_RES); + editMenu = (MenuHandle)GetMenuHandle (EDIT_MENU_RES); + controlMenu = (MenuHandle)GetMenuHandle (CONTROL_MENU_RES); + AppendResMenu (appleMenu, 'DRVR'); + DrawMenuBar (); + } + + /* get the size of the main screen */ + screenWidth = qd.screenBits.bounds.right - qd.screenBits.bounds.left; + screenHeight = qd.screenBits.bounds.bottom - qd.screenBits.bounds.top; + + /* compute the size of the graphics window in split-screen mode */ + gHorizontal = SCREEN_MARGIN; + gVertical = MBAR_HEIGHT + TITLEBAR_HEIGHT - 1; + gWidth = screenWidth - (SCREEN_MARGIN * 2); + gHeight = GRAFWIN_HEIGHT; + + /* compute the size of the command window in split-screen mode */ + sHorizontal = SCREEN_MARGIN; + sVertical = MBAR_HEIGHT + TITLEBAR_HEIGHT - 1 + SCREEN_MARGIN + GRAFWIN_HEIGHT; + sWidth = screenWidth - (SCREEN_MARGIN * 2); + sHeight = screenHeight - MBAR_HEIGHT - TITLEBAR_HEIGHT - (SCREEN_MARGIN * 2) - GRAFWIN_HEIGHT - 1; + + /* set up size and drag rects */ + dragRect = (*GetGrayRgn ())->rgnBBox; +// dragRect.left += DRAG_THRESHOLD; +// dragRect.right -= DRAG_THRESHOLD; +// dragRect.bottom -= DRAG_THRESHOLD; + sizeRect.top = MIN_WIN_HEIGHT; + sizeRect.left = MIN_WIN_WIDTH; + sizeRect.bottom = qd.screenBits.bounds.bottom - qd.screenBits.bounds.top; + sizeRect.right = qd.screenBits.bounds.right - qd.screenBits.bounds.left; + + /* create the command window */ + gCommandWin = GetNewWindow (CWINRES, &commandWinRec, (WindowPtr) -1L); + SetPort (gCommandWin); + + /* create the graphics window */ + if (hasColorQD) gGraphicsWin = GetNewCWindow (GWINRES, &colorGraphicsWinRec, (WindowPtr) -1L); + else gGraphicsWin = GetNewWindow (GWINRES, &bwGraphicsWinRec, (WindowPtr) -1L); + + startupTicks = TickCount (); /* take note of what time we're starting up */ + + // Create mouse regin + gMouseRgn = NewRgn(); + + // Initalize some command window stuff + InitalizeCmdWindow(); + + // Turn on text outlineing + TEFeatureFlag(teFOutlineHilite, teBitSet, hTERec); + + HideGrafWin (); + + { /* see if the user launched the app by opening text files from the Finder */ + short doWhat;\ +// call to CountAppFiles was commented out, but that left doWhat uninitialized +// RBD added this ifdef, I wonder where CountAppFiles came from? +#ifdef CountAppFilesDefined + CountAppFiles (&doWhat, &howManyFiles); + if (doWhat != appOpen) howManyFiles = 0; +#else + howManyFiles = 0; +#endif + } + + UpdateCmdWindow (); + +} + + + +static void DoAppleMenu (int theItem) { + switch (theItem) { + case ABOUT_ITEM: + DoAboutBox (); + break; + default: { + Str255 name; + GetMenuItemText (appleMenu, theItem, name); + OpenDeskAcc (name); + break; + } + } +} +/* this should really be in a header for MacFileUtils.c */ +void GetFullPath(FSSpec *theSpec, StringPtr theName); + + +static void DoFileMenu (int theItem) { + extern xlload (char *, int, int); + extern xlabort(char *); + extern xlisp_wrapup (void); + StandardFileReply theFile; + + SFTypeList fileTypes; + Point pt = { 100, 100 }; + + fileTypes[0] = 'TEXT'; + switch (theItem) { + case LOAD: + case LOAD_NOISILY: + StopPasting (); + StandardGetFile(NIL, 1, fileTypes, &theFile); + if (theFile.sfGood) { + Str255 theFullPath; + short wdRefNum; + + OSErr err; + HiliteMenu (0); + + err = OpenWD(theFile.sfFile.vRefNum, theFile.sfFile.parID, 'Nyqu', &wdRefNum); + err = SetVol(NIL, wdRefNum); + SetSelection (TEXTREC->teLength, TEXTREC->teLength); /* send cursor to end */ + + GetFullPath(&theFile.sfFile, theFullPath); + P2CStr(theFullPath); + + if ((xlload((char *) theFullPath, 1, (theItem == LOAD_NOISILY))) == 0) { + xlabort("load error"); + } + macputs ("> "); + PrepareForInput (); + } + break; + case QUIT: + xlisp_wrapup (); + } +} + +static void DoEditMenu (int theItem) { + if (SystemEdit (theItem-1) == false) + switch (theItem) { + case CUT: case COPY: + if (ZeroScrap () == noErr) { + TECopy (hTERec); /* after copying, export the TE scrap */ + if (TEToScrap () != noErr) ZeroScrap (); + } + if (theItem == CUT) DeleteRange (); + break; + case PASTE: { + long scrapOffset; + if (pastedTextH) DisposeHandle (pastedTextH); + pastedTextH = (CharsHandle) NewHandle (0); + pastedLength = GetScrap (pastedTextH, 'TEXT', &scrapOffset); + if (pastedLength < 0) pastedLength = 0; /* error */ + else { + SetHandleSize (pastedTextH, pastedLength + 1); + HLock (pastedTextH); + ((char *)(*pastedTextH))[pastedLength] = '\0'; + HUnlock (pastedTextH); + } + } /* and fall through ... */ + case CLEAR: + DeleteRange (); + break; + } +} + +static void DoControlMenu (int theItem) { + extern xlbreak (char *, char *); + extern char *s_unbound; + extern xlcontinue (void); + extern xlcleanup (void); + extern xlabort (char *); + extern xltoplevel (void); + + scrflush (); + HiliteMenu (0); + switch (theItem) { + case BREAK: StopPasting (); xlbreak ("user break", s_unbound); PrepareForInput (); break; + case CONTINUE: StopPasting (); xlcontinue (); PrepareForInput (); break; + case CLEAN_UP: StopPasting (); xlcleanup (); PrepareForInput (); break; + case CANCEL_INPUT: StopPasting (); xlabort ("input canceled"); PrepareForInput (); break; + case TOP_LEVEL: StopPasting (); xltoplevel (); PrepareForInput (); break; + case SHOW_GRAPHICS: + if (gGraphicsShown) HideGrafWin (); + else ShowGrafWin (); + break; + case SPLIT_SCREEN: + MoveWindow (gCommandWin, sHorizontal, sVertical, -1); + SizeWindow (gCommandWin, sWidth, sHeight, -1); + InvalRect (&gCommandWin->portRect); + SetTERect (); + SetScrollRect (); + ShowGrafWin (); + MoveWindow (gGraphicsWin, gHorizontal, gVertical, -1); + SizeWindow (gGraphicsWin, gWidth, gHeight, -1); + break; + } +} + +void DoMenu (long choice) { + int theMenu = HiWord (choice), theItem = LoWord (choice); + + HiliteMenu (theMenu); + switch (theMenu) { + case APPLE_MENU_RES: DoAppleMenu (theItem); break; + case FILE_MENU_RES: DoFileMenu (theItem); break; + case EDIT_MENU_RES: DoEditMenu (theItem); break; + case CONTROL_MENU_RES: DoControlMenu (theItem); break; + } + HiliteMenu (0); +} + +void AdjustMenus (void) { + /* turn the stuff in the Edit menu on and off as necessary */ + long temp; + DisableItem (editMenu, UNDO); + if (TEXTREC->selStart != TEXTREC->selEnd) { + EnableItem (editMenu, CUT); + EnableItem (editMenu, COPY); + EnableItem (editMenu, CLEAR); + } else { + DisableItem (editMenu, CUT); + DisableItem (editMenu, COPY); + DisableItem (editMenu, CLEAR); + } + if (GetScrap (NIL, 'TEXT', &temp) > 0) EnableItem (editMenu, PASTE); + else DisableItem (editMenu, PASTE); +} + +RgnHandle rgn = nil; + +void DoContent (EventRecord *theEvent) { + /* handle a click in a window's content region */ + ControlHandle theScrollBar; + GrafPtr oldPort; + int scrollValue; + Point mouse = theEvent->where; + int thePart; +// RgnHandle rgn = nil; + + GetPort (&oldPort); + SetPort (gCommandWin); + GlobalToLocal (&mouse); + + // Get Selected text + rgn = NewRgn(); + TEGetHiliteRgn(rgn, hTERec); + + if (thePart = FindControl (mouse, gCommandWin, &theScrollBar)) { + switch (thePart) { + case kControlUpButtonPart: + case kControlDownButtonPart: + case kControlPageUpPart: + case kControlPageDownPart: + scrollValue = TrackControl (theScrollBar, mouse, uppScrollProc); + break; + case kControlIndicatorPart: + scrollValue = GetControlValue (theScrollBar); + thePart = TrackControl (theScrollBar, mouse, NIL); + if (thePart) { + scrollValue -= GetControlValue (theScrollBar); + if (scrollValue) TEScroll (0, scrollValue * LINEHEIGHT, hTERec); + } + break; + } + } else if (PtInRgn(mouse, rgn)) { + if (!DragText(theEvent)) { + TEClick(mouse, false, hTERec); + } + } else if (PtInRect (mouse, &(TEXTREC->viewRect))) { + TEClick (mouse, (theEvent->modifiers & shiftKey) != 0, hTERec); + } + SetPort (oldPort); + DisposeRgn(rgn); +} + + +void DoEvent (void) { + EventRecord theEvent; + + if ((flashTime) && (--flashTime == 0)) SetSelection (cursorBeforeFlash, cursorBeforeFlash); + if (outputBufferLength) FlushOutput (); + if (FrontWindow () == gCommandWin) TEIdle (hTERec); + recentChar = '\0'; + + if (WaitNextEvent (everyEvent, &theEvent, 0, gMouseRgn)) { + + AdjustCursor (theEvent.where, gMouseRgn); + + switch (theEvent.what) { + case kHighLevelEvent: + AEProcessAppleEvent(&theEvent); + break; + case mouseDown: + DoMouseDown (&theEvent); + break; + case keyDown: + case autoKey: + DoKeyPress (&theEvent); + break; + case activateEvt: { + WindowPtr whichWindow = (WindowPtr)theEvent.message; + SetPort (whichWindow); + if (whichWindow == gCommandWin) { + if ((theEvent.modifiers & activeFlag) == 1) { + ActivateCmdWindow(); + } else { + DeactivateCmdWindow(); + } + } + break; + } + case updateEvt: { + if ((WindowPtr)theEvent.message == gCommandWin) UpdateCmdWindow (); + if ((WindowPtr)theEvent.message == gGraphicsWin) UpdateGraphWindow (); + break; + } + case osEvt: + if (((theEvent.message >> 24) & 0xff) == suspendResumeMessage) { + if (theEvent.message & resumeFlag) { + gInBackground = false; + if (FrontWindow () == gCommandWin) { + ActivateCmdWindow(); + } + } else { + gInBackground = true; + if (FrontWindow () == gCommandWin) { + SetPort (gCommandWin); + DeactivateCmdWindow(); + } + } + } + break; + + } + } + AdjustCursor (theEvent.where, gMouseRgn); +} + +void MacWrapUp (void) { + /* take everything down in preparation for quitting */ + CleanupCmdWindow(); + CloseWindow (gGraphicsWin); +} diff --git a/sys/mac/macint.h b/sys/mac/macint.h new file mode 100644 index 0000000..6092e67 --- /dev/null +++ b/sys/mac/macint.h @@ -0,0 +1,166 @@ +#define INT_MAX +32767 + +#define INT_MIN -32767 + +/* resource id's */ + +#define CWINRES 400 + +#define GWINRES 401 + +#define MBAR_RES 400 + +#define APPLE_MENU_RES 400 + +#define FILE_MENU_RES 401 + +#define EDIT_MENU_RES 402 + +#define CONTROL_MENU_RES 403 + +#define STRINGS_RES 400 + + + +/* Apple menu */ + +#define ABOUT_ITEM 1 + +#define ABOUT_BOX 400 + +#define ABOUT_PICT 400 + + + +/* File menu */ + +#define LOAD 1 + +#define LOAD_NOISILY 2 + +#define QUIT 4 + + + +/* Edit menu */ + +#define UNDO 1 + +#define CUT 3 + +#define COPY 4 + +#define PASTE 5 + +#define CLEAR 6 + + + +/* Control menu */ + +#define BREAK 1 + +#define CONTINUE 2 + +#define CLEAN_UP 3 + +#define CANCEL_INPUT 4 + +#define TOP_LEVEL 5 + +#define SHOW_GRAPHICS 7 + +#define SPLIT_SCREEN 8 + + + +/* window sizing/dragging stuff */ + +#define DRAG_THRESHOLD 8 + +#define MIN_WIN_HEIGHT 80 + +#define MIN_WIN_WIDTH 120 + + + +#define MAX_BUF 250 /* max chars in output buffer */ + +#define SCROLLBACK_THRESHHOLD 30000 /* max chars kept in window */ + +#define DELETE_BLOCK 10000 /* how many chars to delete when threshhold reached */ + + + +#define LINEHEIGHT 11 /* height in pixels of 9-point Geneva, the font used */ + +#define STACKMIN 400000 /* amout of memory for application stack */ + +#define MASTERS 3 /* arbitrary -- how many times to call MoreMasters() */ + + + +/* key codes */ + +#define RETURN 0x0d + +#define ENTER 0x03 + +#define DELETE 0x08 + +#define FWDDEL 0x7F + +#define CLRKEY 0x1b + +#define PAGEUP 0x0b + +#define PAGEDN 0x0c + +#define HOMEKEY 0x01 + +#define ENDKEY 0x04 + +#define HELPKEY 0x05 + +#define FNKEY 0x10 + +#define LEFTARROW 0x1c + +#define RIGHTARROW 0x1d + +#define UPARROW 0x1e + +#define DOWNARROW 0x1f + +#define DBLQUOTE '\"' + + + +/* useful definitions */ + +#define MBAR_HEIGHT 20 + +#define TITLEBAR_HEIGHT 20 + +#define SCROLLER_WIDTH 15 + +#define SCREEN_MARGIN 2 + +#define TEXT_MARGIN 4 + +#define GRAFWIN_HEIGHT 232 + +void AdjustMenus(void); + +void DoMenu(long choice); + +void HideGrafWin(void); + +void DoContent(EventRecord *theEvent); + +void InitMac(void); + +void MacWrapUp(void); + + +void DoEvent (void); diff --git a/sys/mac/macptrs.h b/sys/mac/macptrs.h new file mode 100644 index 0000000..4dad03a --- /dev/null +++ b/sys/mac/macptrs.h @@ -0,0 +1,52 @@ +{ "HIDEPEN", S, xhidepen }, /* 300 */ + +{ "SHOWPEN", S, xshowpen }, /* 301 */ + +{ "GETPEN", S, xgetpen }, /* 302 */ + +{ "PENSIZE", S, xpensize }, /* 303 */ + +{ "PENMODE", S, xpenmode }, /* 304 */ + +{ "PENPAT", S, xpenpat }, /* 305 */ + +{ "PENNORMAL", S, xpennormal }, /* 306 */ + +{ "MOVETO", S, xmoveto }, /* 307 */ + +{ "MOVE", S, xmove }, /* 308 */ + +{ "LINETO", S, xdrawto }, /* 309 */ + +{ "LINE", S, xdraw }, /* 310 */ + +{ "SHOW-GRAPHICS", S, xshowgraphics }, /* 311 */ + +{ "HIDE-GRAPHICS", S, xhidegraphics }, /* 312 */ + +{ "CLEAR-GRAPHICS", S, xcleargraphics }, /* 313 */ + +{ "TOOLBOX", S, xtool }, /* 314 */ + +{ "TOOLBOX-16", S, xtool16 }, /* 315 */ + +{ "TOOLBOX-32", S, xtool32 }, /* 316 */ + +{ "NEWHANDLE", S, xnewhandle }, /* 317 */ + +{ "NEWPTR", S, xnewptr }, /* 318 */ + +{ "HIWORD", S, xhiword }, /* 319 */ + +{ "LOWORD", S, xloword }, /* 320 */ + +{ "READ-CHAR-NO-HANG", S, xrdnohang }, /* 321 */ + + + +/* not implemented - take a look at code in directory "sys:mac:old" */ + +/*{ "COMMAND-POINT-SIZE", S, xptsize }, 322 */ + + + diff --git a/sys/mac/macstuff.c b/sys/mac/macstuff.c new file mode 100644 index 0000000..99ecad8 --- /dev/null +++ b/sys/mac/macstuff.c @@ -0,0 +1,226 @@ +/* macstuff.c - macintosh interface routines for xlisp */ +/* Written by Brian Kendig. */ +/* This file contains the stuff that the other xlisp files call directly. */ + +#include "cext.h" +#include <stdio.h> +#include <stdarg.h> +#include <QuickDraw.h> /* for Random */ +#include <Memory.h> /* for DisposePtr */ +#include <SegLoad.h> /* for ExitToShell */ +#include "xlisp.h" +#include <string.h> +#include "macint.h" +#include "MacCommandWin.h" +#define DELETE 0x08 + +/* externals */ +extern FILE *tfp; /* transcript file pointer */ +extern int cursorPos; +extern char *macgets (void); + +/* local variables */ +int lposition; +static char *linebuf = NULL, *lineptr; +static int numChars; + +/* system-dependent variable definitions */ +static const char os_pathchar = ':'; +static const char os_sepchar = ','; + + +int isascii (char c) { return 1; } /* every char is an ascii char, isn't it? */ + +void osinit (char *banner) { + int i; + char version[] = "\nMacintosh interface by Brian Kendig, Erik A. Dahl, and Dominic Mazzoni.\n"; + InitMac (); /* initialize the mac interface routines */ + lposition = 0; /* initialize the line editor */ + for (i = 0; banner[i] != '\0'; i++) macputc (banner[i]); + for (i = 0; version[i] != '\0'; i++) macputc (version[i]); +} + +FILE *osaopen (char *name, char *mode) { + return fopen (name, mode); +} + +FILE *osbopen (char *name, char *mode) { + FILE *f; + char nmode[4]; + strcpy (nmode, mode); strcat (nmode, "b"); + f = fopen(name, nmode); + return f; +} + +int osclose (FILE *fp) { return (fclose (fp)); } +int osaputc (int ch, FILE *fp) { return (putc (ch, fp)); } +int osbputc (int ch, FILE *fp) { return (putc (ch, fp)); } + +/* osagetc - get a character from an ascii file */ +int osagetc(fp) + FILE *fp; +{ + return (getc(fp)); +} + +int ostgetc (void) { + int i; + + if (numChars <= 0) { /* get some more */ + if (linebuf) DisposePtr (linebuf); + linebuf = macgets (); + i = 0; + while (linebuf[i] != '\0') i++; + numChars = i; + if (tfp) for (i = 0; i < numChars; i++) osaputc (linebuf[i], tfp); + lineptr = linebuf; + } + numChars--; + if (*lineptr == '\r') { + lineptr++; + return '\n'; + } else return (*lineptr++); +} + +void ostputc (int ch) { + macputc (ch); + if (tfp) osaputc (ch, tfp); +} + +void osflush (void) { + lineptr = linebuf; + numChars = 0; + lposition = 0; +} + +void oscheck (void) { DoEvent (); } + +void oserror (char *msg) { + char line[100], *p; + sprintf (line,"error: %s\n",msg); + for (p = line; *p != '\0'; ++p) ostputc (*p); +} + +void osfinish(void) { + /* dispose of everything... */ + if (linebuf) DisposePtr(linebuf); + portaudio_exit(); + MacWrapUp (); + ExitToShell (); +} + +#define GPRINTF_MESSAGE_LEN 500 + +/* nyquist_printf -- system independent version of printf */ +/* + * this function prints to console like printf, but using GUI + * rather than stdio when appropriate. + * + */ +void nyquist_printf(char *format, ...) +{ + char temp[GPRINTF_MESSAGE_LEN]; + va_list pvar; + char *p = temp; + va_start(pvar, format); + vsnprintf(temp, GPRINTF_MESSAGE_LEN, format, pvar); + va_end(pvar); + while (*p) ostputc(*p++); +} + +int renamebackup (char *filename) { return 0; } + +static FSSpec prefsFSSpec; +static int need_preferences_file = false; +static char xlisp_path[1024]; /* cache for the path */ +static int valid_xlisp_path = false; + +/* xsetupconsole -- used to configure window in Win32 version */ +LVAL xsetupconsole() { return NIL; } + + +/* this should really be in a header for MacFileUtils.c */ +void GetFullPath(FSSpec *theSpec, StringPtr theName); + + +void get_xlisp_path(char *p, long p_max, int *prefs_found) +{ + Str63 fileName = "\pXLisp Preferences"; + SInt16 foundPrefVRefNum = 0; + SInt32 foundPrefDirID = 0; + OSErr err = noErr; + *p = 0; /* initialize to empty string */ + *prefs_found = false; + /* if we find path in the cache, copy and return */ + if (valid_xlisp_path) { + *prefs_found = true; + strcpy(p, xlisp_path + 10); /* remember, path has XLISPPATH= at head */ + return; + } + /* if we've been here before, do not try opening again */ + if (need_preferences_file) return; + err = FindFolder(kOnSystemDisk, kPreferencesFolderType, + kDontCreateFolder, &foundPrefVRefNum, + &foundPrefDirID); + if (err == noErr) { + err = FSMakeFSSpec(foundPrefVRefNum, foundPrefDirID, + fileName, &prefsFSSpec); + *prefs_found = (err == noErr); + need_preferences_file = !*prefs_found; + } + if (*prefs_found) { + FILE *pf; + GetFullPath(&prefsFSSpec, (StringPtr) xlisp_path); + P2CStr((StringPtr) xlisp_path); + pf = fopen(xlisp_path, "r"); + if (!pf) { + return; /* problem opening the path */ + } + while (fgets(xlisp_path, 1023, pf)) { + if (strncmp(xlisp_path, "XLISPPATH=", 10) == 0) { + valid_xlisp_path = true; + xlisp_path[strlen(xlisp_path) - 1] = 0; /* trim newline */ + strcpy(p, xlisp_path + 10); + break; + } + } + fclose(pf); + } +} + + +/* this is called when we load a file -- if need_preference_file, + * we will build a preference file and insert the path of the file + * we just opened, assuming it will tell us where to find init.lsp + */ +void setup_preferences(char *filename) +{ + if (need_preferences_file) { + unsigned char prefname[256]; + FILE *pf; + char *cp; + int len = 0; + GetFullPath(&prefsFSSpec, prefname); + need_preferences_file = false; + P2CStr(prefname); + /* we expect file-not-found error, path is valid */ + pf = fopen((char *) prefname, "w"); + if (pf == NULL) return; + cp = strrchr((char *) filename, ':'); + if (cp == NULL) return; + cp[1] = 0; + /* now, filename is the path. If filename ends in runtime, this + * is probably the standard nyquist runtime folder. We should put + * the nyquist lib folder on the path too. + */ + len = cp + 1 - filename; + if (len >= 9 && + strcmp(filename + len - 9, ":runtime:") == 0) { + filename[len - 8] = 0; + fprintf(pf, "XLISPPATH=%sruntime:,%slib:\n", filename, filename); + } else { + fprintf(pf, "XLISPPATH=%s\n", filename); + } + fclose(pf); + } +} diff --git a/sys/mac/macstuff.h b/sys/mac/macstuff.h new file mode 100644 index 0000000..29b9b32 --- /dev/null +++ b/sys/mac/macstuff.h @@ -0,0 +1,7 @@ +/* macstuff.h -- header for mac-specific functions */ + +void osfinish(void); +/* put searchpath into p, prefs_found tells if preference file exists */ +void get_xlisp_path(char *p, long p_max, int *prefs_found); +void setup_preferences(char *filename); + diff --git a/sys/mac/sndsystem.h b/sys/mac/sndsystem.h new file mode 100644 index 0000000..f34ea83 --- /dev/null +++ b/sys/mac/sndsystem.h @@ -0,0 +1,2 @@ +#include "sndmac.h" + diff --git a/sys/mac/switches.h b/sys/mac/switches.h new file mode 100644 index 0000000..c5a8e58 --- /dev/null +++ b/sys/mac/switches.h @@ -0,0 +1,58 @@ +/* switches.h for Macintosh */ + +/* CHANGE LOG + * -------------------------------------------------------------------- + * 28Apr03 dm major reorganization of conditional compilation in Nyquist + */ + + +#define HAS_STDLIB_H 1 +#undef HAS_SYS_TYPES_H +#undef HAS_SYS_STAT_H +#define HAS_STAT_H 1 +#undef HAS_MALLOC_H + +#define HAS_GETTIMEOFDAY 1 + +#undef READ_LINE + +#define XL_BIG_ENDIAN 1 +#undef XL_LITTLE_ENDIAN + +#define USE_RAND 1 +#undef USE_RANDOM + +/* define this to be printf, or define your own fn of the form + void nyquist_printf(char *format, ...); + (for a GUI) +*/ +void nyquist_printf(char *format, ...); + +#define NEED_ULONG 1 +#define NEED_USHORT 1 +#define NEED_BYTE 1 + +#define NEED_ROUND 1 + +#undef NEED_DEFINE_MALLOC + +/* explicitly choose a platform */ +#undef UNIX +#undef WINDOWS +#undef MICROSOFT +#undef DOS +#define MACINTOSH 1 + +#define BUFFERED_SYNCHRONOUS_INPUT 1 +#define SPACE_FOR_PLAY 10000 +#define MAX_CHANNELS 16 + +/* this will enable code to read midi files, etc. */ +#define CMTSTUFF 1 + +/* NYQUIST tells some CMT code that we're really in + * XLISP and NYQUIST + */ +#define NYQUIST 1 + +#include "swlogic.h" diff --git a/sys/mac/system.lsp b/sys/mac/system.lsp new file mode 100644 index 0000000..ea65573 --- /dev/null +++ b/sys/mac/system.lsp @@ -0,0 +1,107 @@ +; system.lsp -- machine/system-dependent definitions +; Macintosh + +(setf ny:bigendianp t) + +;; note that *default-sf-format* is used below by +;; compute-default-sound-file +(if (not (boundp '*default-sf-format*)) + (setf *default-sf-format* snd-head-AIFF)) + +;; note that compute-default-sound-file uses *default-sf-format*, +;; so be sure to set *default-sf-format* first (this was just done) +(if (not (boundp '*default-sound-file*)) + (compute-default-sound-file)) + + (if (not (boundp '*default-sf-dir*)) + (setf *default-sf-dir* "")) + +(if (not (boundp '*default-sf-mode*)) + (setf *default-sf-mode* snd-mode-pcm)) + +(if (not (boundp '*default-sf-bits*)) + (setf *default-sf-bits* 16)) + +(if (not (boundp '*default-plot-file*)) + (setf *default-plot-file* "points.dat")) + +; turn off switch to play sound as it is computed +(setf *soundenable* T) + +; local definition for play +(defmacro play (expr) + `(s-save-autonorm ,expr NY:ALL *default-sound-file* :play *soundenable*)) + +(defun r () + (s-save (s-read *default-sound-file*) NY:ALL "" :play t) +) + +; PLAY-FILE -- play a file +(defun play-file (name) + (s-save (s-read name) NY:ALL "" :play t)) + +; FULL-NAME-P -- test if file name is a full path or relative path +; +; (otherwise the *default-sf-dir* will be prepended +; +(defun full-name-p (filename) + (eq (char filename 0) #\:)) + +(setf *file-separator* #\:) + +; save the standard function to write points to a file +; +;(setfn s-plot-points s-plot) + +(defun array-max-abs (points) + (let ((m 0.0)) + (dotimes (i (length points)) + (setf m (max m (abs (aref points i))))) + m)) + +(setf graph-width 800) +(setf graph-height 220) + + +(defun s-plot (snd &optional (n 800)) + (show-graphics) + (clear-graphics) + (cond ((soundp snd) + (s-plot-2 snd n (/ graph-height 2) graph-height nil)) + (t + (let ((gh (/ graph-height (length snd))) + hs) + (dotimes (i (length snd)) + (setf hs (s-plot-2 (aref snd i) n (+ (/ gh 2) (* i gh)) gh hs))))))) + + +(defun s-plot-2 (snd n y-offset graph-height horizontal-scale) + (prog ((points (snd-samples snd n)) + maxpoint horizontal-scale vertical-scale) + (setf maxpoint (array-max-abs points)) + (moveto 0 y-offset) + (lineto graph-width y-offset) + (moveto 0 y-offset) + (cond ((null horizontal-scale) + (setf horizontal-scale (/ (float graph-width) (length points))))) + (setf vertical-scale (- (/ (float graph-height) 2 maxpoint))) + (dotimes (i (length points)) + (lineto (truncate (* horizontal-scale i)) + (+ y-offset (truncate (* vertical-scale (aref points i)))))) + (format t "X Axis: ~A to ~A (seconds)\n" (snd-t0 snd) (/ (length points) (snd-srate snd))) + (format t "Y Axis: ~A to ~A\n" (- maxpoint) maxpoint) + (format t "~A samples plotted.\n" (length points)) + (return horizontal-scale) + )) + + + + +; S-EDIT - run the audio editor on a sound +; +;(defmacro s-edit (&optional expr) +; `(prog () +; (if ,expr (s-save ,expr 1000000000 *default-sound-file*)) +; (system (format nil "audio_editor ~A &" +; (soundfilename *default-sound-file*))))) + diff --git a/sys/mac/xlextstart.c b/sys/mac/xlextstart.c new file mode 100644 index 0000000..be321fe --- /dev/null +++ b/sys/mac/xlextstart.c @@ -0,0 +1 @@ +/* nothing to do */ diff --git a/sys/unix/README.txt b/sys/unix/README.txt new file mode 100644 index 0000000..8684dd0 --- /dev/null +++ b/sys/unix/README.txt @@ -0,0 +1,138 @@ +README.txt -- Nyquist information for Unix systems + +UNIX INSTALLATION +================= +For Unix systems, Nyquist is distributed as a compressed file of +sources named nyqsrc3<nn>.zip, where <nn> is the version number +(e.g. v3.01 was in nyqsrc301.zip). To install Nyquist, copy +nyqsrc3<nn>.zip) to the directory on your machine where you would +like to install Nyquist. + +Note 1: you will need the "normal tool chain" consisting of the Gnu +C/C++ compiler, linker, C/C++ runtime libraries, autoconf, libtool, +automake, etc. Most linux installations already have this, but some +more recent trimmed-down installations for netbooks and +consumer-oriented computers do not have compilers installed by +default. + +Note 2: There are two main unix versions of Nyquist: alsa and nonalsa. +The alsa version is probably what you want. This version uses ALSA, +the Linux audio system. This has also become standard, but your +machine might not have the ALSA development package (probably named +libasound2-dev), so you might have to install it. If you find you are +missing "asound", you are missing and need to install the ALSA +developmnent package. The nonalsa version is a special version for +Debian linux. The ONLY difference is that it omits -lasound from the +link step, so it does not try to link with ALSA. I assume this works +because the PortAudio library which is included in the Nyquist sources +configures itself differently on Debian and doesn't need ALSA. + +After unzipping sources, type: + + gunzip nyqsrc3<nn>.zip + cd nyquist + # In the following line, Debian linux users should + # type "nonalsa" in place of "alsa": + ln -s sys/unix/alsa/Makefile Makefile + setenv XLISPPATH `pwd`/runtime:`pwd`/lib + make + +(For bash shell users, instead of the setenv command, use this: + + export XLISPPATH=`pwd`/runtime:`pwd`/lib +) + +The first line creates a nyquist directory and some +subdirectories. The second line (cd) changes directories to the new +nyquist directory. The third line (ln) makes a link from the top-level +directory to the Makefile for your system. In place of "alsa" in +sys/unix/alsa/Makefile, you should substitute your system +type. Current systems are alsa, nonalsa, next, pmax, rs6k, sgi, and +sparc, but since only the alsa and nonalsa versions have been tested +in recent years, do not expect anything else to work. The setenv (or +export) command tells Nyquist where to search for lisp files to be +loaded when a file is not found in the current directory. See +SHELL STARTUP below for information about how to automate this. + +RUNNING NYQUIST FROM THE COMMAND LINE +===================================== +Assuming the make completes successfully, you can run Nyquist as follows: + ./ny +When you get the prompt, you may begin typing expressions such as +the ones in the following "Examples" section in the Nyquist +manual. (See doc/nyquistman.pdf or doc/home.html). + +RUNNING NYQUIST USING NyquistIDE +===================================== +One you establish that Nyquist (ny) is working from the command line, +you should try using NyquistIDE, the Java-based Nyquist development +environment. First, make jny executable (do this only once when you +install Nyquist): + chmod +x jny +Then try running jNyqIDE by typing: + ./jny + +If the NyquistIDE window does not appear, make sure you have Java +installed (if not, you probably already encountered errors when you +ran the make command.) You can also try recompiling the Java +files. Note that jnyqide/SpecialMacHandler.java will NOT compile +under non-OS X systems. The Makefile renames this file to "hide" it +from the Java compiler, compiles all the remaining java files, and +then restores jnyqide/SpecialMacHandler.java: + make jnyqide/jNyqIDE.jar + +NYQUIST SEARCH PATH UNDER NyquistIDE +==================================== +Note: With Linux and Mac OS X, jNyqIDE defines the environment passed +to Nyquist. If you set XLISPPATH as shown above, it will be passed +along to Nyquist under jNyqIDE. If not, a default XLISPPATH will have +the lib and runtime directories only. This does not apply to Windows +because even though the environment is there, the Windows version of +Nyquist reads the XLISPPATH from the Registry. + +You can also specify the search path by creating the file +nyquist/xlisppath, which should have colon-separated paths on a single +(long) line of text. This file will override the environment variable +XLISPPATH. + +MORE DETAILS +============ +It is good to have USER in the environment with your user ID. This +string is used to construct some file names. NyquistIDE will look for it +in the environment. You can also specify your user ID using the file +nyquist/user, but if you have a shared installation of Nyquist, +this will not be very useful. + +Note: Nyquist looks for the file init.lsp in the current directory. +If you look in the init.lsp in runtime, you will notice two things. +First, init.lsp loads nyquist.lsp from the Nyquist directory, and +second, init.lsp loads system.lsp which in turn defines the macro +play. Normally, Nyquist plays audio through the PortAudio library, +which should work on any system. An alternative is to save audio to a +file and invoke a local non-Nyquist program to play the sound file. +You can modify system.lsp to accomplish this. + +SHELL STARTUP +============= +The (runtime +directory should always be on your XLISPPATH when you run Nyquist, so +you may want to set XLISPPATH in your shell startup file, e.g. .cshrc. + +Which shell are you using? echo $SHELL will tell you. If you use +/bin/bash, your startup file is probably ~/.profile. (Remember that +"~/" means your home directory, so the file will be something like +/home/rbd/.profile). In this file, you can add a line such as: + +export XLISPPATH="/home/rbd/nyquist/runtime:/home/rbd/nyquist/lib" + +Do not use the shorthand `pwd`/runtime, because `pwd` returns the +current working directory, which is not going to be your Nyquist +directory when .profile is loaded. + +If you use /bin/csh (the C Shell), your startup file is probably +~/.cshrc. (Remember that "~/" means your home directory, so the file +will be something like /home/rbd/.profile). In this file, you can add +a line such as: + +setenv XLISPPATH "/home/rbd/nyquist/runtime:/home/rbd/nyquist/lib" + diff --git a/sys/unix/alsa/Makefile b/sys/unix/alsa/Makefile new file mode 100644 index 0000000..c3db832 --- /dev/null +++ b/sys/unix/alsa/Makefile @@ -0,0 +1,1178 @@ +# +# Makefile for Nyquist, SYSTEM-TYPE is ALSA +# run make in the top-level Nyquist directory to compile Nyquist +# +# NOTE: this file is machine-generated. DO NOT EDIT! +# Instead, modify makefile.lsp and regenerate the makefile. +# Ports and bug fixes are welcome - please mail them to +# dannenberg@cs.cmu.edu. Thanks. +# + +# This is the resulting executable (normally "ny"): +NY = ny + +OPT = -O2 -m32 +# OPT = -g -m32 + +EVERYTHING = $(NY) runtime/system.lsp jnyqide/jNyqIDE.jar \ + bin/ser-to-osc bin/test-client + +CURRENT = $(EVERYTHING) + +current: $(CURRENT) + +onlyny: $(NY) runtime/system.lsp + +JAVASRC = jnyqide/browser.java jnyqide/NyquistThread.java \ + jnyqide/Pair.java jnyqide/BareBonesBrowserLaunch.java \ + jnyqide/EnvelopeFrame.java jnyqide/Piano_Roll.java \ + jnyqide/FindDialog.java jnyqide/PlotFrame.java \ + jnyqide/InstrumentCharacteristics.java \ + jnyqide/PlotMouseAdapter.java \ + jnyqide/Jslide.java jnyqide/PopupListener.java \ + jnyqide/LispFileFilter.java jnyqide/PreferencesDialog.java \ + jnyqide/MainFrame_AboutBox.java jnyqide/ReplaceDialog.java \ + jnyqide/MainFrame.java jnyqide/SpringUtilities.java \ + jnyqide/Main.java \ + jnyqide/NotFoundDialog.java jnyqide/TextColor.java \ + jnyqide/NyqPlot.java jnyqide/Trie.java \ + jnyqide/NyquistFile.java jnyqide/WordList.java + + +jnyqide/jNyqIDE.jar: $(JAVASRC) + if [ -r jnyqide/SpecialMacHandler.java ] ; then \ + mv jnyqide/SpecialMacHandler.java jnyqide/SpecialMacHandler.hidden ;\ + fi + cd jnyqide; javac *.java + mv jnyqide/SpecialMacHandler.hidden jnyqide/SpecialMacHandler.java + rm -rf jnyqide/jNyqIDE.jar + jar -cfm jnyqide/jNyqIDE.jar jnyqide/manifest.txt jnyqide/*.class + +# Standard list of includes (common to all unix versions) +# Keeping portaudio and libsndfile sources local to nyquist +INCL = -Inyqsrc -Itran -Ixlisp -Isys/unix -Icmt -Iffts/src \ + -Inyqstk/include -Inyqstk -Iportaudio/include -Iportaudio/src/common \ + -Iportaudio/src/os/unix \ + -Iliblo -Inylsf + +# system dependent stuff for alsa: + +AUDIOLIBS = -lasound + +CC = gcc + +LIBPA_PATH = portaudio/lib/.libs + +LIBLO_PATH = liblo/src/.libs + +# to enable command line editing, use -DREADLINE. WARNING: THIS WILL +# DISABLE THE ABILITY TO INTERRUPT LISP AND USE SOME OTHER HANDY +# CONTROL CHARACTERS (You will also need the readline and curses libraries) +CFLAGS = -DOSC -DCMTSTUFF $(OPT) $(INCL) \ + -DHAVE_LIBPTHREAD=1 -D_FILE_OFFSET_BITS=64 \ + -DSTK_NYQUIST -DUSE_VSPRINTF \ + -DHAVE_CONFIG_H +LN = g++ -m32 +AR = ar +# to enable command line editing, insert -lreadline -lcurses +LFLAGS = $(LIBPA_PATH)/libportaudio.a $(LIBLO_PATH)/liblo.a $(AUDIOLIBS) -lm -lpthread -lrt + +TAGS: + find . ( -name + +INTGEN = misc/intgen + +# Object files for Nyquist: +OBJECTS = xlisp/extern.o xlisp/xldmem.o \ + xlisp/xlbfun.o xlisp/xlcont.o \ + xlisp/xldbug.o xlisp/xleval.o \ + xlisp/xlfio.o xlisp/xlftab.o \ + xlisp/xlglob.o xlisp/xlimage.o \ + xlisp/xlinit.o xlisp/xlio.o \ + xlisp/xlisp.o xlisp/xljump.o \ + xlisp/xllist.o xlisp/xlmath.o \ + xlisp/xlobj.o xlisp/xlpp.o \ + xlisp/xlprin.o xlisp/xlread.o \ + xlisp/xlstr.o xlisp/xlsubr.o \ + xlisp/xlsym.o xlisp/xlsys.o \ + xlisp/path.o tran/abs.o \ + tran/allpoles.o tran/alpass.o \ + tran/alpasscv.o tran/alpassvv.o \ + tran/amosc.o tran/areson.o \ + tran/aresonvc.o tran/aresoncv.o \ + tran/aresonvv.o tran/atone.o \ + tran/atonev.o tran/biquadfilt.o \ + tran/buzz.o tran/chase.o \ + tran/clip.o tran/congen.o \ + tran/const.o tran/coterm.o \ + tran/delaycc.o tran/delaycv.o \ + tran/eqbandvvv.o tran/exp.o \ + tran/follow.o tran/fmosc.o \ + tran/fromobject.o tran/fromarraystream.o \ + tran/gate.o tran/ifft.o \ + tran/instrclar.o tran/instrclarall.o \ + tran/instrclarfreq.o tran/instrsax.o \ + tran/instrsaxall.o tran/instrsaxfreq.o \ + tran/integrate.o tran/log.o \ + tran/lpreson.o tran/maxv.o \ + tran/offset.o tran/oneshot.o \ + tran/osc.o tran/partial.o \ + tran/pluck.o tran/prod.o \ + tran/pwl.o tran/quantize.o \ + tran/recip.o tran/reson.o \ + tran/resonvc.o tran/resoncv.o \ + tran/resonvv.o tran/sampler.o \ + tran/scale.o tran/shape.o \ + tran/sine.o tran/siosc.o \ + tran/slope.o tran/sqrt.o \ + tran/tapf.o tran/tapv.o \ + tran/tone.o tran/tonev.o \ + tran/upsample.o tran/white.o \ + tran/stkrev.o tran/stkpitshift.o \ + tran/stkchorus.o tran/instrbow.o \ + tran/instrbowedfreq.o tran/instrbanded.o \ + tran/instrmandolin.o tran/instrsitar.o \ + tran/instrmodalbar.o tran/instrflute.o \ + tran/instrflutefreq.o tran/instrfluteall.o \ + tran/fmfb.o tran/fmfbv.o \ + cmt/cext.o cmt/cleanup.o \ + cmt/cmdline.o cmt/cmtcmd.o \ + cmt/moxc.o cmt/mem.o \ + cmt/midifile.o cmt/midifns.o \ + cmt/record.o cmt/seq.o \ + cmt/seqmread.o cmt/seqmwrite.o \ + cmt/seqread.o cmt/seqwrite.o \ + cmt/tempomap.o cmt/timebase.o \ + cmt/userio.o nylsf/aiff.o \ + nylsf/alaw.o nylsf/au.o \ + nylsf/avr.o nylsf/broadcast.o \ + nylsf/caf.o nylsf/command.o \ + nylsf/common.o nylsf/dither.o \ + nylsf/double64.o nylsf/dwd.o \ + nylsf/dwvw.o nylsf/file_io.o \ + nylsf/flac.o nylsf/float32.o \ + nylsf/gsm610.o nylsf/htk.o \ + nylsf/ima_adpcm.o nylsf/interleave.o \ + nylsf/ircam.o nylsf/macbinary3.o \ + nylsf/macos.o nylsf/mat4.o \ + nylsf/mat5.o nylsf/ms_adpcm.o \ + nylsf/nist.o nylsf/ogg.o \ + nylsf/paf.o nylsf/pcm.o \ + nylsf/pvf.o nylsf/raw.o \ + nylsf/rx2.o nylsf/sd2.o \ + nylsf/sds.o nylsf/sndfile.o \ + nylsf/strings.o nylsf/svx.o \ + nylsf/txw.o nylsf/ulaw.o \ + nylsf/voc.o nylsf/vox_adpcm.o \ + nylsf/w64.o nylsf/wav.o \ + nylsf/wav_w64.o nylsf/wve.o \ + nylsf/xi.o nylsf/g72x.o \ + nylsf/GSM610/add.o nylsf/GSM610/code.o \ + nylsf/GSM610/decode.o nylsf/GSM610/gsm_create.o \ + nylsf/GSM610/gsm_decode.o nylsf/GSM610/gsm_destroy.o \ + nylsf/GSM610/gsm_encode.o nylsf/GSM610/gsm_option.o \ + nylsf/GSM610/long_term.o nylsf/GSM610/lpc.o \ + nylsf/GSM610/preprocess.o nylsf/GSM610/rpe.o \ + nylsf/GSM610/short_term.o nylsf/GSM610/table.o \ + nylsf/G72x/g721.o nylsf/G72x/g723_16.o \ + nylsf/G72x/g723_24.o nylsf/G72x/g723_40.o \ + nylsf/G72x/g72x.o nyqsrc/debug.o \ + nyqsrc/falloc.o nyqsrc/local.o \ + nyqsrc/handlers.o nyqsrc/multiread.o \ + nyqsrc/seqext.o nyqsrc/seqinterf.o \ + nyqsrc/stats.o nyqsrc/ffilterkit.o \ + nyqsrc/sliders.o nyqsrc/sound.o \ + nyqsrc/add.o nyqsrc/avg.o \ + nyqsrc/compose.o nyqsrc/convolve.o \ + nyqsrc/downsample.o nyqsrc/fft.o \ + nyqsrc/inverse.o nyqsrc/multiseq.o \ + nyqsrc/resamp.o nyqsrc/resampv.o \ + nyqsrc/samples.o nyqsrc/sndmax.o \ + nyqsrc/sndread.o nyqsrc/sndseq.o \ + nyqsrc/sndwritepa.o nyqsrc/yin.o \ + nyqsrc/nyq-osc-server.o nyqsrc/trigger.o \ + nyqsrc/lpanal.o nyqsrc/phasevocoder.o \ + nyqsrc/pvshell.o nyqstk/src/Generator.o \ + nyqstk/src/SineWave.o nyqstk/src/Function.o \ + nyqstk/src/FileRead.o nyqstk/src/FileWvIn.o \ + nyqstk/src/Effect.o nyqstk/src/Clarinet.o \ + nyqstk/src/Delay.o nyqstk/src/DelayL.o \ + nyqstk/src/Envelope.o nyqstk/src/Filter.o \ + nyqstk/src/Instrmnt.o nyqstk/src/Noise.o \ + nyqstk/src/OneZero.o nyqstk/src/ReedTable.o \ + nyqstk/src/Saxofony.o nyqstk/src/Stk.o \ + nyqstk/src/WaveLoop.o nyqstk/src/WvIn.o \ + nyqstk/src/NRev.o nyqstk/src/JCRev.o \ + nyqstk/src/PRCRev.o nyqstk/src/PitShift.o \ + nyqstk/src/Chorus.o nyqstk/src/Bowed.o \ + nyqstk/src/BowTable.o nyqstk/src/ADSR.o \ + nyqstk/src/OnePole.o nyqstk/src/BiQuad.o \ + nyqstk/src/BandedWG.o nyqstk/src/DelayA.o \ + nyqstk/src/Mandolin.o nyqstk/src/PluckTwo.o \ + nyqstk/src/Sitar.o nyqstk/src/ModalBar.o \ + nyqstk/src/Modal.o nyqstk/src/Flute.o \ + nyqstk/src/JetTable.o nyqstk/src/PoleZero.o \ + nyqstk/stkinit.o nyqstk/instr.o \ + nyqstk/stkint.o ffts/src/fftext.o \ + ffts/src/fftlib.o ffts/src/matlib.o \ + nyqsrc/sndfnint.o nyqsrc/seqfnint.o \ + sys/unix/osstuff.o sys/unix/term.o + +# Sound functions to add to xlisp +NYQHDRS = nyqsrc/sndfmt.h nylsf/sndfile.h \ + nyqsrc/sound.h nyqsrc/add.h \ + nyqsrc/avg.h nyqsrc/compose.h \ + nyqsrc/convolve.h nyqsrc/downsample.h \ + nyqsrc/fft.h nyqsrc/inverse.h \ + nyqsrc/multiseq.h nyqsrc/resamp.h \ + nyqsrc/resampv.h nyqsrc/samples.h \ + nyqsrc/sndmax.h nyqsrc/sndread.h \ + nyqsrc/sndseq.h nyqsrc/sndsliders.h \ + nyqsrc/sndwrite.h nyqsrc/yin.h \ + nyqsrc/nyq-osc-server.h nyqsrc/trigger.h \ + nyqsrc/lpanal.h nyqsrc/phasevocoder.h \ + nyqsrc/pvshell.h tran/abs.h \ + tran/allpoles.h tran/alpass.h \ + tran/alpasscv.h tran/alpassvv.h \ + tran/amosc.h tran/areson.h \ + tran/aresonvc.h tran/aresoncv.h \ + tran/aresonvv.h tran/atone.h \ + tran/atonev.h tran/biquadfilt.h \ + tran/buzz.h tran/chase.h \ + tran/clip.h tran/congen.h \ + tran/const.h tran/coterm.h \ + tran/delaycc.h tran/delaycv.h \ + tran/eqbandvvv.h tran/exp.h \ + tran/follow.h tran/fmosc.h \ + tran/fromobject.h tran/fromarraystream.h \ + tran/gate.h tran/ifft.h \ + tran/instrclar.h tran/instrclarall.h \ + tran/instrclarfreq.h tran/instrsax.h \ + tran/instrsaxall.h tran/instrsaxfreq.h \ + tran/integrate.h tran/log.h \ + tran/lpreson.h tran/maxv.h \ + tran/offset.h tran/oneshot.h \ + tran/osc.h tran/partial.h \ + tran/pluck.h tran/prod.h \ + tran/pwl.h tran/quantize.h \ + tran/recip.h tran/reson.h \ + tran/resonvc.h tran/resoncv.h \ + tran/resonvv.h tran/sampler.h \ + tran/scale.h tran/shape.h \ + tran/sine.h tran/siosc.h \ + tran/slope.h tran/sqrt.h \ + tran/tapf.h tran/tapv.h \ + tran/tone.h tran/tonev.h \ + tran/upsample.h tran/white.h \ + tran/stkrev.h tran/stkpitshift.h \ + tran/stkchorus.h tran/instrbow.h \ + tran/instrbowedfreq.h tran/instrbanded.h \ + tran/instrmandolin.h tran/instrsitar.h \ + tran/instrmodalbar.h tran/instrflute.h \ + tran/instrflutefreq.h tran/instrfluteall.h \ + tran/fmfb.h tran/fmfbv.h + +CMTHDRS = cmt/seqdecls.h nyqsrc/seqext.h \ + cmt/seq.h nyqsrc/seqinterf.h \ + cmt/seqread.h cmt/seqmread.h \ + cmt/seqwrite.h cmt/seqmwrite.h + + + +bin: + mkdir bin + +liblo/Makefile: + cd liblo; ./configure CFLAGS=-m32 LDFLAGS=-m32 CXXFLAGS=-m32 --enable-static --disable-shared + # sometimes, residual files cause problems + cd liblo; make clean + +$(LIBLO_PATH)/liblo.a: liblo/Makefile + cd liblo; make + +bin/ser-to-osc: bin $(LIBLO_PATH)/liblo.a + $(CC) -c $(CFLAGS) liblo/ser-to-osc/ser-to-osc.cpp \ + -o liblo/ser-to-osc/ser-to-osc.o + $(LN) liblo/ser-to-osc/ser-to-osc.o -o bin/ser-to-osc $(LFLAGS) + +bin/test-client: bin $(LIBLO_PATH)/liblo.a + $(CC) -c $(CFLAGS) liblo/test-client/test-client.c \ + -o liblo/test-client/test-client.o + $(LN) liblo/test-client/test-client.o -o bin/test-client $(LFLAGS) + +portaudio/Makefile: + # note: without-jack avoids 32/64-bit link error on Debian + cd portaudio; ./configure CFLAGS=-m32 LDFLAGS=-m32 CXXFLAGS=-m32 --enable-static --disable-shared --without-jack + # sometimes, residual files cause problems + cd portaudio; make clean + +$(LIBPA_PATH)/libportaudio.a: portaudio/Makefile + cd portaudio; make + +$(NY): $(OBJECTS) $(LIBPA_PATH)/libportaudio.a $(LIBLO_PATH)/liblo.a + $(LN) $(OBJECTS) $(LFLAGS) -o $(NY) + +# copy appropriate system.lsp and make it read-only; +# changes should be made to sys/unix/<system>/system.lsp +runtime/system.lsp: sys/unix/alsa/system.lsp + # make sure it's there before you make it writeable + touch runtime/system.lsp + chmod +w runtime/system.lsp + cp -p sys/unix/alsa/system.lsp runtime/system.lsp + chmod -w runtime/system.lsp + +nyqsrc/sound.o: nyqsrc/sound.c nyqsrc/sound.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/sound.c -o nyqsrc/sound.o $(CFLAGS) + +nyqsrc/add.o: nyqsrc/add.c nyqsrc/add.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/add.c -o nyqsrc/add.o $(CFLAGS) + +nyqsrc/avg.o: nyqsrc/avg.c nyqsrc/avg.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/avg.c -o nyqsrc/avg.o $(CFLAGS) + +nyqsrc/compose.o: nyqsrc/compose.c nyqsrc/compose.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/compose.c -o nyqsrc/compose.o $(CFLAGS) + +nyqsrc/convolve.o: nyqsrc/convolve.c nyqsrc/convolve.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/convolve.c -o nyqsrc/convolve.o $(CFLAGS) + +nyqsrc/downsample.o: nyqsrc/downsample.c nyqsrc/downsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/downsample.c -o nyqsrc/downsample.o $(CFLAGS) + +nyqsrc/fft.o: nyqsrc/fft.c nyqsrc/fft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/fft.c -o nyqsrc/fft.o $(CFLAGS) + +nyqsrc/inverse.o: nyqsrc/inverse.c nyqsrc/inverse.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/inverse.c -o nyqsrc/inverse.o $(CFLAGS) + +nyqsrc/multiseq.o: nyqsrc/multiseq.c nyqsrc/multiseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/multiseq.c -o nyqsrc/multiseq.o $(CFLAGS) + +nyqsrc/resamp.o: nyqsrc/resamp.c nyqsrc/resamp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/resamp.c -o nyqsrc/resamp.o $(CFLAGS) + +nyqsrc/resampv.o: nyqsrc/resampv.c nyqsrc/resampv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/resampv.c -o nyqsrc/resampv.o $(CFLAGS) + +nyqsrc/samples.o: nyqsrc/samples.c nyqsrc/samples.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/samples.c -o nyqsrc/samples.o $(CFLAGS) + +nyqsrc/sndmax.o: nyqsrc/sndmax.c nyqsrc/sndmax.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/sndmax.c -o nyqsrc/sndmax.o $(CFLAGS) + +nyqsrc/sndread.o: nyqsrc/sndread.c nyqsrc/sndread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/sndread.c -o nyqsrc/sndread.o $(CFLAGS) + +nyqsrc/sndseq.o: nyqsrc/sndseq.c nyqsrc/sndseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/sndseq.c -o nyqsrc/sndseq.o $(CFLAGS) + +nyqsrc/sndsliders.o: nyqsrc/sndsliders.c nyqsrc/sndsliders.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/sndsliders.c -o nyqsrc/sndsliders.o $(CFLAGS) + +nyqsrc/sndwritepa.o: nyqsrc/sndwritepa.c nyqsrc/sndwrite.h + $(CC) -c nyqsrc/sndwritepa.c -o nyqsrc/sndwritepa.o $(CFLAGS) + +nyqsrc/yin.o: nyqsrc/yin.c nyqsrc/yin.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/yin.c -o nyqsrc/yin.o $(CFLAGS) + +nyqsrc/nyq-osc-server.o: nyqsrc/nyq-osc-server.c nyqsrc/nyq-osc-server.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/nyq-osc-server.c -o nyqsrc/nyq-osc-server.o $(CFLAGS) + +nyqsrc/trigger.o: nyqsrc/trigger.c nyqsrc/trigger.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/trigger.c -o nyqsrc/trigger.o $(CFLAGS) + +nyqsrc/lpanal.o: nyqsrc/lpanal.c nyqsrc/lpanal.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/lpanal.c -o nyqsrc/lpanal.o $(CFLAGS) + +nyqsrc/phasevocoder.o: nyqsrc/phasevocoder.c nyqsrc/phasevocoder.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/phasevocoder.c -o nyqsrc/phasevocoder.o $(CFLAGS) + +nyqsrc/pvshell.o: nyqsrc/pvshell.c nyqsrc/pvshell.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/pvshell.c -o nyqsrc/pvshell.o $(CFLAGS) + +nyqsrc/debug.o: nyqsrc/debug.c nyqsrc/debug.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/debug.c -o nyqsrc/debug.o $(CFLAGS) + +nyqsrc/falloc.o: nyqsrc/falloc.c nyqsrc/falloc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/falloc.c -o nyqsrc/falloc.o $(CFLAGS) + +nyqsrc/local.o: nyqsrc/local.c xlisp/xlisp.h nyqsrc/sound.h + $(CC) -c nyqsrc/local.c -o nyqsrc/local.o $(CFLAGS) + +nyqsrc/handlers.o: nyqsrc/handlers.c + $(CC) -c nyqsrc/handlers.c -o nyqsrc/handlers.o $(CFLAGS) + +nyqsrc/multiread.o: nyqsrc/multiread.c nyqsrc/multiread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/multiread.c -o nyqsrc/multiread.o $(CFLAGS) + +nyqsrc/seqext.o: nyqsrc/seqext.c nyqsrc/seqext.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/seqext.c -o nyqsrc/seqext.o $(CFLAGS) + +nyqsrc/seqinterf.o: nyqsrc/seqinterf.c nyqsrc/seqinterf.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/seqinterf.c -o nyqsrc/seqinterf.o $(CFLAGS) + +nyqsrc/stats.o: nyqsrc/stats.c nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/stats.c -o nyqsrc/stats.o $(CFLAGS) + +nyqsrc/ffilterkit.o: nyqsrc/ffilterkit.c nyqsrc/ffilterkit.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/ffilterkit.c -o nyqsrc/ffilterkit.o $(CFLAGS) + +nyqsrc/sliders.o: nyqsrc/sliders.c nyqsrc/sliders.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/sliders.c -o nyqsrc/sliders.o $(CFLAGS) + +ffts/src/fftext.o: ffts/src/fftext.c ffts/src/fftext.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c ffts/src/fftext.c -o ffts/src/fftext.o $(CFLAGS) + +ffts/src/fftlib.o: ffts/src/fftlib.c ffts/src/fftlib.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c ffts/src/fftlib.c -o ffts/src/fftlib.o $(CFLAGS) + +ffts/src/matlib.o: ffts/src/matlib.c ffts/src/matlib.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c ffts/src/matlib.c -o ffts/src/matlib.o $(CFLAGS) + +tran/abs.o: tran/abs.c tran/abs.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/abs.c -o tran/abs.o $(CFLAGS) + +tran/allpoles.o: tran/allpoles.c tran/allpoles.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/allpoles.c -o tran/allpoles.o $(CFLAGS) + +tran/alpass.o: tran/alpass.c tran/alpass.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/alpass.c -o tran/alpass.o $(CFLAGS) + +tran/alpasscv.o: tran/alpasscv.c tran/alpasscv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/alpasscv.c -o tran/alpasscv.o $(CFLAGS) + +tran/alpassvv.o: tran/alpassvv.c tran/alpassvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/alpassvv.c -o tran/alpassvv.o $(CFLAGS) + +tran/amosc.o: tran/amosc.c tran/amosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/amosc.c -o tran/amosc.o $(CFLAGS) + +tran/areson.o: tran/areson.c tran/areson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/areson.c -o tran/areson.o $(CFLAGS) + +tran/aresonvc.o: tran/aresonvc.c tran/aresonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/aresonvc.c -o tran/aresonvc.o $(CFLAGS) + +tran/aresoncv.o: tran/aresoncv.c tran/aresoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/aresoncv.c -o tran/aresoncv.o $(CFLAGS) + +tran/aresonvv.o: tran/aresonvv.c tran/aresonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/aresonvv.c -o tran/aresonvv.o $(CFLAGS) + +tran/atone.o: tran/atone.c tran/atone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/atone.c -o tran/atone.o $(CFLAGS) + +tran/atonev.o: tran/atonev.c tran/atonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/atonev.c -o tran/atonev.o $(CFLAGS) + +tran/biquadfilt.o: tran/biquadfilt.c tran/biquadfilt.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/biquadfilt.c -o tran/biquadfilt.o $(CFLAGS) + +tran/buzz.o: tran/buzz.c tran/buzz.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/buzz.c -o tran/buzz.o $(CFLAGS) + +tran/chase.o: tran/chase.c tran/chase.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/chase.c -o tran/chase.o $(CFLAGS) + +tran/clip.o: tran/clip.c tran/clip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/clip.c -o tran/clip.o $(CFLAGS) + +tran/congen.o: tran/congen.c tran/congen.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/congen.c -o tran/congen.o $(CFLAGS) + +tran/const.o: tran/const.c tran/const.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/const.c -o tran/const.o $(CFLAGS) + +tran/coterm.o: tran/coterm.c tran/coterm.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/coterm.c -o tran/coterm.o $(CFLAGS) + +tran/delaycc.o: tran/delaycc.c tran/delaycc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/delaycc.c -o tran/delaycc.o $(CFLAGS) + +tran/delaycv.o: tran/delaycv.c tran/delaycv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/delaycv.c -o tran/delaycv.o $(CFLAGS) + +tran/eqbandvvv.o: tran/eqbandvvv.c tran/eqbandvvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/eqbandvvv.c -o tran/eqbandvvv.o $(CFLAGS) + +tran/exp.o: tran/exp.c tran/exp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/exp.c -o tran/exp.o $(CFLAGS) + +tran/follow.o: tran/follow.c tran/follow.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/follow.c -o tran/follow.o $(CFLAGS) + +tran/fmosc.o: tran/fmosc.c tran/fmosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/fmosc.c -o tran/fmosc.o $(CFLAGS) + +tran/fromobject.o: tran/fromobject.c tran/fromobject.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/fromobject.c -o tran/fromobject.o $(CFLAGS) + +tran/fromarraystream.o: tran/fromarraystream.c tran/fromarraystream.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/fromarraystream.c -o tran/fromarraystream.o $(CFLAGS) + +tran/gate.o: tran/gate.c tran/gate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/gate.c -o tran/gate.o $(CFLAGS) + +tran/ifft.o: tran/ifft.c tran/ifft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/ifft.c -o tran/ifft.o $(CFLAGS) + +tran/instrclar.o: tran/instrclar.c tran/instrclar.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrclar.c -o tran/instrclar.o $(CFLAGS) + +tran/instrclarall.o: tran/instrclarall.c tran/instrclarall.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrclarall.c -o tran/instrclarall.o $(CFLAGS) + +tran/instrclarfreq.o: tran/instrclarfreq.c tran/instrclarfreq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrclarfreq.c -o tran/instrclarfreq.o $(CFLAGS) + +tran/instrsax.o: tran/instrsax.c tran/instrsax.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrsax.c -o tran/instrsax.o $(CFLAGS) + +tran/instrsaxall.o: tran/instrsaxall.c tran/instrsaxall.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrsaxall.c -o tran/instrsaxall.o $(CFLAGS) + +tran/instrsaxfreq.o: tran/instrsaxfreq.c tran/instrsaxfreq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrsaxfreq.c -o tran/instrsaxfreq.o $(CFLAGS) + +tran/integrate.o: tran/integrate.c tran/integrate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/integrate.c -o tran/integrate.o $(CFLAGS) + +tran/log.o: tran/log.c tran/log.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/log.c -o tran/log.o $(CFLAGS) + +tran/lpreson.o: tran/lpreson.c tran/lpreson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/lpreson.c -o tran/lpreson.o $(CFLAGS) + +tran/maxv.o: tran/maxv.c tran/maxv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/maxv.c -o tran/maxv.o $(CFLAGS) + +tran/offset.o: tran/offset.c tran/offset.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/offset.c -o tran/offset.o $(CFLAGS) + +tran/oneshot.o: tran/oneshot.c tran/oneshot.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/oneshot.c -o tran/oneshot.o $(CFLAGS) + +tran/osc.o: tran/osc.c tran/osc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/osc.c -o tran/osc.o $(CFLAGS) + +tran/partial.o: tran/partial.c tran/partial.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/partial.c -o tran/partial.o $(CFLAGS) + +tran/pluck.o: tran/pluck.c tran/pluck.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/pluck.c -o tran/pluck.o $(CFLAGS) + +tran/prod.o: tran/prod.c tran/prod.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/prod.c -o tran/prod.o $(CFLAGS) + +tran/pwl.o: tran/pwl.c tran/pwl.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/pwl.c -o tran/pwl.o $(CFLAGS) + +tran/quantize.o: tran/quantize.c tran/quantize.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/quantize.c -o tran/quantize.o $(CFLAGS) + +tran/recip.o: tran/recip.c tran/recip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/recip.c -o tran/recip.o $(CFLAGS) + +tran/reson.o: tran/reson.c tran/reson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/reson.c -o tran/reson.o $(CFLAGS) + +tran/resonvc.o: tran/resonvc.c tran/resonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/resonvc.c -o tran/resonvc.o $(CFLAGS) + +tran/resoncv.o: tran/resoncv.c tran/resoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/resoncv.c -o tran/resoncv.o $(CFLAGS) + +tran/resonvv.o: tran/resonvv.c tran/resonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/resonvv.c -o tran/resonvv.o $(CFLAGS) + +tran/sampler.o: tran/sampler.c tran/sampler.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/sampler.c -o tran/sampler.o $(CFLAGS) + +tran/scale.o: tran/scale.c tran/scale.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/scale.c -o tran/scale.o $(CFLAGS) + +tran/shape.o: tran/shape.c tran/shape.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/shape.c -o tran/shape.o $(CFLAGS) + +tran/sine.o: tran/sine.c tran/sine.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/sine.c -o tran/sine.o $(CFLAGS) + +tran/siosc.o: tran/siosc.c tran/siosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/siosc.c -o tran/siosc.o $(CFLAGS) + +tran/slope.o: tran/slope.c tran/slope.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/slope.c -o tran/slope.o $(CFLAGS) + +tran/sqrt.o: tran/sqrt.c tran/sqrt.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/sqrt.c -o tran/sqrt.o $(CFLAGS) + +tran/tapf.o: tran/tapf.c tran/tapf.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/tapf.c -o tran/tapf.o $(CFLAGS) + +tran/tapv.o: tran/tapv.c tran/tapv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/tapv.c -o tran/tapv.o $(CFLAGS) + +tran/tone.o: tran/tone.c tran/tone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/tone.c -o tran/tone.o $(CFLAGS) + +tran/tonev.o: tran/tonev.c tran/tonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/tonev.c -o tran/tonev.o $(CFLAGS) + +tran/upsample.o: tran/upsample.c tran/upsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/upsample.c -o tran/upsample.o $(CFLAGS) + +tran/white.o: tran/white.c tran/white.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/white.c -o tran/white.o $(CFLAGS) + +tran/stkrev.o: tran/stkrev.c tran/stkrev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/stkrev.c -o tran/stkrev.o $(CFLAGS) + +tran/stkpitshift.o: tran/stkpitshift.c tran/stkpitshift.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/stkpitshift.c -o tran/stkpitshift.o $(CFLAGS) + +tran/stkchorus.o: tran/stkchorus.c tran/stkchorus.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/stkchorus.c -o tran/stkchorus.o $(CFLAGS) + +tran/instrbow.o: tran/instrbow.c tran/instrbow.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrbow.c -o tran/instrbow.o $(CFLAGS) + +tran/instrbowedfreq.o: tran/instrbowedfreq.c tran/instrbowedfreq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrbowedfreq.c -o tran/instrbowedfreq.o $(CFLAGS) + +tran/instrbanded.o: tran/instrbanded.c tran/instrbanded.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrbanded.c -o tran/instrbanded.o $(CFLAGS) + +tran/instrmandolin.o: tran/instrmandolin.c tran/instrmandolin.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrmandolin.c -o tran/instrmandolin.o $(CFLAGS) + +tran/instrsitar.o: tran/instrsitar.c tran/instrsitar.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrsitar.c -o tran/instrsitar.o $(CFLAGS) + +tran/instrmodalbar.o: tran/instrmodalbar.c tran/instrmodalbar.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrmodalbar.c -o tran/instrmodalbar.o $(CFLAGS) + +tran/instrflute.o: tran/instrflute.c tran/instrflute.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrflute.c -o tran/instrflute.o $(CFLAGS) + +tran/instrflutefreq.o: tran/instrflutefreq.c tran/instrflutefreq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrflutefreq.c -o tran/instrflutefreq.o $(CFLAGS) + +tran/instrfluteall.o: tran/instrfluteall.c tran/instrfluteall.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrfluteall.c -o tran/instrfluteall.o $(CFLAGS) + +tran/fmfb.o: tran/fmfb.c tran/fmfb.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/fmfb.c -o tran/fmfb.o $(CFLAGS) + +tran/fmfbv.o: tran/fmfbv.c tran/fmfbv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/fmfbv.c -o tran/fmfbv.o $(CFLAGS) + +nyqsrc/sndfnint.o: nyqsrc/sndfnint.c + $(CC) -c nyqsrc/sndfnint.c -o nyqsrc/sndfnint.o $(CFLAGS) + +nyqsrc/seqfnint.o: nyqsrc/seqfnint.c + $(CC) -c nyqsrc/seqfnint.c -o nyqsrc/seqfnint.o $(CFLAGS) + +nyqstk/stkinit.o: nyqstk/stkinit.cpp nyqstk/stkinit.h + g++ -c nyqstk/stkinit.cpp -o nyqstk/stkinit.o $(CFLAGS) + +nyqstk/instr.o: nyqstk/instr.cpp nyqstk/instr.h + g++ -c nyqstk/instr.cpp -o nyqstk/instr.o $(CFLAGS) + +nyqstk/stkint.o: nyqstk/stkint.cpp nyqstk/stkint.h + g++ -c nyqstk/stkint.cpp -o nyqstk/stkint.o $(CFLAGS) + +nyqstk/src/Generator.o: nyqstk/src/Generator.cpp nyqstk/include/Generator.h + g++ -c nyqstk/src/Generator.cpp -o nyqstk/src/Generator.o $(CFLAGS) + +nyqstk/src/SineWave.o: nyqstk/src/SineWave.cpp nyqstk/include/SineWave.h + g++ -c nyqstk/src/SineWave.cpp -o nyqstk/src/SineWave.o $(CFLAGS) + +nyqstk/src/Function.o: nyqstk/src/Function.cpp nyqstk/include/Function.h + g++ -c nyqstk/src/Function.cpp -o nyqstk/src/Function.o $(CFLAGS) + +nyqstk/src/FileRead.o: nyqstk/src/FileRead.cpp nyqstk/include/FileRead.h + g++ -c nyqstk/src/FileRead.cpp -o nyqstk/src/FileRead.o $(CFLAGS) + +nyqstk/src/FileWvIn.o: nyqstk/src/FileWvIn.cpp nyqstk/include/FileWvIn.h + g++ -c nyqstk/src/FileWvIn.cpp -o nyqstk/src/FileWvIn.o $(CFLAGS) + +nyqstk/src/Effect.o: nyqstk/src/Effect.cpp nyqstk/include/Effect.h + g++ -c nyqstk/src/Effect.cpp -o nyqstk/src/Effect.o $(CFLAGS) + +nyqstk/src/Clarinet.o: nyqstk/src/Clarinet.cpp nyqstk/include/Clarinet.h + g++ -c nyqstk/src/Clarinet.cpp -o nyqstk/src/Clarinet.o $(CFLAGS) + +nyqstk/src/Delay.o: nyqstk/src/Delay.cpp nyqstk/include/Delay.h + g++ -c nyqstk/src/Delay.cpp -o nyqstk/src/Delay.o $(CFLAGS) + +nyqstk/src/DelayL.o: nyqstk/src/DelayL.cpp nyqstk/include/DelayL.h + g++ -c nyqstk/src/DelayL.cpp -o nyqstk/src/DelayL.o $(CFLAGS) + +nyqstk/src/Envelope.o: nyqstk/src/Envelope.cpp nyqstk/include/Envelope.h + g++ -c nyqstk/src/Envelope.cpp -o nyqstk/src/Envelope.o $(CFLAGS) + +nyqstk/src/Filter.o: nyqstk/src/Filter.cpp nyqstk/include/Filter.h + g++ -c nyqstk/src/Filter.cpp -o nyqstk/src/Filter.o $(CFLAGS) + +nyqstk/src/Instrmnt.o: nyqstk/src/Instrmnt.cpp nyqstk/include/Instrmnt.h + g++ -c nyqstk/src/Instrmnt.cpp -o nyqstk/src/Instrmnt.o $(CFLAGS) + +nyqstk/src/Noise.o: nyqstk/src/Noise.cpp nyqstk/include/Noise.h + g++ -c nyqstk/src/Noise.cpp -o nyqstk/src/Noise.o $(CFLAGS) + +nyqstk/src/OneZero.o: nyqstk/src/OneZero.cpp nyqstk/include/OneZero.h + g++ -c nyqstk/src/OneZero.cpp -o nyqstk/src/OneZero.o $(CFLAGS) + +nyqstk/src/ReedTable.o: nyqstk/src/ReedTable.cpp nyqstk/include/ReedTable.h + g++ -c nyqstk/src/ReedTable.cpp -o nyqstk/src/ReedTable.o $(CFLAGS) + +nyqstk/src/Saxofony.o: nyqstk/src/Saxofony.cpp nyqstk/include/Saxofony.h + g++ -c nyqstk/src/Saxofony.cpp -o nyqstk/src/Saxofony.o $(CFLAGS) + +nyqstk/src/Stk.o: nyqstk/src/Stk.cpp nyqstk/include/Stk.h + g++ -c nyqstk/src/Stk.cpp -o nyqstk/src/Stk.o $(CFLAGS) + +nyqstk/src/WaveLoop.o: nyqstk/src/WaveLoop.cpp nyqstk/include/WaveLoop.h + g++ -c nyqstk/src/WaveLoop.cpp -o nyqstk/src/WaveLoop.o $(CFLAGS) + +nyqstk/src/WvIn.o: nyqstk/src/WvIn.cpp nyqstk/include/WvIn.h + g++ -c nyqstk/src/WvIn.cpp -o nyqstk/src/WvIn.o $(CFLAGS) + +nyqstk/src/NRev.o: nyqstk/src/NRev.cpp nyqstk/include/NRev.h + g++ -c nyqstk/src/NRev.cpp -o nyqstk/src/NRev.o $(CFLAGS) + +nyqstk/src/JCRev.o: nyqstk/src/JCRev.cpp nyqstk/include/JCRev.h + g++ -c nyqstk/src/JCRev.cpp -o nyqstk/src/JCRev.o $(CFLAGS) + +nyqstk/src/PRCRev.o: nyqstk/src/PRCRev.cpp nyqstk/include/PRCRev.h + g++ -c nyqstk/src/PRCRev.cpp -o nyqstk/src/PRCRev.o $(CFLAGS) + +nyqstk/src/PitShift.o: nyqstk/src/PitShift.cpp nyqstk/include/PitShift.h + g++ -c nyqstk/src/PitShift.cpp -o nyqstk/src/PitShift.o $(CFLAGS) + +nyqstk/src/Chorus.o: nyqstk/src/Chorus.cpp nyqstk/include/Chorus.h + g++ -c nyqstk/src/Chorus.cpp -o nyqstk/src/Chorus.o $(CFLAGS) + +nyqstk/src/Bowed.o: nyqstk/src/Bowed.cpp nyqstk/include/Bowed.h + g++ -c nyqstk/src/Bowed.cpp -o nyqstk/src/Bowed.o $(CFLAGS) + +nyqstk/src/BowTable.o: nyqstk/src/BowTable.cpp nyqstk/include/BowTable.h + g++ -c nyqstk/src/BowTable.cpp -o nyqstk/src/BowTable.o $(CFLAGS) + +nyqstk/src/ADSR.o: nyqstk/src/ADSR.cpp nyqstk/include/ADSR.h + g++ -c nyqstk/src/ADSR.cpp -o nyqstk/src/ADSR.o $(CFLAGS) + +nyqstk/src/OnePole.o: nyqstk/src/OnePole.cpp nyqstk/include/OnePole.h + g++ -c nyqstk/src/OnePole.cpp -o nyqstk/src/OnePole.o $(CFLAGS) + +nyqstk/src/BiQuad.o: nyqstk/src/BiQuad.cpp nyqstk/include/BiQuad.h + g++ -c nyqstk/src/BiQuad.cpp -o nyqstk/src/BiQuad.o $(CFLAGS) + +nyqstk/src/BandedWG.o: nyqstk/src/BandedWG.cpp nyqstk/include/BandedWG.h + g++ -c nyqstk/src/BandedWG.cpp -o nyqstk/src/BandedWG.o $(CFLAGS) + +nyqstk/src/DelayA.o: nyqstk/src/DelayA.cpp nyqstk/include/DelayA.h + g++ -c nyqstk/src/DelayA.cpp -o nyqstk/src/DelayA.o $(CFLAGS) + +nyqstk/src/Mandolin.o: nyqstk/src/Mandolin.cpp nyqstk/include/Mandolin.h + g++ -c nyqstk/src/Mandolin.cpp -o nyqstk/src/Mandolin.o $(CFLAGS) + +nyqstk/src/PluckTwo.o: nyqstk/src/PluckTwo.cpp nyqstk/include/PluckTwo.h + g++ -c nyqstk/src/PluckTwo.cpp -o nyqstk/src/PluckTwo.o $(CFLAGS) + +nyqstk/src/Sitar.o: nyqstk/src/Sitar.cpp nyqstk/include/Sitar.h + g++ -c nyqstk/src/Sitar.cpp -o nyqstk/src/Sitar.o $(CFLAGS) + +nyqstk/src/ModalBar.o: nyqstk/src/ModalBar.cpp nyqstk/include/ModalBar.h + g++ -c nyqstk/src/ModalBar.cpp -o nyqstk/src/ModalBar.o $(CFLAGS) + +nyqstk/src/Modal.o: nyqstk/src/Modal.cpp nyqstk/include/Modal.h + g++ -c nyqstk/src/Modal.cpp -o nyqstk/src/Modal.o $(CFLAGS) + +nyqstk/src/Flute.o: nyqstk/src/Flute.cpp nyqstk/include/Flute.h + g++ -c nyqstk/src/Flute.cpp -o nyqstk/src/Flute.o $(CFLAGS) + +nyqstk/src/JetTable.o: nyqstk/src/JetTable.cpp nyqstk/include/JetTable.h + g++ -c nyqstk/src/JetTable.cpp -o nyqstk/src/JetTable.o $(CFLAGS) + +nyqstk/src/PoleZero.o: nyqstk/src/PoleZero.cpp nyqstk/include/PoleZero.h + g++ -c nyqstk/src/PoleZero.cpp -o nyqstk/src/PoleZero.o $(CFLAGS) + +xlisp/xlftab.o: nyqsrc/sndfnintptrs.h nyqsrc/sndfnintdefs.h nyqsrc/seqfnintptrs.h nyqsrc/seqfnintdefs.h + $(CC) -c xlisp/xlftab.c -o xlisp/xlftab.o $(CFLAGS) + +xlisp/extern.o: xlisp/extern.c + $(CC) -c xlisp/extern.c -o xlisp/extern.o $(CFLAGS) + +xlisp/xldmem.o: xlisp/xldmem.c + $(CC) -c xlisp/xldmem.c -o xlisp/xldmem.o $(CFLAGS) + +xlisp/xlbfun.o: xlisp/xlbfun.c + $(CC) -c xlisp/xlbfun.c -o xlisp/xlbfun.o $(CFLAGS) + +xlisp/xlcont.o: xlisp/xlcont.c + $(CC) -c xlisp/xlcont.c -o xlisp/xlcont.o $(CFLAGS) + +xlisp/xldbug.o: xlisp/xldbug.c + $(CC) -c xlisp/xldbug.c -o xlisp/xldbug.o $(CFLAGS) + +xlisp/xleval.o: xlisp/xleval.c + $(CC) -c xlisp/xleval.c -o xlisp/xleval.o $(CFLAGS) + +xlisp/xlfio.o: xlisp/xlfio.c + $(CC) -c xlisp/xlfio.c -o xlisp/xlfio.o $(CFLAGS) + +xlisp/xlglob.o: xlisp/xlglob.c + $(CC) -c xlisp/xlglob.c -o xlisp/xlglob.o $(CFLAGS) + +xlisp/xlimage.o: xlisp/xlimage.c + $(CC) -c xlisp/xlimage.c -o xlisp/xlimage.o $(CFLAGS) + +xlisp/xlinit.o: xlisp/xlinit.c + $(CC) -c xlisp/xlinit.c -o xlisp/xlinit.o $(CFLAGS) + +xlisp/xlio.o: xlisp/xlio.c + $(CC) -c xlisp/xlio.c -o xlisp/xlio.o $(CFLAGS) + +xlisp/xlisp.o: xlisp/xlisp.c + $(CC) -c xlisp/xlisp.c -o xlisp/xlisp.o $(CFLAGS) + +xlisp/xljump.o: xlisp/xljump.c + $(CC) -c xlisp/xljump.c -o xlisp/xljump.o $(CFLAGS) + +xlisp/xllist.o: xlisp/xllist.c + $(CC) -c xlisp/xllist.c -o xlisp/xllist.o $(CFLAGS) + +xlisp/xlmath.o: xlisp/xlmath.c + $(CC) -c xlisp/xlmath.c -o xlisp/xlmath.o $(CFLAGS) + +xlisp/xlobj.o: xlisp/xlobj.c + $(CC) -c xlisp/xlobj.c -o xlisp/xlobj.o $(CFLAGS) + +xlisp/xlpp.o: xlisp/xlpp.c + $(CC) -c xlisp/xlpp.c -o xlisp/xlpp.o $(CFLAGS) + +xlisp/xlprin.o: xlisp/xlprin.c + $(CC) -c xlisp/xlprin.c -o xlisp/xlprin.o $(CFLAGS) + +xlisp/xlread.o: xlisp/xlread.c + $(CC) -c xlisp/xlread.c -o xlisp/xlread.o $(CFLAGS) + +xlisp/xlstr.o: xlisp/xlstr.c + $(CC) -c xlisp/xlstr.c -o xlisp/xlstr.o $(CFLAGS) + +xlisp/xlsubr.o: xlisp/xlsubr.c + $(CC) -c xlisp/xlsubr.c -o xlisp/xlsubr.o $(CFLAGS) + +xlisp/xlsym.o: xlisp/xlsym.c + $(CC) -c xlisp/xlsym.c -o xlisp/xlsym.o $(CFLAGS) + +xlisp/xlsys.o: xlisp/xlsys.c + $(CC) -c xlisp/xlsys.c -o xlisp/xlsys.o $(CFLAGS) + +xlisp/path.o: xlisp/path.c + $(CC) -c xlisp/path.c -o xlisp/path.o $(CFLAGS) + +cmt/cext.o: cmt/cext.c + $(CC) -c cmt/cext.c -o cmt/cext.o $(CFLAGS) + +cmt/cleanup.o: cmt/cleanup.c + $(CC) -c cmt/cleanup.c -o cmt/cleanup.o $(CFLAGS) + +cmt/cmdline.o: cmt/cmdline.c + $(CC) -c cmt/cmdline.c -o cmt/cmdline.o $(CFLAGS) + +cmt/cmtcmd.o: cmt/cmtcmd.c + $(CC) -c cmt/cmtcmd.c -o cmt/cmtcmd.o $(CFLAGS) + +cmt/moxc.o: cmt/moxc.c + $(CC) -c cmt/moxc.c -o cmt/moxc.o $(CFLAGS) + +cmt/mem.o: cmt/mem.c + $(CC) -c cmt/mem.c -o cmt/mem.o $(CFLAGS) + +cmt/midifile.o: cmt/midifile.c + $(CC) -c cmt/midifile.c -o cmt/midifile.o $(CFLAGS) + +cmt/midifns.o: cmt/midifns.c + $(CC) -c cmt/midifns.c -o cmt/midifns.o $(CFLAGS) + +cmt/record.o: cmt/record.c + $(CC) -c cmt/record.c -o cmt/record.o $(CFLAGS) + +cmt/seq.o: cmt/seq.c + $(CC) -c cmt/seq.c -o cmt/seq.o $(CFLAGS) + +cmt/seqmread.o: cmt/seqmread.c + $(CC) -c cmt/seqmread.c -o cmt/seqmread.o $(CFLAGS) + +cmt/seqmwrite.o: cmt/seqmwrite.c + $(CC) -c cmt/seqmwrite.c -o cmt/seqmwrite.o $(CFLAGS) + +cmt/seqread.o: cmt/seqread.c + $(CC) -c cmt/seqread.c -o cmt/seqread.o $(CFLAGS) + +cmt/seqwrite.o: cmt/seqwrite.c + $(CC) -c cmt/seqwrite.c -o cmt/seqwrite.o $(CFLAGS) + +cmt/tempomap.o: cmt/tempomap.c + $(CC) -c cmt/tempomap.c -o cmt/tempomap.o $(CFLAGS) + +cmt/timebase.o: cmt/timebase.c + $(CC) -c cmt/timebase.c -o cmt/timebase.o $(CFLAGS) + +cmt/userio.o: cmt/userio.c + $(CC) -c cmt/userio.c -o cmt/userio.o $(CFLAGS) + +nylsf/aiff.o: nylsf/aiff.c + $(CC) -c nylsf/aiff.c -o nylsf/aiff.o $(CFLAGS) + +nylsf/alaw.o: nylsf/alaw.c + $(CC) -c nylsf/alaw.c -o nylsf/alaw.o $(CFLAGS) + +nylsf/au.o: nylsf/au.c + $(CC) -c nylsf/au.c -o nylsf/au.o $(CFLAGS) + +nylsf/avr.o: nylsf/avr.c + $(CC) -c nylsf/avr.c -o nylsf/avr.o $(CFLAGS) + +nylsf/broadcast.o: nylsf/broadcast.c + $(CC) -c nylsf/broadcast.c -o nylsf/broadcast.o $(CFLAGS) + +nylsf/caf.o: nylsf/caf.c + $(CC) -c nylsf/caf.c -o nylsf/caf.o $(CFLAGS) + +nylsf/command.o: nylsf/command.c + $(CC) -c nylsf/command.c -o nylsf/command.o $(CFLAGS) + +nylsf/common.o: nylsf/common.c + $(CC) -c nylsf/common.c -o nylsf/common.o $(CFLAGS) + +nylsf/dither.o: nylsf/dither.c + $(CC) -c nylsf/dither.c -o nylsf/dither.o $(CFLAGS) + +nylsf/double64.o: nylsf/double64.c + $(CC) -c nylsf/double64.c -o nylsf/double64.o $(CFLAGS) + +nylsf/dwd.o: nylsf/dwd.c + $(CC) -c nylsf/dwd.c -o nylsf/dwd.o $(CFLAGS) + +nylsf/dwvw.o: nylsf/dwvw.c + $(CC) -c nylsf/dwvw.c -o nylsf/dwvw.o $(CFLAGS) + +nylsf/file_io.o: nylsf/file_io.c + $(CC) -c nylsf/file_io.c -o nylsf/file_io.o $(CFLAGS) + +nylsf/flac.o: nylsf/flac.c + $(CC) -c nylsf/flac.c -o nylsf/flac.o $(CFLAGS) + +nylsf/float32.o: nylsf/float32.c + $(CC) -c nylsf/float32.c -o nylsf/float32.o $(CFLAGS) + +nylsf/gsm610.o: nylsf/gsm610.c + $(CC) -c nylsf/gsm610.c -o nylsf/gsm610.o $(CFLAGS) + +nylsf/htk.o: nylsf/htk.c + $(CC) -c nylsf/htk.c -o nylsf/htk.o $(CFLAGS) + +nylsf/ima_adpcm.o: nylsf/ima_adpcm.c + $(CC) -c nylsf/ima_adpcm.c -o nylsf/ima_adpcm.o $(CFLAGS) + +nylsf/interleave.o: nylsf/interleave.c + $(CC) -c nylsf/interleave.c -o nylsf/interleave.o $(CFLAGS) + +nylsf/ircam.o: nylsf/ircam.c + $(CC) -c nylsf/ircam.c -o nylsf/ircam.o $(CFLAGS) + +nylsf/macbinary3.o: nylsf/macbinary3.c + $(CC) -c nylsf/macbinary3.c -o nylsf/macbinary3.o $(CFLAGS) + +nylsf/macos.o: nylsf/macos.c + $(CC) -c nylsf/macos.c -o nylsf/macos.o $(CFLAGS) + +nylsf/mat4.o: nylsf/mat4.c + $(CC) -c nylsf/mat4.c -o nylsf/mat4.o $(CFLAGS) + +nylsf/mat5.o: nylsf/mat5.c + $(CC) -c nylsf/mat5.c -o nylsf/mat5.o $(CFLAGS) + +nylsf/ms_adpcm.o: nylsf/ms_adpcm.c + $(CC) -c nylsf/ms_adpcm.c -o nylsf/ms_adpcm.o $(CFLAGS) + +nylsf/nist.o: nylsf/nist.c + $(CC) -c nylsf/nist.c -o nylsf/nist.o $(CFLAGS) + +nylsf/ogg.o: nylsf/ogg.c + $(CC) -c nylsf/ogg.c -o nylsf/ogg.o $(CFLAGS) + +nylsf/paf.o: nylsf/paf.c + $(CC) -c nylsf/paf.c -o nylsf/paf.o $(CFLAGS) + +nylsf/pcm.o: nylsf/pcm.c + $(CC) -c nylsf/pcm.c -o nylsf/pcm.o $(CFLAGS) + +nylsf/pvf.o: nylsf/pvf.c + $(CC) -c nylsf/pvf.c -o nylsf/pvf.o $(CFLAGS) + +nylsf/raw.o: nylsf/raw.c + $(CC) -c nylsf/raw.c -o nylsf/raw.o $(CFLAGS) + +nylsf/rx2.o: nylsf/rx2.c + $(CC) -c nylsf/rx2.c -o nylsf/rx2.o $(CFLAGS) + +nylsf/sd2.o: nylsf/sd2.c + $(CC) -c nylsf/sd2.c -o nylsf/sd2.o $(CFLAGS) + +nylsf/sds.o: nylsf/sds.c + $(CC) -c nylsf/sds.c -o nylsf/sds.o $(CFLAGS) + +nylsf/sndfile.o: nylsf/sndfile.c + $(CC) -c nylsf/sndfile.c -o nylsf/sndfile.o $(CFLAGS) + +nylsf/strings.o: nylsf/strings.c + $(CC) -c nylsf/strings.c -o nylsf/strings.o $(CFLAGS) + +nylsf/svx.o: nylsf/svx.c + $(CC) -c nylsf/svx.c -o nylsf/svx.o $(CFLAGS) + +nylsf/txw.o: nylsf/txw.c + $(CC) -c nylsf/txw.c -o nylsf/txw.o $(CFLAGS) + +nylsf/ulaw.o: nylsf/ulaw.c + $(CC) -c nylsf/ulaw.c -o nylsf/ulaw.o $(CFLAGS) + +nylsf/voc.o: nylsf/voc.c + $(CC) -c nylsf/voc.c -o nylsf/voc.o $(CFLAGS) + +nylsf/vox_adpcm.o: nylsf/vox_adpcm.c + $(CC) -c nylsf/vox_adpcm.c -o nylsf/vox_adpcm.o $(CFLAGS) + +nylsf/w64.o: nylsf/w64.c + $(CC) -c nylsf/w64.c -o nylsf/w64.o $(CFLAGS) + +nylsf/wav.o: nylsf/wav.c + $(CC) -c nylsf/wav.c -o nylsf/wav.o $(CFLAGS) + +nylsf/wav_w64.o: nylsf/wav_w64.c + $(CC) -c nylsf/wav_w64.c -o nylsf/wav_w64.o $(CFLAGS) + +nylsf/wve.o: nylsf/wve.c + $(CC) -c nylsf/wve.c -o nylsf/wve.o $(CFLAGS) + +nylsf/xi.o: nylsf/xi.c + $(CC) -c nylsf/xi.c -o nylsf/xi.o $(CFLAGS) + +nylsf/g72x.o: nylsf/g72x.c + $(CC) -c nylsf/g72x.c -o nylsf/g72x.o $(CFLAGS) + +nylsf/GSM610/add.o: nylsf/GSM610/add.c + $(CC) -c nylsf/GSM610/add.c -o nylsf/GSM610/add.o $(CFLAGS) + +nylsf/GSM610/code.o: nylsf/GSM610/code.c + $(CC) -c nylsf/GSM610/code.c -o nylsf/GSM610/code.o $(CFLAGS) + +nylsf/GSM610/decode.o: nylsf/GSM610/decode.c + $(CC) -c nylsf/GSM610/decode.c -o nylsf/GSM610/decode.o $(CFLAGS) + +nylsf/GSM610/gsm_create.o: nylsf/GSM610/gsm_create.c + $(CC) -c nylsf/GSM610/gsm_create.c -o nylsf/GSM610/gsm_create.o $(CFLAGS) + +nylsf/GSM610/gsm_decode.o: nylsf/GSM610/gsm_decode.c + $(CC) -c nylsf/GSM610/gsm_decode.c -o nylsf/GSM610/gsm_decode.o $(CFLAGS) + +nylsf/GSM610/gsm_destroy.o: nylsf/GSM610/gsm_destroy.c + $(CC) -c nylsf/GSM610/gsm_destroy.c -o nylsf/GSM610/gsm_destroy.o $(CFLAGS) + +nylsf/GSM610/gsm_encode.o: nylsf/GSM610/gsm_encode.c + $(CC) -c nylsf/GSM610/gsm_encode.c -o nylsf/GSM610/gsm_encode.o $(CFLAGS) + +nylsf/GSM610/gsm_option.o: nylsf/GSM610/gsm_option.c + $(CC) -c nylsf/GSM610/gsm_option.c -o nylsf/GSM610/gsm_option.o $(CFLAGS) + +nylsf/GSM610/long_term.o: nylsf/GSM610/long_term.c + $(CC) -c nylsf/GSM610/long_term.c -o nylsf/GSM610/long_term.o $(CFLAGS) + +nylsf/GSM610/lpc.o: nylsf/GSM610/lpc.c + $(CC) -c nylsf/GSM610/lpc.c -o nylsf/GSM610/lpc.o $(CFLAGS) + +nylsf/GSM610/preprocess.o: nylsf/GSM610/preprocess.c + $(CC) -c nylsf/GSM610/preprocess.c -o nylsf/GSM610/preprocess.o $(CFLAGS) + +nylsf/GSM610/rpe.o: nylsf/GSM610/rpe.c + $(CC) -c nylsf/GSM610/rpe.c -o nylsf/GSM610/rpe.o $(CFLAGS) + +nylsf/GSM610/short_term.o: nylsf/GSM610/short_term.c + $(CC) -c nylsf/GSM610/short_term.c -o nylsf/GSM610/short_term.o $(CFLAGS) + +nylsf/GSM610/table.o: nylsf/GSM610/table.c + $(CC) -c nylsf/GSM610/table.c -o nylsf/GSM610/table.o $(CFLAGS) + +nylsf/G72x/g721.o: nylsf/G72x/g721.c + $(CC) -c nylsf/G72x/g721.c -o nylsf/G72x/g721.o $(CFLAGS) + +nylsf/G72x/g723_16.o: nylsf/G72x/g723_16.c + $(CC) -c nylsf/G72x/g723_16.c -o nylsf/G72x/g723_16.o $(CFLAGS) + +nylsf/G72x/g723_24.o: nylsf/G72x/g723_24.c + $(CC) -c nylsf/G72x/g723_24.c -o nylsf/G72x/g723_24.o $(CFLAGS) + +nylsf/G72x/g723_40.o: nylsf/G72x/g723_40.c + $(CC) -c nylsf/G72x/g723_40.c -o nylsf/G72x/g723_40.o $(CFLAGS) + +nylsf/G72x/g72x.o: nylsf/G72x/g72x.c + $(CC) -c nylsf/G72x/g72x.c -o nylsf/G72x/g72x.o $(CFLAGS) + +sys/unix/osstuff.o: sys/unix/osstuff.c + $(CC) -c sys/unix/osstuff.c -o sys/unix/osstuff.o $(CFLAGS) + +misc/intgen: misc/intgen.c + cd misc; make intgen + +misc/unpacker: misc/unpacker.c misc/convert.c + cd misc; make unpacker + +misc/packer: misc/packer.c misc/convert.c + cd misc; make packer + +nyqsrc/sndfnintptrs.h: $(NYQHDRS) misc/intgen + $(INTGEN) nyqsrc/sndfnint $(NYQHDRS) + +nyqsrc/seqfnintptrs.h: $(CMTHDRS) misc/intgen + $(INTGEN) nyqsrc/seqfnint $(CMTHDRS) + +clean: + cd misc; make clean + cd liblo; test -f Makefile && make clean || true + cd portaudio; test -f Makefile && make clean || true + rm -f $(OBJECTS) +# These could be deleted, but they're part of the release, so we won't +# Note that these files are machine-generated: +# rm -f nyqsrc/sndfnintptrs.h nyqsrc/sndfnint.c nyqsrc/sndfnintdefs.h +# rm -f nyqsrc/seqfnintptrs.h nyqsrc/seqfnint.c nyqsrc/seqfnintdefs.h + +cleaner: clean + cd misc; make cleaner + rm -f *.backup */*.backup + rm -f *~ */*.*~ + rm -f #*# */#*# + rm -f *.save */*.save + rm -f *.CKP */*.CKP + rm -f *.BAK */*.BAK + rm -f *.old */*.old + rm -f *.gold */*.gold + rm -f playparms + rm -f points.dat + rm -f core.* core + rm -f $(NY) + +release: cleaner + cd misc; make packer + misc/packer files.txt release.pac + rm -f *.wav + mv ny .. + mv -f *.pac .. + rm -f unpacker + rm -f packer + cd ..; zip -r nyquist.zip nyquist + ../ny misc/cmu/cmu-linux-install.lsp + mv ../ny ./ny diff --git a/sys/unix/alsa/system.lsp b/sys/unix/alsa/system.lsp new file mode 100644 index 0000000..3923bc8 --- /dev/null +++ b/sys/unix/alsa/system.lsp @@ -0,0 +1,101 @@ +;; system.lsp -- system-dependent lisp code + +; local definition for play +; this one is for Linux: + +(if (not (boundp '*default-sf-format*)) + (setf *default-sf-format* snd-head-wave)) + +(if (not (boundp '*default-sound-file*)) + (compute-default-sound-file)) + +(if (not (boundp '*default-sf-dir*)) + (setf *default-sf-dir* "./")) + +(if (not (boundp '*default-sf-mode*)) + (setf *default-sf-mode* snd-mode-pcm)) + +(if (not (boundp '*default-sf-bits*)) + (setf *default-sf-bits* 16)) + +(if (not (boundp '*default-plot-file*)) + (setf *default-plot-file* (strcat (get-user) "-points.dat"))) + + +; FULL-NAME-P -- test if file name is a full path or relative path +; +; (otherwise the *default-sf-dir* will be prepended +; +(defun full-name-p (filename) + (or (eq (char filename 0) #\/) + (eq (char filename 0) #\.))) + +; RELATIVE-PATH-P -- test if filename or path is a relative path +; +(defun relative-path-p (filename) + (not (eq (char filename 0) #\/))) + +(setf *file-separator* #\/) + + +;; PLAY-FILE - play a sound file +;; +(defun play-file (name) +;; +;; WARNING: if you invoke an external program to play files, +;; but Nyquist uses internal (portaudio) interface to +;; play synthesized sound, Nyquist may fail to open the +;; sound device while it is playing a sound file and then +;; refuse to play anything. -RBD dec05 +;; (system (strcat "sndplay " (soundfilename name)))) +;; (system (strcat "play " (soundfilename name) ))) +;; + (play (s-read (soundfilename name)))) + +;; R - replay last file written with PLAY +(defun r () (play-file *default-sound-file*)) + +;;;; use this old version if you want to use sndplay to play +;;;; the result file rather than play the samples as they +;;;; are computed. This version does not autonormalize. +;; PLAY - write value of an expression to file and play it +;; +;(defmacro play (expr) +; `(prog (specs) +; (setf specs (s-save (force-srate *sound-srate* ,expr) +; 1000000000 *default-sound-file*)) +; (r))) +;;;; + +; local definition for play +(defmacro play (expr) + `(s-save-autonorm ,expr NY:ALL *default-sound-file* :play *soundenable*)) + +;; for Linux, modify s-plot (defined in nyquist.lsp) by saving s-plot +;; in standard-s-plot, then call gnuplot to display the points. +;; +;; we also need to save the location of this file so we can find +;; nyquist-plot.txt, the command file for gnuplot +;; +;; This code is broken in the following ways: +;; it tries to run gnuplot even when plotting can be done by NyquistIDE +;; it plots "points.dat", but "points.dat" may not be correct +;; (see *default-plot-file*) +;; it assumes the plot file is in the current directory, but it +;; by default goes to the sound file directory +;; +;; Fix this code or complain if you want to plot with gnuplot while +;; running ny (or even NyquistIDE (jny) if you want). Otherwise, use +;; NyquistIDE to get s-plot to work. +;; +;(setf *runtime-path* (current-path)) +;(display "system.lsp" *runtime-path*) +; +;(setfn standard-s-plot s-plot) +; +;(defun s-plot (s &optional (dur 2.0) (n 1000)) +; (let (plot-file) +; (standard-s-plot s dur n) ;; this calculates the data points +; (setf plot-file (strcat *runtime-path* "nyquist-plot.txt")) +; (system (strcat "gnuplot -persist " plot-file)))) + diff --git a/sys/unix/cmu/backup.script b/sys/unix/cmu/backup.script new file mode 100644 index 0000000..f00c59a --- /dev/null +++ b/sys/unix/cmu/backup.script @@ -0,0 +1 @@ +cp -Rp ../current/* /afs/cs/project/music/proj/nyquist/current diff --git a/sys/unix/cmu/tar.script b/sys/unix/cmu/tar.script new file mode 100644 index 0000000..12b23f6 --- /dev/null +++ b/sys/unix/cmu/tar.script @@ -0,0 +1,14 @@ +mkdir ../TMP +mv ny ../TMP +mv runtime/system.lsp ../TMP +mv Makefile ../TMP +mv test ../TMP +set NYQDIR=`pwd` +cd .. +ln -fs $NYQDIR nyquist +tar -cvhf - nyquist | compress > nyquist.tar.Z +cd $NYQDIR +mv ../TMP/test . +mv ../TMP/Makefile . +mv ../TMP/system.lsp runtime +mv ../TMP/ny . diff --git a/sys/unix/cmu/update.lsp b/sys/unix/cmu/update.lsp new file mode 100644 index 0000000..71743a2 --- /dev/null +++ b/sys/unix/cmu/update.lsp @@ -0,0 +1,79 @@ +;; update.lsp -- script to push changes into source directories + +(load "makefile.lsp") ; just to make sure we got the latest bindings + + +;; UPDATE-SOURCES -- makes a script to push changes into source directories +;; +(defun update-sources () + (let (outf) + (load "transfiles.lsp") ; just to make sure we're current + (setf outf (open "script" :direction :output)) + (format outf "# +# source this script file + +# Source Paths: nyqsrc, cmtsrc, xlsrc, trnsrc +") + (format outf " +# +# XLISP SOURCES +# +") + (file-update outf xlfiles ".c" "xlsrc") + (file-update outf xlfiles-h ".h" "xlsrc") + (file-update outf xlfiles-lsp ".lsp" "xlsrc") + + (format outf " +# +# NYQUIST SOURCES +# +") + (file-update outf nyqfiles ".c" "nyqsrc") + (file-update outf (exceptions-filter nyqfiles) ".h" "nyqsrc") + (file-update outf nyqfiles-h ".h" "nyqsrc") + (file-update outf nyqfiles-lsp ".lsp" "nyqsrc") + (file-update outf makefiles "" "nyqsrc") + + (format outf " +# +# CMT SOURCES +# +") + (file-update outf cmtfiles ".c" "cmtsrc") + (file-update outf (exceptions-filter cmtfiles) ".h" "cmtsrc") + (file-update outf cmtfiles-h ".h" "cmtsrc") + +; don't write back machine generated trnsrc files +; (file-update outf transfiles ".c" "trnsrc") +; (file-update outf transfiles ".h" "trnsrc") + + (close outf) + + (format t "DONE writing script, 'source script' to copy files from~%") + (format t "this directory to the source directories~%") + +)) + + +;; EXCEPTIONS-FILTER - remove .h files from list +; the depends-exceptions tells whether a .h file exists for a .c file +;; +(defun exceptions-filter (files) + (let (result) + (dolist (f files) + (let ((ex (assoc f depends-exceptions :test #'equal))) + (cond (ex + (if (and (cdr ex) + (string-search (strcat f ".h") (cadr ex))) + (push f result))) + (t (push f result))))) + result)) + + +;; FILE-UPDATE -- write dependency for source files +;; +(defun file-update (outf files ext dir) + (dolist (f files) + (let ((fname (strcat f ext))) + (format outf "cp -p ~A ~A/~A~%" fname dir fname)))) + diff --git a/sys/unix/io.c b/sys/unix/io.c new file mode 100644 index 0000000..21b2abe --- /dev/null +++ b/sys/unix/io.c @@ -0,0 +1,162 @@ +/* + ********************************************************************** + * File io.c + ********************************************************************** + * + * Non blocking input routine + * Works by puttng the terminal in CBREAK mode and using the FIONREAD + * ioctl call to determine the number of characters in the input queue + */ + +#include "stdio.h" +#include "io.h" +#include <sys/types.h> +#include <sys/time.h> +#include <signal.h> +#include <sgtty.h> +#include "cext.h" + +int IOinputfd; /* input file descriptor (usually 0) */ + +int IOnochar; /* Value to be returned by IOgetchar() + where there is no input to be had */ + +static struct sgttyb IOoldmodes, IOcurrentmodes; + /* Initial and current tty modes */ + +/* + * IOsetup(inputfd) + * Args: + * inputfd - input file descriptor (should be zero for standard input) + * Returns: + * 0 - if all goes well + * -1 - if an ioctl fails (also calls perror) + * Side Effects: + * Puts the terminal in CBREAK mode - before process termination + * IOcleanup() should be called to restore old terminal modes + * Catch's interrupts (if they are not already being caught) and + * calls IOcleanup before exiting + * + */ + +#define ERROR(s) return (perror(s), -1) + +IOsetup(inputfd) +{ + static IOdiegracefully(); + int (*interrupt_handler)(); + + IOinputfd = inputfd; + IOnochar = NOCHAR; + + if(ioctl(IOinputfd, TIOCGETP, &IOoldmodes) < 0) + ERROR("IOsetup"); + + IOcurrentmodes = IOoldmodes; + IOcurrentmodes.sg_flags |= CBREAK; + IOcurrentmodes.sg_flags &= ~ECHO; + if(ioctl(IOinputfd, TIOCSETP, &IOcurrentmodes)) + ERROR("IOsetup-2"); + + if( (interrupt_handler = signal(SIGINT, IOdiegracefully)) != 0) + signal(SIGINT, interrupt_handler); + + return 0; +} + +static +IOdiegracefully() +{ + write(2, "\nBye\n", 5); + IOcleanup(); + EXIT(2); +} + +/* + * IOcleanup() + * Returns: + * 0 - if all goes well + * -1 - if an ioctl fails (also calls perror) + * Side Effects: + * Restores initial terminal modes + */ + +IOcleanup() +{ + if(ioctl(IOinputfd, TIOCSETP, &IOoldmodes) < 0) + ERROR("IOclean"); + + return 0; +} + + +/* + * IOgetchar() + * Returns: + * A character off the input queue if there is one, + * IOnochar if there is no character waiting to be read, + * -1 if an ioctl fails (shouldn't happen if IOsetup went OK) + */ + +#ifndef UNIX_MACH + +IOgetchar() +{ + int n; + char c; + + if(ioctl(IOinputfd, FIONREAD, &n) < 0) + ERROR("IOgetchar"); + if(n <= 0) + return IOnochar; + switch(read(IOinputfd, &c, 1)) { + case 1: + return c; + case 0: + return EOF; + default: + ERROR("IOgetchar-read"); + } +} + +IOgetchar2() +{ + int nfds, readfds = 1 << IOinputfd; + char c; + static struct timeval zero; + + if(IOinputfd < 0 || IOinputfd >= 32) { + printf("IOgetchar2: bad IOinputfd (%d)%s\n", IOinputfd, + IOinputfd == -1 ? "Did you call IOsetup(fd)?" : ""); + } + nfds = select(32, &readfds, 0, 0, &zero); + if(nfds > 0) { + switch(read(IOinputfd, &c, 1)) { + case 0: + return EOF; + case 1: + return c; + default: + printf("IOgetchar2: read failed!\n"); + return NOCHAR; + } + } + else if(nfds < 0) + printf("IOgetchar2: select failed!\n"); + return NOCHAR; +} + +/* + * IOwaitchar() + * Returns: + * A character off the input queue. Waits if necessary. + */ + +int IOwaitchar() +{ + char c; + if (read(IOinputfd, &c, 1) == 1) return c; + else return EOF; +} + +#endif /* UNIX_MACH */ diff --git a/sys/unix/io.h b/sys/unix/io.h new file mode 100644 index 0000000..3e50ad9 --- /dev/null +++ b/sys/unix/io.h @@ -0,0 +1,9 @@ +#define NOCHAR -2 + +int IOinputfd; +int IOnochar; + +int IOsetup(int inputfd); +int IOcleanup(void); +int IOgetchar(void); +int IOwaitchar(void); diff --git a/sys/unix/next/Makefile b/sys/unix/next/Makefile new file mode 100644 index 0000000..10817d1 --- /dev/null +++ b/sys/unix/next/Makefile @@ -0,0 +1,521 @@ +# +# Makefile for Nyquist, SYSTEM-TYPE is NEXT +# run make in the top-level Nyquist directory to compile Nyquist +# +# NOTE: this file is machine-generated. DO NOT EDIT! +# Instead, modify makefile.lsp and regenerate the makefile. +# Ports and bug fixes are welcome - please mail them to +# dannenberg@cs.cmu.edu. Thanks. +# + +# This is the resulting executable (normally "ny"): +NY = ny + +# Standard list of includes (common to all unix versions) +INCL = -Inyqsrc -Itran -Ixlisp -Isys/unix -Icmt -Isnd -Ifft + +# system dependent stuff for next: + +CC = cc +CFLAGS = -DCMTSTUFF -O $(INCL) +LN = cc +LFLAGS = -lm + + +INTGEN = misc/intgen + +# Object files for Nyquist: +OBJECTS = xlisp/extern.o xlisp/xldmem.o xlisp/xlbfun.o xlisp/xlcont.o \ + xlisp/xldbug.o xlisp/xleval.o xlisp/xlfio.o xlisp/xlftab.o \ + xlisp/xlglob.o xlisp/xlimage.o xlisp/xlinit.o xlisp/xlio.o \ + xlisp/xlisp.o xlisp/xljump.o xlisp/xllist.o xlisp/xlmath.o \ + xlisp/xlobj.o xlisp/xlpp.o xlisp/xlprin.o xlisp/xlread.o \ + xlisp/xlstr.o xlisp/xlsubr.o xlisp/xlsym.o xlisp/xlsys.o \ + tran/amosc.o tran/clip.o tran/const.o tran/fmosc.o \ + tran/integrate.o tran/log.o tran/maxv.o tran/osc.o \ + tran/prod.o tran/buzz.o tran/pwl.o tran/recip.o \ + tran/upsample.o tran/scale.o tran/sine.o tran/partial.o \ + tran/white.o tran/tone.o tran/tonev.o tran/atonev.o \ + tran/atone.o tran/reson.o tran/areson.o tran/resonvc.o \ + tran/resoncv.o tran/aresonvc.o tran/aresoncv.o tran/resonvv.o \ + tran/aresonvv.o tran/offset.o tran/slope.o tran/delay.o \ + tran/delaycv.o tran/shape.o tran/sampler.o tran/exp.o \ + tran/siosc.o tran/follow.o tran/gate.o tran/quantize.o \ + tran/ifft.o tran/congen.o tran/fromobject.o tran/fromarraystream.o \ + tran/coterm.o tran/convolve.o tran/alpass.o tran/oneshot.o \ + tran/chase.o tran/tapv.o tran/biquad.o tran/pluck.o \ + cmt/cext.o cmt/cleanup.o cmt/cmdline.o cmt/cmtcmd.o \ + cmt/moxc.o cmt/mem.o cmt/midifile.o cmt/midifns.o \ + cmt/record.o cmt/seq.o cmt/seqmread.o cmt/seqmwrite.o \ + cmt/seqread.o cmt/seqwrite.o cmt/tempomap.o cmt/timebase.o \ + cmt/userio.o nyqsrc/debug.o nyqsrc/falloc.o nyqsrc/add.o \ + nyqsrc/local.o nyqsrc/downsample.o nyqsrc/handlers.o nyqsrc/multiread.o \ + nyqsrc/multiseq.o nyqsrc/samples.o nyqsrc/seqext.o nyqsrc/seqinterf.o \ + nyqsrc/sndread.o nyqsrc/sndseq.o nyqsrc/sndwrite.o nyqsrc/sndmax.o \ + nyqsrc/sound.o nyqsrc/stats.o nyqsrc/compose.o nyqsrc/inverse.o \ + nyqsrc/resamp.o nyqsrc/resampv.o nyqsrc/ffilterkit.o nyqsrc/avg.o \ + nyqsrc/fft.o nyqsrc/sndfail.o fft/fftn.o nyqsrc/sndfnint.o \ + nyqsrc/seqfnint.o snd/audionext.o snd/sndnext.o snd/ieeecvt.o \ + snd/snd.o snd/sndcvt.o snd/sndio.o snd/sndheader.o \ + sys/unix/osstuff.o sys/unix/term.o + +# Sound functions to add to xlisp +NYQHDRS = snd/snd.h nyqsrc/sound.h nyqsrc/downsample.h nyqsrc/sndread.h \ + nyqsrc/sndseq.h nyqsrc/add.h nyqsrc/multiseq.h nyqsrc/samples.h \ + nyqsrc/sndwrite.h nyqsrc/sndmax.h nyqsrc/compose.h nyqsrc/inverse.h \ + nyqsrc/resamp.h nyqsrc/resampv.h nyqsrc/fft.h nyqsrc/avg.h \ + tran/amosc.h tran/clip.h tran/const.h tran/fmosc.h \ + tran/integrate.h tran/log.h tran/maxv.h tran/osc.h \ + tran/prod.h tran/buzz.h tran/pwl.h tran/recip.h \ + tran/upsample.h tran/scale.h tran/sine.h tran/partial.h \ + tran/white.h tran/tone.h tran/tonev.h tran/atonev.h \ + tran/atone.h tran/reson.h tran/areson.h tran/resonvc.h \ + tran/resoncv.h tran/aresonvc.h tran/aresoncv.h tran/resonvv.h \ + tran/aresonvv.h tran/offset.h tran/slope.h tran/delaycc.h \ + tran/delaycv.h tran/shape.h tran/sampler.h tran/exp.h \ + tran/siosc.h tran/follow.h tran/gate.h tran/quantize.h \ + tran/ifft.h tran/congen.h tran/fromobject.h tran/fromarraystream.h \ + tran/coterm.h tran/convolve.h tran/alpass.h tran/oneshot.h \ + tran/chase.h tran/tapv.h tran/biquad.h tran/pluck.h + +CMTHDRS = cmt/seqdecls.h nyqsrc/seqext.h cmt/seq.h nyqsrc/seqinterf.h \ + cmt/seqread.h cmt/seqmread.h cmt/seqwrite.h cmt/seqmwrite.h + + +EVERYTHING = $(NY) runtime/system.lsp + +CURRENT = $(EVERYTHING) + +current: $(CURRENT) + +$(NY): $(OBJECTS) + $(LN) $(OBJECTS) $(LFLAGS) -o $(NY) + +# copy appropriate system.lsp and make it read-only; +# changes should be made to sys/unix/<system>/system.lsp +runtime/system.lsp: sys/unix/next/system.lsp + chmod +w runtime/system.lsp + cp -p sys/unix/next/system.lsp runtime/system.lsp + chmod -w runtime/system.lsp + +nyqsrc/debug.o: nyqsrc/debug.c nyqsrc/debug.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/debug.c -o nyqsrc/debug.o $(CFLAGS) + +nyqsrc/falloc.o: nyqsrc/falloc.c nyqsrc/falloc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/falloc.c -o nyqsrc/falloc.o $(CFLAGS) + +nyqsrc/add.o: nyqsrc/add.c nyqsrc/add.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/add.c -o nyqsrc/add.o $(CFLAGS) + +nyqsrc/local.o: nyqsrc/local.c xlisp/xlisp.h nyqsrc/sound.h + cc -c nyqsrc/local.c -o nyqsrc/local.o $(CFLAGS) + +nyqsrc/downsample.o: nyqsrc/downsample.c nyqsrc/downsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/downsample.c -o nyqsrc/downsample.o $(CFLAGS) + +nyqsrc/handlers.o: nyqsrc/handlers.c + cc -c nyqsrc/handlers.c -o nyqsrc/handlers.o $(CFLAGS) + +nyqsrc/multiread.o: nyqsrc/multiread.c nyqsrc/multiread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/multiread.c -o nyqsrc/multiread.o $(CFLAGS) + +nyqsrc/multiseq.o: nyqsrc/multiseq.c nyqsrc/multiseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/multiseq.c -o nyqsrc/multiseq.o $(CFLAGS) + +nyqsrc/samples.o: nyqsrc/samples.c nyqsrc/samples.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/samples.c -o nyqsrc/samples.o $(CFLAGS) + +nyqsrc/seqext.o: nyqsrc/seqext.c nyqsrc/seqext.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/seqext.c -o nyqsrc/seqext.o $(CFLAGS) + +nyqsrc/seqinterf.o: nyqsrc/seqinterf.c nyqsrc/seqinterf.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/seqinterf.c -o nyqsrc/seqinterf.o $(CFLAGS) + +nyqsrc/sndread.o: nyqsrc/sndread.c nyqsrc/sndread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sndread.c -o nyqsrc/sndread.o $(CFLAGS) + +nyqsrc/sndseq.o: nyqsrc/sndseq.c nyqsrc/sndseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sndseq.c -o nyqsrc/sndseq.o $(CFLAGS) + +nyqsrc/sndwrite.o: nyqsrc/sndwrite.c nyqsrc/sndwrite.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sndwrite.c -o nyqsrc/sndwrite.o $(CFLAGS) + +nyqsrc/sndmax.o: nyqsrc/sndmax.c nyqsrc/sndmax.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sndmax.c -o nyqsrc/sndmax.o $(CFLAGS) + +nyqsrc/sound.o: nyqsrc/sound.c nyqsrc/sound.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sound.c -o nyqsrc/sound.o $(CFLAGS) + +nyqsrc/stats.o: nyqsrc/stats.c nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/stats.c -o nyqsrc/stats.o $(CFLAGS) + +nyqsrc/compose.o: nyqsrc/compose.c nyqsrc/compose.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/compose.c -o nyqsrc/compose.o $(CFLAGS) + +nyqsrc/inverse.o: nyqsrc/inverse.c nyqsrc/inverse.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/inverse.c -o nyqsrc/inverse.o $(CFLAGS) + +nyqsrc/resamp.o: nyqsrc/resamp.c nyqsrc/resamp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/resamp.c -o nyqsrc/resamp.o $(CFLAGS) + +nyqsrc/resampv.o: nyqsrc/resampv.c nyqsrc/resampv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/resampv.c -o nyqsrc/resampv.o $(CFLAGS) + +nyqsrc/ffilterkit.o: nyqsrc/ffilterkit.c nyqsrc/ffilterkit.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/ffilterkit.c -o nyqsrc/ffilterkit.o $(CFLAGS) + +nyqsrc/avg.o: nyqsrc/avg.c nyqsrc/avg.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/avg.c -o nyqsrc/avg.o $(CFLAGS) + +nyqsrc/fft.o: nyqsrc/fft.c nyqsrc/fft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/fft.c -o nyqsrc/fft.o $(CFLAGS) + +nyqsrc/sndfail.o: nyqsrc/sndfail.c + cc -c nyqsrc/sndfail.c -o nyqsrc/sndfail.o $(CFLAGS) + +snd/audionext.o: snd/audionext.c snd/snd.h + cc -c snd/audionext.c -o snd/audionext.o $(CFLAGS) + +snd/sndnext.o: snd/sndnext.c snd/sndnext.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c snd/sndnext.c -o snd/sndnext.o $(CFLAGS) + +snd/ieeecvt.o: snd/ieeecvt.c snd/ieeecvt.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c snd/ieeecvt.c -o snd/ieeecvt.o $(CFLAGS) + +snd/snd.o: snd/snd.c snd/snd.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c snd/snd.c -o snd/snd.o $(CFLAGS) + +snd/sndcvt.o: snd/sndcvt.c snd/snd.h + cc -c snd/sndcvt.c -o snd/sndcvt.o $(CFLAGS) + +snd/sndio.o: snd/sndio.c snd/snd.h + cc -c snd/sndio.c -o snd/sndio.o $(CFLAGS) + +snd/sndheader.o: snd/sndheader.c snd/sndheader.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c snd/sndheader.c -o snd/sndheader.o $(CFLAGS) + +fft/fftn.o: fft/fftn.c fft/fftn.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c fft/fftn.c -o fft/fftn.o $(CFLAGS) + +tran/amosc.o: tran/amosc.c tran/amosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/amosc.c -o tran/amosc.o $(CFLAGS) + +tran/clip.o: tran/clip.c tran/clip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/clip.c -o tran/clip.o $(CFLAGS) + +tran/const.o: tran/const.c tran/const.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/const.c -o tran/const.o $(CFLAGS) + +tran/fmosc.o: tran/fmosc.c tran/fmosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/fmosc.c -o tran/fmosc.o $(CFLAGS) + +tran/integrate.o: tran/integrate.c tran/integrate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/integrate.c -o tran/integrate.o $(CFLAGS) + +tran/log.o: tran/log.c tran/log.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/log.c -o tran/log.o $(CFLAGS) + +tran/maxv.o: tran/maxv.c tran/maxv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/maxv.c -o tran/maxv.o $(CFLAGS) + +tran/osc.o: tran/osc.c tran/osc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/osc.c -o tran/osc.o $(CFLAGS) + +tran/prod.o: tran/prod.c tran/prod.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/prod.c -o tran/prod.o $(CFLAGS) + +tran/buzz.o: tran/buzz.c tran/buzz.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/buzz.c -o tran/buzz.o $(CFLAGS) + +tran/pwl.o: tran/pwl.c tran/pwl.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/pwl.c -o tran/pwl.o $(CFLAGS) + +tran/recip.o: tran/recip.c tran/recip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/recip.c -o tran/recip.o $(CFLAGS) + +tran/upsample.o: tran/upsample.c tran/upsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/upsample.c -o tran/upsample.o $(CFLAGS) + +tran/scale.o: tran/scale.c tran/scale.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/scale.c -o tran/scale.o $(CFLAGS) + +tran/sine.o: tran/sine.c tran/sine.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/sine.c -o tran/sine.o $(CFLAGS) + +tran/partial.o: tran/partial.c tran/partial.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/partial.c -o tran/partial.o $(CFLAGS) + +tran/white.o: tran/white.c tran/white.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/white.c -o tran/white.o $(CFLAGS) + +tran/tone.o: tran/tone.c tran/tone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/tone.c -o tran/tone.o $(CFLAGS) + +tran/tonev.o: tran/tonev.c tran/tonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/tonev.c -o tran/tonev.o $(CFLAGS) + +tran/atonev.o: tran/atonev.c tran/atonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/atonev.c -o tran/atonev.o $(CFLAGS) + +tran/atone.o: tran/atone.c tran/atone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/atone.c -o tran/atone.o $(CFLAGS) + +tran/reson.o: tran/reson.c tran/reson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/reson.c -o tran/reson.o $(CFLAGS) + +tran/areson.o: tran/areson.c tran/areson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/areson.c -o tran/areson.o $(CFLAGS) + +tran/resonvc.o: tran/resonvc.c tran/resonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/resonvc.c -o tran/resonvc.o $(CFLAGS) + +tran/resoncv.o: tran/resoncv.c tran/resoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/resoncv.c -o tran/resoncv.o $(CFLAGS) + +tran/aresonvc.o: tran/aresonvc.c tran/aresonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/aresonvc.c -o tran/aresonvc.o $(CFLAGS) + +tran/aresoncv.o: tran/aresoncv.c tran/aresoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/aresoncv.c -o tran/aresoncv.o $(CFLAGS) + +tran/resonvv.o: tran/resonvv.c tran/resonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/resonvv.c -o tran/resonvv.o $(CFLAGS) + +tran/aresonvv.o: tran/aresonvv.c tran/aresonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/aresonvv.c -o tran/aresonvv.o $(CFLAGS) + +tran/offset.o: tran/offset.c tran/offset.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/offset.c -o tran/offset.o $(CFLAGS) + +tran/slope.o: tran/slope.c tran/slope.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/slope.c -o tran/slope.o $(CFLAGS) + +tran/delaycc.o: tran/delaycc.c tran/delaycc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/delaycc.c -o tran/delaycc.o $(CFLAGS) + +tran/delaycv.o: tran/delaycv.c tran/delaycv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/delaycv.c -o tran/delaycv.o $(CFLAGS) + +tran/shape.o: tran/shape.c tran/shape.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/shape.c -o tran/shape.o $(CFLAGS) + +tran/sampler.o: tran/sampler.c tran/sampler.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/sampler.c -o tran/sampler.o $(CFLAGS) + +tran/exp.o: tran/exp.c tran/exp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/exp.c -o tran/exp.o $(CFLAGS) + +tran/siosc.o: tran/siosc.c tran/siosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/siosc.c -o tran/siosc.o $(CFLAGS) + +tran/follow.o: tran/follow.c tran/follow.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/follow.c -o tran/follow.o $(CFLAGS) + +tran/gate.o: tran/gate.c tran/gate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/gate.c -o tran/gate.o $(CFLAGS) + +tran/quantize.o: tran/quantize.c tran/quantize.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/quantize.c -o tran/quantize.o $(CFLAGS) + +tran/ifft.o: tran/ifft.c tran/ifft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/ifft.c -o tran/ifft.o $(CFLAGS) + +tran/congen.o: tran/congen.c tran/congen.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/congen.c -o tran/congen.o $(CFLAGS) + +tran/fromobject.o: tran/fromobject.c tran/fromobject.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/fromobject.c -o tran/fromobject.o $(CFLAGS) + +tran/fromarraystream.o: tran/fromarraystream.c tran/fromarraystream.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/fromarraystream.c -o tran/fromarraystream.o $(CFLAGS) + +tran/coterm.o: tran/coterm.c tran/coterm.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/coterm.c -o tran/coterm.o $(CFLAGS) + +tran/convolve.o: tran/convolve.c tran/convolve.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/convolve.c -o tran/convolve.o $(CFLAGS) + +tran/alpass.o: tran/alpass.c tran/alpass.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/alpass.c -o tran/alpass.o $(CFLAGS) + +tran/oneshot.o: tran/oneshot.c tran/oneshot.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/oneshot.c -o tran/oneshot.o $(CFLAGS) + +tran/chase.o: tran/chase.c tran/chase.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/chase.c -o tran/chase.o $(CFLAGS) + +tran/tapv.o: tran/tapv.c tran/tapv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/tapv.c -o tran/tapv.o $(CFLAGS) + +tran/biquad.o: tran/biquad.c tran/biquad.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/biquad.c -o tran/biquad.o $(CFLAGS) + +tran/pluck.o: tran/pluck.c tran/pluck.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/pluck.c -o tran/pluck.o $(CFLAGS) + +nyqsrc/sndfnint.o: nyqsrc/sndfnint.c + cc -c nyqsrc/sndfnint.c -o nyqsrc/sndfnint.o $(CFLAGS) + +nyqsrc/seqfnint.o: nyqsrc/seqfnint.c + cc -c nyqsrc/seqfnint.c -o nyqsrc/seqfnint.o $(CFLAGS) + +xlisp/xlftab.o: nyqsrc/sndfnintptrs.h nyqsrc/sndfnintdefs.h nyqsrc/seqfnintptrs.h nyqsrc/seqfnintdefs.h + cc -c xlisp/xlftab.c -o xlisp/xlftab.o $(CFLAGS) + +xlisp/extern.o: xlisp/extern.c + cc -c xlisp/extern.c -o xlisp/extern.o $(CFLAGS) + +xlisp/xldmem.o: xlisp/xldmem.c + cc -c xlisp/xldmem.c -o xlisp/xldmem.o $(CFLAGS) + +xlisp/xlbfun.o: xlisp/xlbfun.c + cc -c xlisp/xlbfun.c -o xlisp/xlbfun.o $(CFLAGS) + +xlisp/xlcont.o: xlisp/xlcont.c + cc -c xlisp/xlcont.c -o xlisp/xlcont.o $(CFLAGS) + +xlisp/xldbug.o: xlisp/xldbug.c + cc -c xlisp/xldbug.c -o xlisp/xldbug.o $(CFLAGS) + +xlisp/xleval.o: xlisp/xleval.c + cc -c xlisp/xleval.c -o xlisp/xleval.o $(CFLAGS) + +xlisp/xlfio.o: xlisp/xlfio.c + cc -c xlisp/xlfio.c -o xlisp/xlfio.o $(CFLAGS) + +xlisp/xlglob.o: xlisp/xlglob.c + cc -c xlisp/xlglob.c -o xlisp/xlglob.o $(CFLAGS) + +xlisp/xlimage.o: xlisp/xlimage.c + cc -c xlisp/xlimage.c -o xlisp/xlimage.o $(CFLAGS) + +xlisp/xlinit.o: xlisp/xlinit.c + cc -c xlisp/xlinit.c -o xlisp/xlinit.o $(CFLAGS) + +xlisp/xlio.o: xlisp/xlio.c + cc -c xlisp/xlio.c -o xlisp/xlio.o $(CFLAGS) + +xlisp/xlisp.o: xlisp/xlisp.c + cc -c xlisp/xlisp.c -o xlisp/xlisp.o $(CFLAGS) + +xlisp/xllist.o: xlisp/xllist.c + cc -c xlisp/xllist.c -o xlisp/xllist.o $(CFLAGS) + +xlisp/xlmath.o: xlisp/xlmath.c + cc -c xlisp/xlmath.c -o xlisp/xlmath.o $(CFLAGS) + +xlisp/xlobj.o: xlisp/xlobj.c + cc -c xlisp/xlobj.c -o xlisp/xlobj.o $(CFLAGS) + +xlisp/xlpp.o: xlisp/xlpp.c + cc -c xlisp/xlpp.c -o xlisp/xlpp.o $(CFLAGS) + +xlisp/xlprin.o: xlisp/xlprin.c + cc -c xlisp/xlprin.c -o xlisp/xlprin.o $(CFLAGS) + +xlisp/xlread.o: xlisp/xlread.c + cc -c xlisp/xlread.c -o xlisp/xlread.o $(CFLAGS) + +xlisp/xlstr.o: xlisp/xlstr.c + cc -c xlisp/xlstr.c -o xlisp/xlstr.o $(CFLAGS) + +xlisp/xlsubr.o: xlisp/xlsubr.c + cc -c xlisp/xlsubr.c -o xlisp/xlsubr.o $(CFLAGS) + +xlisp/xlsym.o: xlisp/xlsym.c + cc -c xlisp/xlsym.c -o xlisp/xlsym.o $(CFLAGS) + +xlisp/xlsys.o: xlisp/xlsys.c + cc -c xlisp/xlsys.c -o xlisp/xlsys.o $(CFLAGS) + +cmt/cext.o: cmt/cext.c + cc -c cmt/cext.c -o cmt/cext.o $(CFLAGS) + +cmt/cleanup.o: cmt/cleanup.c + cc -c cmt/cleanup.c -o cmt/cleanup.o $(CFLAGS) + +cmt/cmdline.o: cmt/cmdline.c + cc -c cmt/cmdline.c -o cmt/cmdline.o $(CFLAGS) + +cmt/cmtcmd.o: cmt/cmtcmd.c + cc -c cmt/cmtcmd.c -o cmt/cmtcmd.o $(CFLAGS) + +cmt/moxc.o: cmt/moxc.c + cc -c cmt/moxc.c -o cmt/moxc.o $(CFLAGS) + +cmt/mem.o: cmt/mem.c + cc -c cmt/mem.c -o cmt/mem.o $(CFLAGS) + +cmt/midifile.o: cmt/midifile.c + cc -c cmt/midifile.c -o cmt/midifile.o $(CFLAGS) + +cmt/midifns.o: cmt/midifns.c + cc -c cmt/midifns.c -o cmt/midifns.o $(CFLAGS) + +cmt/record.o: cmt/record.c + cc -c cmt/record.c -o cmt/record.o $(CFLAGS) + +cmt/seq.o: cmt/seq.c + cc -c cmt/seq.c -o cmt/seq.o $(CFLAGS) + +cmt/seqmread.o: cmt/seqmread.c + cc -c cmt/seqmread.c -o cmt/seqmread.o $(CFLAGS) + +cmt/seqmwrite.o: cmt/seqmwrite.c + cc -c cmt/seqmwrite.c -o cmt/seqmwrite.o $(CFLAGS) + +cmt/seqread.o: cmt/seqread.c + cc -c cmt/seqread.c -o cmt/seqread.o $(CFLAGS) + +cmt/seqwrite.o: cmt/seqwrite.c + cc -c cmt/seqwrite.c -o cmt/seqwrite.o $(CFLAGS) + +cmt/tempomap.o: cmt/tempomap.c + cc -c cmt/tempomap.c -o cmt/tempomap.o $(CFLAGS) + +cmt/timebase.o: cmt/timebase.c + cc -c cmt/timebase.c -o cmt/timebase.o $(CFLAGS) + +cmt/userio.o: cmt/userio.c + cc -c cmt/userio.c -o cmt/userio.o $(CFLAGS) + +sys/unix/osstuff.o: sys/unix/osstuff.c + cc -c sys/unix/osstuff.c -o sys/unix/osstuff.o $(CFLAGS) + + +# this doesn't compile with the -O switch (a NeXT compiler bug?) +xlisp/xljump.o : xlisp/xljump.c xlisp/xlisp.h + $(CC) -DCMTSTUFF -c xlisp/xljump.c -o xlisp/xljump.o +misc/intgen: misc/intgen.c + cd misc; make intgen + +misc/unpacker: misc/unpacker.c misc/convert.c + cd misc; make unpacker + +misc/packer: misc/packer.c misc/convert.c + cd misc; make packer + +nyqsrc/sndfnintptrs.h: $(NYQHDRS) snd/snd.h misc/intgen + $(INTGEN) nyqsrc/sndfnint $(NYQHDRS) + +nyqsrc/seqfnintptrs.h: $(CMTHDRS) misc/intgen + $(INTGEN) nyqsrc/seqfnint $(CMTHDRS) + +clean: + cd misc; make clean + rm -f $(OBJECTS) +# Note that these files are machine-generated: + rm -f nyqsrc/sndfnintptrs.h nyqsrc/sndfnint.c nyqsrc/sndfnintdefs.h + rm -f nyqsrc/seqfnintptrs.h nyqsrc/seqfnint.c nyqsrc/seqfnintdefs.h + +cleaner: clean + cd misc; make cleaner + rm -f *.backup */*.backup + rm -f *~ */*.*~ + rm -f *.save */*.save + rm -f *.CKP */*.CKP + rm -f *.BAK */*.BAK + rm -f *.old */*.old + rm -f *.gold */*.gold + rm -f playparms + rm -f points.dat diff --git a/sys/unix/next/system.lsp b/sys/unix/next/system.lsp new file mode 100644 index 0000000..42e2471 --- /dev/null +++ b/sys/unix/next/system.lsp @@ -0,0 +1,37 @@ +; local definition for play +; this one is for NeXT: + +(if (not (boundp '*default-sf-format*)) + (setf *default-sf-format* snd-head-NeXT)) + +(if (not (boundp '*default-sound-file*)) + (compute-default-sound-file)) + +(if (not (boundp '*default-sf-dir*)) + (setf *default-sf-dir* "./")) + +(if (not (boundp '*default-sf-mode*)) + (setf *default-sf-mode* snd-head-mode-pcm)) + +(if (not (boundp '*default-sf-bits*)) + (setf *default-sf-bits* 16)) + +(if (not (boundp '*default-plot-file*)) + (setf *default-plot-file* "points.dat")) + +;; PLAY-FILE - play a sound file +;; +(defun play-file (name) + (system (strcat "sndplay " (soundfilename name)))) + +;; R - replay last file written with PLAY +(defun r () (play-file *default-sound-file*)) + +;; PLAY - write value of an expression to file and play it +;; +(defmacro play (expr) + `(prog (specs) + (setf specs (s-save (force-srate *sound-srate* ,expr) + 1000000000 *default-sound-file*)) + (r))) + diff --git a/sys/unix/nonalsa/Makefile b/sys/unix/nonalsa/Makefile new file mode 100644 index 0000000..9f01331 --- /dev/null +++ b/sys/unix/nonalsa/Makefile @@ -0,0 +1,1178 @@ +# +# Makefile for Nyquist, SYSTEM-TYPE is NONALSA +# run make in the top-level Nyquist directory to compile Nyquist +# +# NOTE: this file is machine-generated. DO NOT EDIT! +# Instead, modify makefile.lsp and regenerate the makefile. +# Ports and bug fixes are welcome - please mail them to +# dannenberg@cs.cmu.edu. Thanks. +# + +# This is the resulting executable (normally "ny"): +NY = ny + +OPT = -O2 -m32 +# OPT = -g -m32 + +EVERYTHING = $(NY) runtime/system.lsp jnyqide/jNyqIDE.jar \ + bin/ser-to-osc bin/test-client + +CURRENT = $(EVERYTHING) + +current: $(CURRENT) + +onlyny: $(NY) runtime/system.lsp + +JAVASRC = jnyqide/browser.java jnyqide/NyquistThread.java \ + jnyqide/Pair.java jnyqide/BareBonesBrowserLaunch.java \ + jnyqide/EnvelopeFrame.java jnyqide/Piano_Roll.java \ + jnyqide/FindDialog.java jnyqide/PlotFrame.java \ + jnyqide/InstrumentCharacteristics.java \ + jnyqide/PlotMouseAdapter.java \ + jnyqide/Jslide.java jnyqide/PopupListener.java \ + jnyqide/LispFileFilter.java jnyqide/PreferencesDialog.java \ + jnyqide/MainFrame_AboutBox.java jnyqide/ReplaceDialog.java \ + jnyqide/MainFrame.java jnyqide/SpringUtilities.java \ + jnyqide/Main.java \ + jnyqide/NotFoundDialog.java jnyqide/TextColor.java \ + jnyqide/NyqPlot.java jnyqide/Trie.java \ + jnyqide/NyquistFile.java jnyqide/WordList.java + + +jnyqide/jNyqIDE.jar: $(JAVASRC) + if [ -r jnyqide/SpecialMacHandler.java ] ; then \ + mv jnyqide/SpecialMacHandler.java jnyqide/SpecialMacHandler.hidden ;\ + fi + cd jnyqide; javac *.java + mv jnyqide/SpecialMacHandler.hidden jnyqide/SpecialMacHandler.java + rm -rf jnyqide/jNyqIDE.jar + jar -cfm jnyqide/jNyqIDE.jar jnyqide/manifest.txt jnyqide/*.class + +# Standard list of includes (common to all unix versions) +# Keeping portaudio and libsndfile sources local to nyquist +INCL = -Inyqsrc -Itran -Ixlisp -Isys/unix -Icmt -Iffts/src \ + -Inyqstk/include -Inyqstk -Iportaudio/include -Iportaudio/src/common \ + -Iportaudio/src/os/unix \ + -Iliblo -Inylsf + +# system dependent stuff for nonalsa: + +AUDIOLIBS = + +CC = gcc + +LIBPA_PATH = portaudio/lib/.libs + +LIBLO_PATH = liblo/src/.libs + +# to enable command line editing, use -DREADLINE. WARNING: THIS WILL +# DISABLE THE ABILITY TO INTERRUPT LISP AND USE SOME OTHER HANDY +# CONTROL CHARACTERS (You will also need the readline and curses libraries) +CFLAGS = -DOSC -DCMTSTUFF $(OPT) $(INCL) \ + -DHAVE_LIBPTHREAD=1 -D_FILE_OFFSET_BITS=64 \ + -DSTK_NYQUIST -DUSE_VSPRINTF \ + -DHAVE_CONFIG_H +LN = g++ -m32 +AR = ar +# to enable command line editing, insert -lreadline -lcurses +LFLAGS = $(LIBPA_PATH)/libportaudio.a $(LIBLO_PATH)/liblo.a $(AUDIOLIBS) -lm -lpthread -lrt + +TAGS: + find . ( -name + +INTGEN = misc/intgen + +# Object files for Nyquist: +OBJECTS = xlisp/extern.o xlisp/xldmem.o \ + xlisp/xlbfun.o xlisp/xlcont.o \ + xlisp/xldbug.o xlisp/xleval.o \ + xlisp/xlfio.o xlisp/xlftab.o \ + xlisp/xlglob.o xlisp/xlimage.o \ + xlisp/xlinit.o xlisp/xlio.o \ + xlisp/xlisp.o xlisp/xljump.o \ + xlisp/xllist.o xlisp/xlmath.o \ + xlisp/xlobj.o xlisp/xlpp.o \ + xlisp/xlprin.o xlisp/xlread.o \ + xlisp/xlstr.o xlisp/xlsubr.o \ + xlisp/xlsym.o xlisp/xlsys.o \ + xlisp/path.o tran/abs.o \ + tran/allpoles.o tran/alpass.o \ + tran/alpasscv.o tran/alpassvv.o \ + tran/amosc.o tran/areson.o \ + tran/aresonvc.o tran/aresoncv.o \ + tran/aresonvv.o tran/atone.o \ + tran/atonev.o tran/biquadfilt.o \ + tran/buzz.o tran/chase.o \ + tran/clip.o tran/congen.o \ + tran/const.o tran/coterm.o \ + tran/delaycc.o tran/delaycv.o \ + tran/eqbandvvv.o tran/exp.o \ + tran/follow.o tran/fmosc.o \ + tran/fromobject.o tran/fromarraystream.o \ + tran/gate.o tran/ifft.o \ + tran/instrclar.o tran/instrclarall.o \ + tran/instrclarfreq.o tran/instrsax.o \ + tran/instrsaxall.o tran/instrsaxfreq.o \ + tran/integrate.o tran/log.o \ + tran/lpreson.o tran/maxv.o \ + tran/offset.o tran/oneshot.o \ + tran/osc.o tran/partial.o \ + tran/pluck.o tran/prod.o \ + tran/pwl.o tran/quantize.o \ + tran/recip.o tran/reson.o \ + tran/resonvc.o tran/resoncv.o \ + tran/resonvv.o tran/sampler.o \ + tran/scale.o tran/shape.o \ + tran/sine.o tran/siosc.o \ + tran/slope.o tran/sqrt.o \ + tran/tapf.o tran/tapv.o \ + tran/tone.o tran/tonev.o \ + tran/upsample.o tran/white.o \ + tran/stkrev.o tran/stkpitshift.o \ + tran/stkchorus.o tran/instrbow.o \ + tran/instrbowedfreq.o tran/instrbanded.o \ + tran/instrmandolin.o tran/instrsitar.o \ + tran/instrmodalbar.o tran/instrflute.o \ + tran/instrflutefreq.o tran/instrfluteall.o \ + tran/fmfb.o tran/fmfbv.o \ + cmt/cext.o cmt/cleanup.o \ + cmt/cmdline.o cmt/cmtcmd.o \ + cmt/moxc.o cmt/mem.o \ + cmt/midifile.o cmt/midifns.o \ + cmt/record.o cmt/seq.o \ + cmt/seqmread.o cmt/seqmwrite.o \ + cmt/seqread.o cmt/seqwrite.o \ + cmt/tempomap.o cmt/timebase.o \ + cmt/userio.o nylsf/aiff.o \ + nylsf/alaw.o nylsf/au.o \ + nylsf/avr.o nylsf/broadcast.o \ + nylsf/caf.o nylsf/command.o \ + nylsf/common.o nylsf/dither.o \ + nylsf/double64.o nylsf/dwd.o \ + nylsf/dwvw.o nylsf/file_io.o \ + nylsf/flac.o nylsf/float32.o \ + nylsf/gsm610.o nylsf/htk.o \ + nylsf/ima_adpcm.o nylsf/interleave.o \ + nylsf/ircam.o nylsf/macbinary3.o \ + nylsf/macos.o nylsf/mat4.o \ + nylsf/mat5.o nylsf/ms_adpcm.o \ + nylsf/nist.o nylsf/ogg.o \ + nylsf/paf.o nylsf/pcm.o \ + nylsf/pvf.o nylsf/raw.o \ + nylsf/rx2.o nylsf/sd2.o \ + nylsf/sds.o nylsf/sndfile.o \ + nylsf/strings.o nylsf/svx.o \ + nylsf/txw.o nylsf/ulaw.o \ + nylsf/voc.o nylsf/vox_adpcm.o \ + nylsf/w64.o nylsf/wav.o \ + nylsf/wav_w64.o nylsf/wve.o \ + nylsf/xi.o nylsf/g72x.o \ + nylsf/GSM610/add.o nylsf/GSM610/code.o \ + nylsf/GSM610/decode.o nylsf/GSM610/gsm_create.o \ + nylsf/GSM610/gsm_decode.o nylsf/GSM610/gsm_destroy.o \ + nylsf/GSM610/gsm_encode.o nylsf/GSM610/gsm_option.o \ + nylsf/GSM610/long_term.o nylsf/GSM610/lpc.o \ + nylsf/GSM610/preprocess.o nylsf/GSM610/rpe.o \ + nylsf/GSM610/short_term.o nylsf/GSM610/table.o \ + nylsf/G72x/g721.o nylsf/G72x/g723_16.o \ + nylsf/G72x/g723_24.o nylsf/G72x/g723_40.o \ + nylsf/G72x/g72x.o nyqsrc/debug.o \ + nyqsrc/falloc.o nyqsrc/local.o \ + nyqsrc/handlers.o nyqsrc/multiread.o \ + nyqsrc/seqext.o nyqsrc/seqinterf.o \ + nyqsrc/stats.o nyqsrc/ffilterkit.o \ + nyqsrc/sliders.o nyqsrc/sound.o \ + nyqsrc/add.o nyqsrc/avg.o \ + nyqsrc/compose.o nyqsrc/convolve.o \ + nyqsrc/downsample.o nyqsrc/fft.o \ + nyqsrc/inverse.o nyqsrc/multiseq.o \ + nyqsrc/resamp.o nyqsrc/resampv.o \ + nyqsrc/samples.o nyqsrc/sndmax.o \ + nyqsrc/sndread.o nyqsrc/sndseq.o \ + nyqsrc/sndwritepa.o nyqsrc/yin.o \ + nyqsrc/nyq-osc-server.o nyqsrc/trigger.o \ + nyqsrc/lpanal.o nyqsrc/phasevocoder.o \ + nyqsrc/pvshell.o nyqstk/src/Generator.o \ + nyqstk/src/SineWave.o nyqstk/src/Function.o \ + nyqstk/src/FileRead.o nyqstk/src/FileWvIn.o \ + nyqstk/src/Effect.o nyqstk/src/Clarinet.o \ + nyqstk/src/Delay.o nyqstk/src/DelayL.o \ + nyqstk/src/Envelope.o nyqstk/src/Filter.o \ + nyqstk/src/Instrmnt.o nyqstk/src/Noise.o \ + nyqstk/src/OneZero.o nyqstk/src/ReedTable.o \ + nyqstk/src/Saxofony.o nyqstk/src/Stk.o \ + nyqstk/src/WaveLoop.o nyqstk/src/WvIn.o \ + nyqstk/src/NRev.o nyqstk/src/JCRev.o \ + nyqstk/src/PRCRev.o nyqstk/src/PitShift.o \ + nyqstk/src/Chorus.o nyqstk/src/Bowed.o \ + nyqstk/src/BowTable.o nyqstk/src/ADSR.o \ + nyqstk/src/OnePole.o nyqstk/src/BiQuad.o \ + nyqstk/src/BandedWG.o nyqstk/src/DelayA.o \ + nyqstk/src/Mandolin.o nyqstk/src/PluckTwo.o \ + nyqstk/src/Sitar.o nyqstk/src/ModalBar.o \ + nyqstk/src/Modal.o nyqstk/src/Flute.o \ + nyqstk/src/JetTable.o nyqstk/src/PoleZero.o \ + nyqstk/stkinit.o nyqstk/instr.o \ + nyqstk/stkint.o ffts/src/fftext.o \ + ffts/src/fftlib.o ffts/src/matlib.o \ + nyqsrc/sndfnint.o nyqsrc/seqfnint.o \ + sys/unix/osstuff.o sys/unix/term.o + +# Sound functions to add to xlisp +NYQHDRS = nyqsrc/sndfmt.h nylsf/sndfile.h \ + nyqsrc/sound.h nyqsrc/add.h \ + nyqsrc/avg.h nyqsrc/compose.h \ + nyqsrc/convolve.h nyqsrc/downsample.h \ + nyqsrc/fft.h nyqsrc/inverse.h \ + nyqsrc/multiseq.h nyqsrc/resamp.h \ + nyqsrc/resampv.h nyqsrc/samples.h \ + nyqsrc/sndmax.h nyqsrc/sndread.h \ + nyqsrc/sndseq.h nyqsrc/sndsliders.h \ + nyqsrc/sndwrite.h nyqsrc/yin.h \ + nyqsrc/nyq-osc-server.h nyqsrc/trigger.h \ + nyqsrc/lpanal.h nyqsrc/phasevocoder.h \ + nyqsrc/pvshell.h tran/abs.h \ + tran/allpoles.h tran/alpass.h \ + tran/alpasscv.h tran/alpassvv.h \ + tran/amosc.h tran/areson.h \ + tran/aresonvc.h tran/aresoncv.h \ + tran/aresonvv.h tran/atone.h \ + tran/atonev.h tran/biquadfilt.h \ + tran/buzz.h tran/chase.h \ + tran/clip.h tran/congen.h \ + tran/const.h tran/coterm.h \ + tran/delaycc.h tran/delaycv.h \ + tran/eqbandvvv.h tran/exp.h \ + tran/follow.h tran/fmosc.h \ + tran/fromobject.h tran/fromarraystream.h \ + tran/gate.h tran/ifft.h \ + tran/instrclar.h tran/instrclarall.h \ + tran/instrclarfreq.h tran/instrsax.h \ + tran/instrsaxall.h tran/instrsaxfreq.h \ + tran/integrate.h tran/log.h \ + tran/lpreson.h tran/maxv.h \ + tran/offset.h tran/oneshot.h \ + tran/osc.h tran/partial.h \ + tran/pluck.h tran/prod.h \ + tran/pwl.h tran/quantize.h \ + tran/recip.h tran/reson.h \ + tran/resonvc.h tran/resoncv.h \ + tran/resonvv.h tran/sampler.h \ + tran/scale.h tran/shape.h \ + tran/sine.h tran/siosc.h \ + tran/slope.h tran/sqrt.h \ + tran/tapf.h tran/tapv.h \ + tran/tone.h tran/tonev.h \ + tran/upsample.h tran/white.h \ + tran/stkrev.h tran/stkpitshift.h \ + tran/stkchorus.h tran/instrbow.h \ + tran/instrbowedfreq.h tran/instrbanded.h \ + tran/instrmandolin.h tran/instrsitar.h \ + tran/instrmodalbar.h tran/instrflute.h \ + tran/instrflutefreq.h tran/instrfluteall.h \ + tran/fmfb.h tran/fmfbv.h + +CMTHDRS = cmt/seqdecls.h nyqsrc/seqext.h \ + cmt/seq.h nyqsrc/seqinterf.h \ + cmt/seqread.h cmt/seqmread.h \ + cmt/seqwrite.h cmt/seqmwrite.h + + + +bin: + mkdir bin + +liblo/Makefile: + cd liblo; ./configure CFLAGS=-m32 LDFLAGS=-m32 CXXFLAGS=-m32 --enable-static --disable-shared + # sometimes, residual files cause problems + cd liblo; make clean + +$(LIBLO_PATH)/liblo.a: liblo/Makefile + cd liblo; make + +bin/ser-to-osc: bin $(LIBLO_PATH)/liblo.a + $(CC) -c $(CFLAGS) liblo/ser-to-osc/ser-to-osc.cpp \ + -o liblo/ser-to-osc/ser-to-osc.o + $(LN) liblo/ser-to-osc/ser-to-osc.o -o bin/ser-to-osc $(LFLAGS) + +bin/test-client: bin $(LIBLO_PATH)/liblo.a + $(CC) -c $(CFLAGS) liblo/test-client/test-client.c \ + -o liblo/test-client/test-client.o + $(LN) liblo/test-client/test-client.o -o bin/test-client $(LFLAGS) + +portaudio/Makefile: + # note: without-jack avoids 32/64-bit link error on Debian + cd portaudio; ./configure CFLAGS=-m32 LDFLAGS=-m32 CXXFLAGS=-m32 --enable-static --disable-shared --without-jack + # sometimes, residual files cause problems + cd portaudio; make clean + +$(LIBPA_PATH)/libportaudio.a: portaudio/Makefile + cd portaudio; make + +$(NY): $(OBJECTS) $(LIBPA_PATH)/libportaudio.a $(LIBLO_PATH)/liblo.a + $(LN) $(OBJECTS) $(LFLAGS) -o $(NY) + +# copy appropriate system.lsp and make it read-only; +# changes should be made to sys/unix/<system>/system.lsp +runtime/system.lsp: sys/unix/nonalsa/system.lsp + # make sure it's there before you make it writeable + touch runtime/system.lsp + chmod +w runtime/system.lsp + cp -p sys/unix/nonalsa/system.lsp runtime/system.lsp + chmod -w runtime/system.lsp + +nyqsrc/sound.o: nyqsrc/sound.c nyqsrc/sound.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/sound.c -o nyqsrc/sound.o $(CFLAGS) + +nyqsrc/add.o: nyqsrc/add.c nyqsrc/add.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/add.c -o nyqsrc/add.o $(CFLAGS) + +nyqsrc/avg.o: nyqsrc/avg.c nyqsrc/avg.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/avg.c -o nyqsrc/avg.o $(CFLAGS) + +nyqsrc/compose.o: nyqsrc/compose.c nyqsrc/compose.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/compose.c -o nyqsrc/compose.o $(CFLAGS) + +nyqsrc/convolve.o: nyqsrc/convolve.c nyqsrc/convolve.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/convolve.c -o nyqsrc/convolve.o $(CFLAGS) + +nyqsrc/downsample.o: nyqsrc/downsample.c nyqsrc/downsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/downsample.c -o nyqsrc/downsample.o $(CFLAGS) + +nyqsrc/fft.o: nyqsrc/fft.c nyqsrc/fft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/fft.c -o nyqsrc/fft.o $(CFLAGS) + +nyqsrc/inverse.o: nyqsrc/inverse.c nyqsrc/inverse.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/inverse.c -o nyqsrc/inverse.o $(CFLAGS) + +nyqsrc/multiseq.o: nyqsrc/multiseq.c nyqsrc/multiseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/multiseq.c -o nyqsrc/multiseq.o $(CFLAGS) + +nyqsrc/resamp.o: nyqsrc/resamp.c nyqsrc/resamp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/resamp.c -o nyqsrc/resamp.o $(CFLAGS) + +nyqsrc/resampv.o: nyqsrc/resampv.c nyqsrc/resampv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/resampv.c -o nyqsrc/resampv.o $(CFLAGS) + +nyqsrc/samples.o: nyqsrc/samples.c nyqsrc/samples.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/samples.c -o nyqsrc/samples.o $(CFLAGS) + +nyqsrc/sndmax.o: nyqsrc/sndmax.c nyqsrc/sndmax.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/sndmax.c -o nyqsrc/sndmax.o $(CFLAGS) + +nyqsrc/sndread.o: nyqsrc/sndread.c nyqsrc/sndread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/sndread.c -o nyqsrc/sndread.o $(CFLAGS) + +nyqsrc/sndseq.o: nyqsrc/sndseq.c nyqsrc/sndseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/sndseq.c -o nyqsrc/sndseq.o $(CFLAGS) + +nyqsrc/sndsliders.o: nyqsrc/sndsliders.c nyqsrc/sndsliders.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/sndsliders.c -o nyqsrc/sndsliders.o $(CFLAGS) + +nyqsrc/sndwritepa.o: nyqsrc/sndwritepa.c nyqsrc/sndwrite.h + $(CC) -c nyqsrc/sndwritepa.c -o nyqsrc/sndwritepa.o $(CFLAGS) + +nyqsrc/yin.o: nyqsrc/yin.c nyqsrc/yin.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/yin.c -o nyqsrc/yin.o $(CFLAGS) + +nyqsrc/nyq-osc-server.o: nyqsrc/nyq-osc-server.c nyqsrc/nyq-osc-server.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/nyq-osc-server.c -o nyqsrc/nyq-osc-server.o $(CFLAGS) + +nyqsrc/trigger.o: nyqsrc/trigger.c nyqsrc/trigger.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/trigger.c -o nyqsrc/trigger.o $(CFLAGS) + +nyqsrc/lpanal.o: nyqsrc/lpanal.c nyqsrc/lpanal.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/lpanal.c -o nyqsrc/lpanal.o $(CFLAGS) + +nyqsrc/phasevocoder.o: nyqsrc/phasevocoder.c nyqsrc/phasevocoder.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/phasevocoder.c -o nyqsrc/phasevocoder.o $(CFLAGS) + +nyqsrc/pvshell.o: nyqsrc/pvshell.c nyqsrc/pvshell.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/pvshell.c -o nyqsrc/pvshell.o $(CFLAGS) + +nyqsrc/debug.o: nyqsrc/debug.c nyqsrc/debug.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/debug.c -o nyqsrc/debug.o $(CFLAGS) + +nyqsrc/falloc.o: nyqsrc/falloc.c nyqsrc/falloc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/falloc.c -o nyqsrc/falloc.o $(CFLAGS) + +nyqsrc/local.o: nyqsrc/local.c xlisp/xlisp.h nyqsrc/sound.h + $(CC) -c nyqsrc/local.c -o nyqsrc/local.o $(CFLAGS) + +nyqsrc/handlers.o: nyqsrc/handlers.c + $(CC) -c nyqsrc/handlers.c -o nyqsrc/handlers.o $(CFLAGS) + +nyqsrc/multiread.o: nyqsrc/multiread.c nyqsrc/multiread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/multiread.c -o nyqsrc/multiread.o $(CFLAGS) + +nyqsrc/seqext.o: nyqsrc/seqext.c nyqsrc/seqext.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/seqext.c -o nyqsrc/seqext.o $(CFLAGS) + +nyqsrc/seqinterf.o: nyqsrc/seqinterf.c nyqsrc/seqinterf.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/seqinterf.c -o nyqsrc/seqinterf.o $(CFLAGS) + +nyqsrc/stats.o: nyqsrc/stats.c nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/stats.c -o nyqsrc/stats.o $(CFLAGS) + +nyqsrc/ffilterkit.o: nyqsrc/ffilterkit.c nyqsrc/ffilterkit.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/ffilterkit.c -o nyqsrc/ffilterkit.o $(CFLAGS) + +nyqsrc/sliders.o: nyqsrc/sliders.c nyqsrc/sliders.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c nyqsrc/sliders.c -o nyqsrc/sliders.o $(CFLAGS) + +ffts/src/fftext.o: ffts/src/fftext.c ffts/src/fftext.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c ffts/src/fftext.c -o ffts/src/fftext.o $(CFLAGS) + +ffts/src/fftlib.o: ffts/src/fftlib.c ffts/src/fftlib.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c ffts/src/fftlib.c -o ffts/src/fftlib.o $(CFLAGS) + +ffts/src/matlib.o: ffts/src/matlib.c ffts/src/matlib.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c ffts/src/matlib.c -o ffts/src/matlib.o $(CFLAGS) + +tran/abs.o: tran/abs.c tran/abs.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/abs.c -o tran/abs.o $(CFLAGS) + +tran/allpoles.o: tran/allpoles.c tran/allpoles.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/allpoles.c -o tran/allpoles.o $(CFLAGS) + +tran/alpass.o: tran/alpass.c tran/alpass.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/alpass.c -o tran/alpass.o $(CFLAGS) + +tran/alpasscv.o: tran/alpasscv.c tran/alpasscv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/alpasscv.c -o tran/alpasscv.o $(CFLAGS) + +tran/alpassvv.o: tran/alpassvv.c tran/alpassvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/alpassvv.c -o tran/alpassvv.o $(CFLAGS) + +tran/amosc.o: tran/amosc.c tran/amosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/amosc.c -o tran/amosc.o $(CFLAGS) + +tran/areson.o: tran/areson.c tran/areson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/areson.c -o tran/areson.o $(CFLAGS) + +tran/aresonvc.o: tran/aresonvc.c tran/aresonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/aresonvc.c -o tran/aresonvc.o $(CFLAGS) + +tran/aresoncv.o: tran/aresoncv.c tran/aresoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/aresoncv.c -o tran/aresoncv.o $(CFLAGS) + +tran/aresonvv.o: tran/aresonvv.c tran/aresonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/aresonvv.c -o tran/aresonvv.o $(CFLAGS) + +tran/atone.o: tran/atone.c tran/atone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/atone.c -o tran/atone.o $(CFLAGS) + +tran/atonev.o: tran/atonev.c tran/atonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/atonev.c -o tran/atonev.o $(CFLAGS) + +tran/biquadfilt.o: tran/biquadfilt.c tran/biquadfilt.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/biquadfilt.c -o tran/biquadfilt.o $(CFLAGS) + +tran/buzz.o: tran/buzz.c tran/buzz.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/buzz.c -o tran/buzz.o $(CFLAGS) + +tran/chase.o: tran/chase.c tran/chase.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/chase.c -o tran/chase.o $(CFLAGS) + +tran/clip.o: tran/clip.c tran/clip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/clip.c -o tran/clip.o $(CFLAGS) + +tran/congen.o: tran/congen.c tran/congen.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/congen.c -o tran/congen.o $(CFLAGS) + +tran/const.o: tran/const.c tran/const.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/const.c -o tran/const.o $(CFLAGS) + +tran/coterm.o: tran/coterm.c tran/coterm.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/coterm.c -o tran/coterm.o $(CFLAGS) + +tran/delaycc.o: tran/delaycc.c tran/delaycc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/delaycc.c -o tran/delaycc.o $(CFLAGS) + +tran/delaycv.o: tran/delaycv.c tran/delaycv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/delaycv.c -o tran/delaycv.o $(CFLAGS) + +tran/eqbandvvv.o: tran/eqbandvvv.c tran/eqbandvvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/eqbandvvv.c -o tran/eqbandvvv.o $(CFLAGS) + +tran/exp.o: tran/exp.c tran/exp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/exp.c -o tran/exp.o $(CFLAGS) + +tran/follow.o: tran/follow.c tran/follow.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/follow.c -o tran/follow.o $(CFLAGS) + +tran/fmosc.o: tran/fmosc.c tran/fmosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/fmosc.c -o tran/fmosc.o $(CFLAGS) + +tran/fromobject.o: tran/fromobject.c tran/fromobject.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/fromobject.c -o tran/fromobject.o $(CFLAGS) + +tran/fromarraystream.o: tran/fromarraystream.c tran/fromarraystream.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/fromarraystream.c -o tran/fromarraystream.o $(CFLAGS) + +tran/gate.o: tran/gate.c tran/gate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/gate.c -o tran/gate.o $(CFLAGS) + +tran/ifft.o: tran/ifft.c tran/ifft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/ifft.c -o tran/ifft.o $(CFLAGS) + +tran/instrclar.o: tran/instrclar.c tran/instrclar.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrclar.c -o tran/instrclar.o $(CFLAGS) + +tran/instrclarall.o: tran/instrclarall.c tran/instrclarall.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrclarall.c -o tran/instrclarall.o $(CFLAGS) + +tran/instrclarfreq.o: tran/instrclarfreq.c tran/instrclarfreq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrclarfreq.c -o tran/instrclarfreq.o $(CFLAGS) + +tran/instrsax.o: tran/instrsax.c tran/instrsax.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrsax.c -o tran/instrsax.o $(CFLAGS) + +tran/instrsaxall.o: tran/instrsaxall.c tran/instrsaxall.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrsaxall.c -o tran/instrsaxall.o $(CFLAGS) + +tran/instrsaxfreq.o: tran/instrsaxfreq.c tran/instrsaxfreq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrsaxfreq.c -o tran/instrsaxfreq.o $(CFLAGS) + +tran/integrate.o: tran/integrate.c tran/integrate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/integrate.c -o tran/integrate.o $(CFLAGS) + +tran/log.o: tran/log.c tran/log.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/log.c -o tran/log.o $(CFLAGS) + +tran/lpreson.o: tran/lpreson.c tran/lpreson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/lpreson.c -o tran/lpreson.o $(CFLAGS) + +tran/maxv.o: tran/maxv.c tran/maxv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/maxv.c -o tran/maxv.o $(CFLAGS) + +tran/offset.o: tran/offset.c tran/offset.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/offset.c -o tran/offset.o $(CFLAGS) + +tran/oneshot.o: tran/oneshot.c tran/oneshot.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/oneshot.c -o tran/oneshot.o $(CFLAGS) + +tran/osc.o: tran/osc.c tran/osc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/osc.c -o tran/osc.o $(CFLAGS) + +tran/partial.o: tran/partial.c tran/partial.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/partial.c -o tran/partial.o $(CFLAGS) + +tran/pluck.o: tran/pluck.c tran/pluck.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/pluck.c -o tran/pluck.o $(CFLAGS) + +tran/prod.o: tran/prod.c tran/prod.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/prod.c -o tran/prod.o $(CFLAGS) + +tran/pwl.o: tran/pwl.c tran/pwl.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/pwl.c -o tran/pwl.o $(CFLAGS) + +tran/quantize.o: tran/quantize.c tran/quantize.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/quantize.c -o tran/quantize.o $(CFLAGS) + +tran/recip.o: tran/recip.c tran/recip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/recip.c -o tran/recip.o $(CFLAGS) + +tran/reson.o: tran/reson.c tran/reson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/reson.c -o tran/reson.o $(CFLAGS) + +tran/resonvc.o: tran/resonvc.c tran/resonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/resonvc.c -o tran/resonvc.o $(CFLAGS) + +tran/resoncv.o: tran/resoncv.c tran/resoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/resoncv.c -o tran/resoncv.o $(CFLAGS) + +tran/resonvv.o: tran/resonvv.c tran/resonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/resonvv.c -o tran/resonvv.o $(CFLAGS) + +tran/sampler.o: tran/sampler.c tran/sampler.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/sampler.c -o tran/sampler.o $(CFLAGS) + +tran/scale.o: tran/scale.c tran/scale.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/scale.c -o tran/scale.o $(CFLAGS) + +tran/shape.o: tran/shape.c tran/shape.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/shape.c -o tran/shape.o $(CFLAGS) + +tran/sine.o: tran/sine.c tran/sine.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/sine.c -o tran/sine.o $(CFLAGS) + +tran/siosc.o: tran/siosc.c tran/siosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/siosc.c -o tran/siosc.o $(CFLAGS) + +tran/slope.o: tran/slope.c tran/slope.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/slope.c -o tran/slope.o $(CFLAGS) + +tran/sqrt.o: tran/sqrt.c tran/sqrt.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/sqrt.c -o tran/sqrt.o $(CFLAGS) + +tran/tapf.o: tran/tapf.c tran/tapf.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/tapf.c -o tran/tapf.o $(CFLAGS) + +tran/tapv.o: tran/tapv.c tran/tapv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/tapv.c -o tran/tapv.o $(CFLAGS) + +tran/tone.o: tran/tone.c tran/tone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/tone.c -o tran/tone.o $(CFLAGS) + +tran/tonev.o: tran/tonev.c tran/tonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/tonev.c -o tran/tonev.o $(CFLAGS) + +tran/upsample.o: tran/upsample.c tran/upsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/upsample.c -o tran/upsample.o $(CFLAGS) + +tran/white.o: tran/white.c tran/white.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/white.c -o tran/white.o $(CFLAGS) + +tran/stkrev.o: tran/stkrev.c tran/stkrev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/stkrev.c -o tran/stkrev.o $(CFLAGS) + +tran/stkpitshift.o: tran/stkpitshift.c tran/stkpitshift.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/stkpitshift.c -o tran/stkpitshift.o $(CFLAGS) + +tran/stkchorus.o: tran/stkchorus.c tran/stkchorus.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/stkchorus.c -o tran/stkchorus.o $(CFLAGS) + +tran/instrbow.o: tran/instrbow.c tran/instrbow.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrbow.c -o tran/instrbow.o $(CFLAGS) + +tran/instrbowedfreq.o: tran/instrbowedfreq.c tran/instrbowedfreq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrbowedfreq.c -o tran/instrbowedfreq.o $(CFLAGS) + +tran/instrbanded.o: tran/instrbanded.c tran/instrbanded.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrbanded.c -o tran/instrbanded.o $(CFLAGS) + +tran/instrmandolin.o: tran/instrmandolin.c tran/instrmandolin.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrmandolin.c -o tran/instrmandolin.o $(CFLAGS) + +tran/instrsitar.o: tran/instrsitar.c tran/instrsitar.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrsitar.c -o tran/instrsitar.o $(CFLAGS) + +tran/instrmodalbar.o: tran/instrmodalbar.c tran/instrmodalbar.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrmodalbar.c -o tran/instrmodalbar.o $(CFLAGS) + +tran/instrflute.o: tran/instrflute.c tran/instrflute.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrflute.c -o tran/instrflute.o $(CFLAGS) + +tran/instrflutefreq.o: tran/instrflutefreq.c tran/instrflutefreq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrflutefreq.c -o tran/instrflutefreq.o $(CFLAGS) + +tran/instrfluteall.o: tran/instrfluteall.c tran/instrfluteall.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/instrfluteall.c -o tran/instrfluteall.o $(CFLAGS) + +tran/fmfb.o: tran/fmfb.c tran/fmfb.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/fmfb.c -o tran/fmfb.o $(CFLAGS) + +tran/fmfbv.o: tran/fmfbv.c tran/fmfbv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + $(CC) -c tran/fmfbv.c -o tran/fmfbv.o $(CFLAGS) + +nyqsrc/sndfnint.o: nyqsrc/sndfnint.c + $(CC) -c nyqsrc/sndfnint.c -o nyqsrc/sndfnint.o $(CFLAGS) + +nyqsrc/seqfnint.o: nyqsrc/seqfnint.c + $(CC) -c nyqsrc/seqfnint.c -o nyqsrc/seqfnint.o $(CFLAGS) + +nyqstk/stkinit.o: nyqstk/stkinit.cpp nyqstk/stkinit.h + g++ -c nyqstk/stkinit.cpp -o nyqstk/stkinit.o $(CFLAGS) + +nyqstk/instr.o: nyqstk/instr.cpp nyqstk/instr.h + g++ -c nyqstk/instr.cpp -o nyqstk/instr.o $(CFLAGS) + +nyqstk/stkint.o: nyqstk/stkint.cpp nyqstk/stkint.h + g++ -c nyqstk/stkint.cpp -o nyqstk/stkint.o $(CFLAGS) + +nyqstk/src/Generator.o: nyqstk/src/Generator.cpp nyqstk/include/Generator.h + g++ -c nyqstk/src/Generator.cpp -o nyqstk/src/Generator.o $(CFLAGS) + +nyqstk/src/SineWave.o: nyqstk/src/SineWave.cpp nyqstk/include/SineWave.h + g++ -c nyqstk/src/SineWave.cpp -o nyqstk/src/SineWave.o $(CFLAGS) + +nyqstk/src/Function.o: nyqstk/src/Function.cpp nyqstk/include/Function.h + g++ -c nyqstk/src/Function.cpp -o nyqstk/src/Function.o $(CFLAGS) + +nyqstk/src/FileRead.o: nyqstk/src/FileRead.cpp nyqstk/include/FileRead.h + g++ -c nyqstk/src/FileRead.cpp -o nyqstk/src/FileRead.o $(CFLAGS) + +nyqstk/src/FileWvIn.o: nyqstk/src/FileWvIn.cpp nyqstk/include/FileWvIn.h + g++ -c nyqstk/src/FileWvIn.cpp -o nyqstk/src/FileWvIn.o $(CFLAGS) + +nyqstk/src/Effect.o: nyqstk/src/Effect.cpp nyqstk/include/Effect.h + g++ -c nyqstk/src/Effect.cpp -o nyqstk/src/Effect.o $(CFLAGS) + +nyqstk/src/Clarinet.o: nyqstk/src/Clarinet.cpp nyqstk/include/Clarinet.h + g++ -c nyqstk/src/Clarinet.cpp -o nyqstk/src/Clarinet.o $(CFLAGS) + +nyqstk/src/Delay.o: nyqstk/src/Delay.cpp nyqstk/include/Delay.h + g++ -c nyqstk/src/Delay.cpp -o nyqstk/src/Delay.o $(CFLAGS) + +nyqstk/src/DelayL.o: nyqstk/src/DelayL.cpp nyqstk/include/DelayL.h + g++ -c nyqstk/src/DelayL.cpp -o nyqstk/src/DelayL.o $(CFLAGS) + +nyqstk/src/Envelope.o: nyqstk/src/Envelope.cpp nyqstk/include/Envelope.h + g++ -c nyqstk/src/Envelope.cpp -o nyqstk/src/Envelope.o $(CFLAGS) + +nyqstk/src/Filter.o: nyqstk/src/Filter.cpp nyqstk/include/Filter.h + g++ -c nyqstk/src/Filter.cpp -o nyqstk/src/Filter.o $(CFLAGS) + +nyqstk/src/Instrmnt.o: nyqstk/src/Instrmnt.cpp nyqstk/include/Instrmnt.h + g++ -c nyqstk/src/Instrmnt.cpp -o nyqstk/src/Instrmnt.o $(CFLAGS) + +nyqstk/src/Noise.o: nyqstk/src/Noise.cpp nyqstk/include/Noise.h + g++ -c nyqstk/src/Noise.cpp -o nyqstk/src/Noise.o $(CFLAGS) + +nyqstk/src/OneZero.o: nyqstk/src/OneZero.cpp nyqstk/include/OneZero.h + g++ -c nyqstk/src/OneZero.cpp -o nyqstk/src/OneZero.o $(CFLAGS) + +nyqstk/src/ReedTable.o: nyqstk/src/ReedTable.cpp nyqstk/include/ReedTable.h + g++ -c nyqstk/src/ReedTable.cpp -o nyqstk/src/ReedTable.o $(CFLAGS) + +nyqstk/src/Saxofony.o: nyqstk/src/Saxofony.cpp nyqstk/include/Saxofony.h + g++ -c nyqstk/src/Saxofony.cpp -o nyqstk/src/Saxofony.o $(CFLAGS) + +nyqstk/src/Stk.o: nyqstk/src/Stk.cpp nyqstk/include/Stk.h + g++ -c nyqstk/src/Stk.cpp -o nyqstk/src/Stk.o $(CFLAGS) + +nyqstk/src/WaveLoop.o: nyqstk/src/WaveLoop.cpp nyqstk/include/WaveLoop.h + g++ -c nyqstk/src/WaveLoop.cpp -o nyqstk/src/WaveLoop.o $(CFLAGS) + +nyqstk/src/WvIn.o: nyqstk/src/WvIn.cpp nyqstk/include/WvIn.h + g++ -c nyqstk/src/WvIn.cpp -o nyqstk/src/WvIn.o $(CFLAGS) + +nyqstk/src/NRev.o: nyqstk/src/NRev.cpp nyqstk/include/NRev.h + g++ -c nyqstk/src/NRev.cpp -o nyqstk/src/NRev.o $(CFLAGS) + +nyqstk/src/JCRev.o: nyqstk/src/JCRev.cpp nyqstk/include/JCRev.h + g++ -c nyqstk/src/JCRev.cpp -o nyqstk/src/JCRev.o $(CFLAGS) + +nyqstk/src/PRCRev.o: nyqstk/src/PRCRev.cpp nyqstk/include/PRCRev.h + g++ -c nyqstk/src/PRCRev.cpp -o nyqstk/src/PRCRev.o $(CFLAGS) + +nyqstk/src/PitShift.o: nyqstk/src/PitShift.cpp nyqstk/include/PitShift.h + g++ -c nyqstk/src/PitShift.cpp -o nyqstk/src/PitShift.o $(CFLAGS) + +nyqstk/src/Chorus.o: nyqstk/src/Chorus.cpp nyqstk/include/Chorus.h + g++ -c nyqstk/src/Chorus.cpp -o nyqstk/src/Chorus.o $(CFLAGS) + +nyqstk/src/Bowed.o: nyqstk/src/Bowed.cpp nyqstk/include/Bowed.h + g++ -c nyqstk/src/Bowed.cpp -o nyqstk/src/Bowed.o $(CFLAGS) + +nyqstk/src/BowTable.o: nyqstk/src/BowTable.cpp nyqstk/include/BowTable.h + g++ -c nyqstk/src/BowTable.cpp -o nyqstk/src/BowTable.o $(CFLAGS) + +nyqstk/src/ADSR.o: nyqstk/src/ADSR.cpp nyqstk/include/ADSR.h + g++ -c nyqstk/src/ADSR.cpp -o nyqstk/src/ADSR.o $(CFLAGS) + +nyqstk/src/OnePole.o: nyqstk/src/OnePole.cpp nyqstk/include/OnePole.h + g++ -c nyqstk/src/OnePole.cpp -o nyqstk/src/OnePole.o $(CFLAGS) + +nyqstk/src/BiQuad.o: nyqstk/src/BiQuad.cpp nyqstk/include/BiQuad.h + g++ -c nyqstk/src/BiQuad.cpp -o nyqstk/src/BiQuad.o $(CFLAGS) + +nyqstk/src/BandedWG.o: nyqstk/src/BandedWG.cpp nyqstk/include/BandedWG.h + g++ -c nyqstk/src/BandedWG.cpp -o nyqstk/src/BandedWG.o $(CFLAGS) + +nyqstk/src/DelayA.o: nyqstk/src/DelayA.cpp nyqstk/include/DelayA.h + g++ -c nyqstk/src/DelayA.cpp -o nyqstk/src/DelayA.o $(CFLAGS) + +nyqstk/src/Mandolin.o: nyqstk/src/Mandolin.cpp nyqstk/include/Mandolin.h + g++ -c nyqstk/src/Mandolin.cpp -o nyqstk/src/Mandolin.o $(CFLAGS) + +nyqstk/src/PluckTwo.o: nyqstk/src/PluckTwo.cpp nyqstk/include/PluckTwo.h + g++ -c nyqstk/src/PluckTwo.cpp -o nyqstk/src/PluckTwo.o $(CFLAGS) + +nyqstk/src/Sitar.o: nyqstk/src/Sitar.cpp nyqstk/include/Sitar.h + g++ -c nyqstk/src/Sitar.cpp -o nyqstk/src/Sitar.o $(CFLAGS) + +nyqstk/src/ModalBar.o: nyqstk/src/ModalBar.cpp nyqstk/include/ModalBar.h + g++ -c nyqstk/src/ModalBar.cpp -o nyqstk/src/ModalBar.o $(CFLAGS) + +nyqstk/src/Modal.o: nyqstk/src/Modal.cpp nyqstk/include/Modal.h + g++ -c nyqstk/src/Modal.cpp -o nyqstk/src/Modal.o $(CFLAGS) + +nyqstk/src/Flute.o: nyqstk/src/Flute.cpp nyqstk/include/Flute.h + g++ -c nyqstk/src/Flute.cpp -o nyqstk/src/Flute.o $(CFLAGS) + +nyqstk/src/JetTable.o: nyqstk/src/JetTable.cpp nyqstk/include/JetTable.h + g++ -c nyqstk/src/JetTable.cpp -o nyqstk/src/JetTable.o $(CFLAGS) + +nyqstk/src/PoleZero.o: nyqstk/src/PoleZero.cpp nyqstk/include/PoleZero.h + g++ -c nyqstk/src/PoleZero.cpp -o nyqstk/src/PoleZero.o $(CFLAGS) + +xlisp/xlftab.o: nyqsrc/sndfnintptrs.h nyqsrc/sndfnintdefs.h nyqsrc/seqfnintptrs.h nyqsrc/seqfnintdefs.h + $(CC) -c xlisp/xlftab.c -o xlisp/xlftab.o $(CFLAGS) + +xlisp/extern.o: xlisp/extern.c + $(CC) -c xlisp/extern.c -o xlisp/extern.o $(CFLAGS) + +xlisp/xldmem.o: xlisp/xldmem.c + $(CC) -c xlisp/xldmem.c -o xlisp/xldmem.o $(CFLAGS) + +xlisp/xlbfun.o: xlisp/xlbfun.c + $(CC) -c xlisp/xlbfun.c -o xlisp/xlbfun.o $(CFLAGS) + +xlisp/xlcont.o: xlisp/xlcont.c + $(CC) -c xlisp/xlcont.c -o xlisp/xlcont.o $(CFLAGS) + +xlisp/xldbug.o: xlisp/xldbug.c + $(CC) -c xlisp/xldbug.c -o xlisp/xldbug.o $(CFLAGS) + +xlisp/xleval.o: xlisp/xleval.c + $(CC) -c xlisp/xleval.c -o xlisp/xleval.o $(CFLAGS) + +xlisp/xlfio.o: xlisp/xlfio.c + $(CC) -c xlisp/xlfio.c -o xlisp/xlfio.o $(CFLAGS) + +xlisp/xlglob.o: xlisp/xlglob.c + $(CC) -c xlisp/xlglob.c -o xlisp/xlglob.o $(CFLAGS) + +xlisp/xlimage.o: xlisp/xlimage.c + $(CC) -c xlisp/xlimage.c -o xlisp/xlimage.o $(CFLAGS) + +xlisp/xlinit.o: xlisp/xlinit.c + $(CC) -c xlisp/xlinit.c -o xlisp/xlinit.o $(CFLAGS) + +xlisp/xlio.o: xlisp/xlio.c + $(CC) -c xlisp/xlio.c -o xlisp/xlio.o $(CFLAGS) + +xlisp/xlisp.o: xlisp/xlisp.c + $(CC) -c xlisp/xlisp.c -o xlisp/xlisp.o $(CFLAGS) + +xlisp/xljump.o: xlisp/xljump.c + $(CC) -c xlisp/xljump.c -o xlisp/xljump.o $(CFLAGS) + +xlisp/xllist.o: xlisp/xllist.c + $(CC) -c xlisp/xllist.c -o xlisp/xllist.o $(CFLAGS) + +xlisp/xlmath.o: xlisp/xlmath.c + $(CC) -c xlisp/xlmath.c -o xlisp/xlmath.o $(CFLAGS) + +xlisp/xlobj.o: xlisp/xlobj.c + $(CC) -c xlisp/xlobj.c -o xlisp/xlobj.o $(CFLAGS) + +xlisp/xlpp.o: xlisp/xlpp.c + $(CC) -c xlisp/xlpp.c -o xlisp/xlpp.o $(CFLAGS) + +xlisp/xlprin.o: xlisp/xlprin.c + $(CC) -c xlisp/xlprin.c -o xlisp/xlprin.o $(CFLAGS) + +xlisp/xlread.o: xlisp/xlread.c + $(CC) -c xlisp/xlread.c -o xlisp/xlread.o $(CFLAGS) + +xlisp/xlstr.o: xlisp/xlstr.c + $(CC) -c xlisp/xlstr.c -o xlisp/xlstr.o $(CFLAGS) + +xlisp/xlsubr.o: xlisp/xlsubr.c + $(CC) -c xlisp/xlsubr.c -o xlisp/xlsubr.o $(CFLAGS) + +xlisp/xlsym.o: xlisp/xlsym.c + $(CC) -c xlisp/xlsym.c -o xlisp/xlsym.o $(CFLAGS) + +xlisp/xlsys.o: xlisp/xlsys.c + $(CC) -c xlisp/xlsys.c -o xlisp/xlsys.o $(CFLAGS) + +xlisp/path.o: xlisp/path.c + $(CC) -c xlisp/path.c -o xlisp/path.o $(CFLAGS) + +cmt/cext.o: cmt/cext.c + $(CC) -c cmt/cext.c -o cmt/cext.o $(CFLAGS) + +cmt/cleanup.o: cmt/cleanup.c + $(CC) -c cmt/cleanup.c -o cmt/cleanup.o $(CFLAGS) + +cmt/cmdline.o: cmt/cmdline.c + $(CC) -c cmt/cmdline.c -o cmt/cmdline.o $(CFLAGS) + +cmt/cmtcmd.o: cmt/cmtcmd.c + $(CC) -c cmt/cmtcmd.c -o cmt/cmtcmd.o $(CFLAGS) + +cmt/moxc.o: cmt/moxc.c + $(CC) -c cmt/moxc.c -o cmt/moxc.o $(CFLAGS) + +cmt/mem.o: cmt/mem.c + $(CC) -c cmt/mem.c -o cmt/mem.o $(CFLAGS) + +cmt/midifile.o: cmt/midifile.c + $(CC) -c cmt/midifile.c -o cmt/midifile.o $(CFLAGS) + +cmt/midifns.o: cmt/midifns.c + $(CC) -c cmt/midifns.c -o cmt/midifns.o $(CFLAGS) + +cmt/record.o: cmt/record.c + $(CC) -c cmt/record.c -o cmt/record.o $(CFLAGS) + +cmt/seq.o: cmt/seq.c + $(CC) -c cmt/seq.c -o cmt/seq.o $(CFLAGS) + +cmt/seqmread.o: cmt/seqmread.c + $(CC) -c cmt/seqmread.c -o cmt/seqmread.o $(CFLAGS) + +cmt/seqmwrite.o: cmt/seqmwrite.c + $(CC) -c cmt/seqmwrite.c -o cmt/seqmwrite.o $(CFLAGS) + +cmt/seqread.o: cmt/seqread.c + $(CC) -c cmt/seqread.c -o cmt/seqread.o $(CFLAGS) + +cmt/seqwrite.o: cmt/seqwrite.c + $(CC) -c cmt/seqwrite.c -o cmt/seqwrite.o $(CFLAGS) + +cmt/tempomap.o: cmt/tempomap.c + $(CC) -c cmt/tempomap.c -o cmt/tempomap.o $(CFLAGS) + +cmt/timebase.o: cmt/timebase.c + $(CC) -c cmt/timebase.c -o cmt/timebase.o $(CFLAGS) + +cmt/userio.o: cmt/userio.c + $(CC) -c cmt/userio.c -o cmt/userio.o $(CFLAGS) + +nylsf/aiff.o: nylsf/aiff.c + $(CC) -c nylsf/aiff.c -o nylsf/aiff.o $(CFLAGS) + +nylsf/alaw.o: nylsf/alaw.c + $(CC) -c nylsf/alaw.c -o nylsf/alaw.o $(CFLAGS) + +nylsf/au.o: nylsf/au.c + $(CC) -c nylsf/au.c -o nylsf/au.o $(CFLAGS) + +nylsf/avr.o: nylsf/avr.c + $(CC) -c nylsf/avr.c -o nylsf/avr.o $(CFLAGS) + +nylsf/broadcast.o: nylsf/broadcast.c + $(CC) -c nylsf/broadcast.c -o nylsf/broadcast.o $(CFLAGS) + +nylsf/caf.o: nylsf/caf.c + $(CC) -c nylsf/caf.c -o nylsf/caf.o $(CFLAGS) + +nylsf/command.o: nylsf/command.c + $(CC) -c nylsf/command.c -o nylsf/command.o $(CFLAGS) + +nylsf/common.o: nylsf/common.c + $(CC) -c nylsf/common.c -o nylsf/common.o $(CFLAGS) + +nylsf/dither.o: nylsf/dither.c + $(CC) -c nylsf/dither.c -o nylsf/dither.o $(CFLAGS) + +nylsf/double64.o: nylsf/double64.c + $(CC) -c nylsf/double64.c -o nylsf/double64.o $(CFLAGS) + +nylsf/dwd.o: nylsf/dwd.c + $(CC) -c nylsf/dwd.c -o nylsf/dwd.o $(CFLAGS) + +nylsf/dwvw.o: nylsf/dwvw.c + $(CC) -c nylsf/dwvw.c -o nylsf/dwvw.o $(CFLAGS) + +nylsf/file_io.o: nylsf/file_io.c + $(CC) -c nylsf/file_io.c -o nylsf/file_io.o $(CFLAGS) + +nylsf/flac.o: nylsf/flac.c + $(CC) -c nylsf/flac.c -o nylsf/flac.o $(CFLAGS) + +nylsf/float32.o: nylsf/float32.c + $(CC) -c nylsf/float32.c -o nylsf/float32.o $(CFLAGS) + +nylsf/gsm610.o: nylsf/gsm610.c + $(CC) -c nylsf/gsm610.c -o nylsf/gsm610.o $(CFLAGS) + +nylsf/htk.o: nylsf/htk.c + $(CC) -c nylsf/htk.c -o nylsf/htk.o $(CFLAGS) + +nylsf/ima_adpcm.o: nylsf/ima_adpcm.c + $(CC) -c nylsf/ima_adpcm.c -o nylsf/ima_adpcm.o $(CFLAGS) + +nylsf/interleave.o: nylsf/interleave.c + $(CC) -c nylsf/interleave.c -o nylsf/interleave.o $(CFLAGS) + +nylsf/ircam.o: nylsf/ircam.c + $(CC) -c nylsf/ircam.c -o nylsf/ircam.o $(CFLAGS) + +nylsf/macbinary3.o: nylsf/macbinary3.c + $(CC) -c nylsf/macbinary3.c -o nylsf/macbinary3.o $(CFLAGS) + +nylsf/macos.o: nylsf/macos.c + $(CC) -c nylsf/macos.c -o nylsf/macos.o $(CFLAGS) + +nylsf/mat4.o: nylsf/mat4.c + $(CC) -c nylsf/mat4.c -o nylsf/mat4.o $(CFLAGS) + +nylsf/mat5.o: nylsf/mat5.c + $(CC) -c nylsf/mat5.c -o nylsf/mat5.o $(CFLAGS) + +nylsf/ms_adpcm.o: nylsf/ms_adpcm.c + $(CC) -c nylsf/ms_adpcm.c -o nylsf/ms_adpcm.o $(CFLAGS) + +nylsf/nist.o: nylsf/nist.c + $(CC) -c nylsf/nist.c -o nylsf/nist.o $(CFLAGS) + +nylsf/ogg.o: nylsf/ogg.c + $(CC) -c nylsf/ogg.c -o nylsf/ogg.o $(CFLAGS) + +nylsf/paf.o: nylsf/paf.c + $(CC) -c nylsf/paf.c -o nylsf/paf.o $(CFLAGS) + +nylsf/pcm.o: nylsf/pcm.c + $(CC) -c nylsf/pcm.c -o nylsf/pcm.o $(CFLAGS) + +nylsf/pvf.o: nylsf/pvf.c + $(CC) -c nylsf/pvf.c -o nylsf/pvf.o $(CFLAGS) + +nylsf/raw.o: nylsf/raw.c + $(CC) -c nylsf/raw.c -o nylsf/raw.o $(CFLAGS) + +nylsf/rx2.o: nylsf/rx2.c + $(CC) -c nylsf/rx2.c -o nylsf/rx2.o $(CFLAGS) + +nylsf/sd2.o: nylsf/sd2.c + $(CC) -c nylsf/sd2.c -o nylsf/sd2.o $(CFLAGS) + +nylsf/sds.o: nylsf/sds.c + $(CC) -c nylsf/sds.c -o nylsf/sds.o $(CFLAGS) + +nylsf/sndfile.o: nylsf/sndfile.c + $(CC) -c nylsf/sndfile.c -o nylsf/sndfile.o $(CFLAGS) + +nylsf/strings.o: nylsf/strings.c + $(CC) -c nylsf/strings.c -o nylsf/strings.o $(CFLAGS) + +nylsf/svx.o: nylsf/svx.c + $(CC) -c nylsf/svx.c -o nylsf/svx.o $(CFLAGS) + +nylsf/txw.o: nylsf/txw.c + $(CC) -c nylsf/txw.c -o nylsf/txw.o $(CFLAGS) + +nylsf/ulaw.o: nylsf/ulaw.c + $(CC) -c nylsf/ulaw.c -o nylsf/ulaw.o $(CFLAGS) + +nylsf/voc.o: nylsf/voc.c + $(CC) -c nylsf/voc.c -o nylsf/voc.o $(CFLAGS) + +nylsf/vox_adpcm.o: nylsf/vox_adpcm.c + $(CC) -c nylsf/vox_adpcm.c -o nylsf/vox_adpcm.o $(CFLAGS) + +nylsf/w64.o: nylsf/w64.c + $(CC) -c nylsf/w64.c -o nylsf/w64.o $(CFLAGS) + +nylsf/wav.o: nylsf/wav.c + $(CC) -c nylsf/wav.c -o nylsf/wav.o $(CFLAGS) + +nylsf/wav_w64.o: nylsf/wav_w64.c + $(CC) -c nylsf/wav_w64.c -o nylsf/wav_w64.o $(CFLAGS) + +nylsf/wve.o: nylsf/wve.c + $(CC) -c nylsf/wve.c -o nylsf/wve.o $(CFLAGS) + +nylsf/xi.o: nylsf/xi.c + $(CC) -c nylsf/xi.c -o nylsf/xi.o $(CFLAGS) + +nylsf/g72x.o: nylsf/g72x.c + $(CC) -c nylsf/g72x.c -o nylsf/g72x.o $(CFLAGS) + +nylsf/GSM610/add.o: nylsf/GSM610/add.c + $(CC) -c nylsf/GSM610/add.c -o nylsf/GSM610/add.o $(CFLAGS) + +nylsf/GSM610/code.o: nylsf/GSM610/code.c + $(CC) -c nylsf/GSM610/code.c -o nylsf/GSM610/code.o $(CFLAGS) + +nylsf/GSM610/decode.o: nylsf/GSM610/decode.c + $(CC) -c nylsf/GSM610/decode.c -o nylsf/GSM610/decode.o $(CFLAGS) + +nylsf/GSM610/gsm_create.o: nylsf/GSM610/gsm_create.c + $(CC) -c nylsf/GSM610/gsm_create.c -o nylsf/GSM610/gsm_create.o $(CFLAGS) + +nylsf/GSM610/gsm_decode.o: nylsf/GSM610/gsm_decode.c + $(CC) -c nylsf/GSM610/gsm_decode.c -o nylsf/GSM610/gsm_decode.o $(CFLAGS) + +nylsf/GSM610/gsm_destroy.o: nylsf/GSM610/gsm_destroy.c + $(CC) -c nylsf/GSM610/gsm_destroy.c -o nylsf/GSM610/gsm_destroy.o $(CFLAGS) + +nylsf/GSM610/gsm_encode.o: nylsf/GSM610/gsm_encode.c + $(CC) -c nylsf/GSM610/gsm_encode.c -o nylsf/GSM610/gsm_encode.o $(CFLAGS) + +nylsf/GSM610/gsm_option.o: nylsf/GSM610/gsm_option.c + $(CC) -c nylsf/GSM610/gsm_option.c -o nylsf/GSM610/gsm_option.o $(CFLAGS) + +nylsf/GSM610/long_term.o: nylsf/GSM610/long_term.c + $(CC) -c nylsf/GSM610/long_term.c -o nylsf/GSM610/long_term.o $(CFLAGS) + +nylsf/GSM610/lpc.o: nylsf/GSM610/lpc.c + $(CC) -c nylsf/GSM610/lpc.c -o nylsf/GSM610/lpc.o $(CFLAGS) + +nylsf/GSM610/preprocess.o: nylsf/GSM610/preprocess.c + $(CC) -c nylsf/GSM610/preprocess.c -o nylsf/GSM610/preprocess.o $(CFLAGS) + +nylsf/GSM610/rpe.o: nylsf/GSM610/rpe.c + $(CC) -c nylsf/GSM610/rpe.c -o nylsf/GSM610/rpe.o $(CFLAGS) + +nylsf/GSM610/short_term.o: nylsf/GSM610/short_term.c + $(CC) -c nylsf/GSM610/short_term.c -o nylsf/GSM610/short_term.o $(CFLAGS) + +nylsf/GSM610/table.o: nylsf/GSM610/table.c + $(CC) -c nylsf/GSM610/table.c -o nylsf/GSM610/table.o $(CFLAGS) + +nylsf/G72x/g721.o: nylsf/G72x/g721.c + $(CC) -c nylsf/G72x/g721.c -o nylsf/G72x/g721.o $(CFLAGS) + +nylsf/G72x/g723_16.o: nylsf/G72x/g723_16.c + $(CC) -c nylsf/G72x/g723_16.c -o nylsf/G72x/g723_16.o $(CFLAGS) + +nylsf/G72x/g723_24.o: nylsf/G72x/g723_24.c + $(CC) -c nylsf/G72x/g723_24.c -o nylsf/G72x/g723_24.o $(CFLAGS) + +nylsf/G72x/g723_40.o: nylsf/G72x/g723_40.c + $(CC) -c nylsf/G72x/g723_40.c -o nylsf/G72x/g723_40.o $(CFLAGS) + +nylsf/G72x/g72x.o: nylsf/G72x/g72x.c + $(CC) -c nylsf/G72x/g72x.c -o nylsf/G72x/g72x.o $(CFLAGS) + +sys/unix/osstuff.o: sys/unix/osstuff.c + $(CC) -c sys/unix/osstuff.c -o sys/unix/osstuff.o $(CFLAGS) + +misc/intgen: misc/intgen.c + cd misc; make intgen + +misc/unpacker: misc/unpacker.c misc/convert.c + cd misc; make unpacker + +misc/packer: misc/packer.c misc/convert.c + cd misc; make packer + +nyqsrc/sndfnintptrs.h: $(NYQHDRS) misc/intgen + $(INTGEN) nyqsrc/sndfnint $(NYQHDRS) + +nyqsrc/seqfnintptrs.h: $(CMTHDRS) misc/intgen + $(INTGEN) nyqsrc/seqfnint $(CMTHDRS) + +clean: + cd misc; make clean + cd liblo; test -f Makefile && make clean || true + cd portaudio; test -f Makefile && make clean || true + rm -f $(OBJECTS) +# These could be deleted, but they're part of the release, so we won't +# Note that these files are machine-generated: +# rm -f nyqsrc/sndfnintptrs.h nyqsrc/sndfnint.c nyqsrc/sndfnintdefs.h +# rm -f nyqsrc/seqfnintptrs.h nyqsrc/seqfnint.c nyqsrc/seqfnintdefs.h + +cleaner: clean + cd misc; make cleaner + rm -f *.backup */*.backup + rm -f *~ */*.*~ + rm -f #*# */#*# + rm -f *.save */*.save + rm -f *.CKP */*.CKP + rm -f *.BAK */*.BAK + rm -f *.old */*.old + rm -f *.gold */*.gold + rm -f playparms + rm -f points.dat + rm -f core.* core + rm -f $(NY) + +release: cleaner + cd misc; make packer + misc/packer files.txt release.pac + rm -f *.wav + mv ny .. + mv -f *.pac .. + rm -f unpacker + rm -f packer + cd ..; zip -r nyquist.zip nyquist + ../ny misc/cmu/cmu-linux-install.lsp + mv ../ny ./ny diff --git a/sys/unix/nonalsa/system.lsp b/sys/unix/nonalsa/system.lsp new file mode 100644 index 0000000..3923bc8 --- /dev/null +++ b/sys/unix/nonalsa/system.lsp @@ -0,0 +1,101 @@ +;; system.lsp -- system-dependent lisp code + +; local definition for play +; this one is for Linux: + +(if (not (boundp '*default-sf-format*)) + (setf *default-sf-format* snd-head-wave)) + +(if (not (boundp '*default-sound-file*)) + (compute-default-sound-file)) + +(if (not (boundp '*default-sf-dir*)) + (setf *default-sf-dir* "./")) + +(if (not (boundp '*default-sf-mode*)) + (setf *default-sf-mode* snd-mode-pcm)) + +(if (not (boundp '*default-sf-bits*)) + (setf *default-sf-bits* 16)) + +(if (not (boundp '*default-plot-file*)) + (setf *default-plot-file* (strcat (get-user) "-points.dat"))) + + +; FULL-NAME-P -- test if file name is a full path or relative path +; +; (otherwise the *default-sf-dir* will be prepended +; +(defun full-name-p (filename) + (or (eq (char filename 0) #\/) + (eq (char filename 0) #\.))) + +; RELATIVE-PATH-P -- test if filename or path is a relative path +; +(defun relative-path-p (filename) + (not (eq (char filename 0) #\/))) + +(setf *file-separator* #\/) + + +;; PLAY-FILE - play a sound file +;; +(defun play-file (name) +;; +;; WARNING: if you invoke an external program to play files, +;; but Nyquist uses internal (portaudio) interface to +;; play synthesized sound, Nyquist may fail to open the +;; sound device while it is playing a sound file and then +;; refuse to play anything. -RBD dec05 +;; (system (strcat "sndplay " (soundfilename name)))) +;; (system (strcat "play " (soundfilename name) ))) +;; + (play (s-read (soundfilename name)))) + +;; R - replay last file written with PLAY +(defun r () (play-file *default-sound-file*)) + +;;;; use this old version if you want to use sndplay to play +;;;; the result file rather than play the samples as they +;;;; are computed. This version does not autonormalize. +;; PLAY - write value of an expression to file and play it +;; +;(defmacro play (expr) +; `(prog (specs) +; (setf specs (s-save (force-srate *sound-srate* ,expr) +; 1000000000 *default-sound-file*)) +; (r))) +;;;; + +; local definition for play +(defmacro play (expr) + `(s-save-autonorm ,expr NY:ALL *default-sound-file* :play *soundenable*)) + +;; for Linux, modify s-plot (defined in nyquist.lsp) by saving s-plot +;; in standard-s-plot, then call gnuplot to display the points. +;; +;; we also need to save the location of this file so we can find +;; nyquist-plot.txt, the command file for gnuplot +;; +;; This code is broken in the following ways: +;; it tries to run gnuplot even when plotting can be done by NyquistIDE +;; it plots "points.dat", but "points.dat" may not be correct +;; (see *default-plot-file*) +;; it assumes the plot file is in the current directory, but it +;; by default goes to the sound file directory +;; +;; Fix this code or complain if you want to plot with gnuplot while +;; running ny (or even NyquistIDE (jny) if you want). Otherwise, use +;; NyquistIDE to get s-plot to work. +;; +;(setf *runtime-path* (current-path)) +;(display "system.lsp" *runtime-path*) +; +;(setfn standard-s-plot s-plot) +; +;(defun s-plot (s &optional (dur 2.0) (n 1000)) +; (let (plot-file) +; (standard-s-plot s dur n) ;; this calculates the data points +; (setf plot-file (strcat *runtime-path* "nyquist-plot.txt")) +; (system (strcat "gnuplot -persist " plot-file)))) + diff --git a/sys/unix/osstuff.c b/sys/unix/osstuff.c new file mode 100644 index 0000000..e2d283f --- /dev/null +++ b/sys/unix/osstuff.c @@ -0,0 +1,804 @@ +/* unixtuff.c - unix interface routines for xlisp + + * HISTORY + * 5-Mar-07 Dannenberg + * worked on hidden_msg() and hidden message handling + * + * 23-Dec-05 Dannenberg + * still more hacks: Mac and Linux don't disable character echo like + * windows does using a pipe to an IDE. To make UNIX versions match + * the Windows behavior (which is preferable), added + * echo_enabled flag and a function to set/clear it from XLisp. + * This will give unix-specific behavior to compensate for the + * unix-specific character echo. This worked, but printed + * (echoenabled nil) on the console, which was pretty ugly, so I + * added ctrl-e and ctrl-f handlers to turn echo on and off. Now + * Java can just send ctrl-f before anything else. Windows must + * ignore ctrl-f. + * + * 28-Apr-03 Mazzoni + * many changes for new conditional compilation organization + * + * 28-Jun-95 Dannenberg + * removed buffering (which could overflow) from ostgetc. + * + * 2-Aprl-88 Dale Amon at CMU-CSD + * Upgraded to xlisp 2.0. Used msstuff.c as a template. + * + * 20-Apr-87 Dale Amon at CMU-CSD + * Added control-c interrupt handler. Puts user in breakloop and allows + * continue. Prints line at which the interrupt occured. Interrupt + * occurs at first eval after ^C has been typed. + * + * 19-APR-87 Dale Amon at CMU-CSD + * switched from rand to random package. Corrected bug in osrand(). It + * did not use the argument n to calculate a rand in range 0 to n-1 as + * advertised. + * 28-OCT-05 Roger Dannenberg at CMU-SCS + * added directory listing functions + */ + +#include "switches.h" +#include <errno.h> + +#include <stdio.h> +#include <string.h> +#include <unistd.h> + +#include <sys/types.h> +#include <dirent.h> + +#include "xlisp.h" +#include "term.h" +#include "cext.h" +#include "userio.h" +#include "exitpa.h" +#include "sliders.h" /* define sliders -- not just for OSC */ +#if OSC +#include "sound.h" /* define nosc_enabled */ +#endif +#define LBSIZE 200 + +/* external variables */ +extern LVAL s_unbound,s_true; +extern FILE *tfp; + +/* local variables */ +static int lindex; +static int lcount = 0; +static int lposition; +static int line_edit = TRUE; + +#ifndef READ_LINE +#define typeahead_max 128 +static char typeahead[typeahead_max]; +static int typeahead_tail = 0; +static int typeahead_head = 0; +static char lbuf[LBSIZE]; +static int lpos[LBSIZE]; +#endif + +static int echo_enabled = 1; + +/* forward declarations */ +FORWARD LOCAL void xflush(); +FORWARD LOCAL int xcheck(); +FORWARD LOCAL void hidden_msg(); + +/*==========================================================================*/ +/* control-c interrupt handling routines and variables. Uses B4.2 signal + handling. Previous SIGINT handler is saved just in case someday we want + to play with turning control c on and off. +*/ + +#include <signal.h> + +static int ctc = FALSE; +static void control_c(int x) {ctc = TRUE;} +void ctcinit() {signal ( SIGINT, control_c );} +static void ctcreset() {signal ( SIGINT, control_c );} + + +/*==========================================================================*/ + + +const char os_pathchar = '/'; +const char os_sepchar = ':'; + + +/* osinit - initialize */ +void osinit(char *banner) +{ + printf("%s\n",banner); + + /* start the random number generator. Older version was srand(1) + seed of 1 makes the sequence repeatable. Random gives better + pseudo randomness than does rand(). + */ +#if USE_RAND + srand(1); +#endif + +#if USE_RANDOM + srandom(1); +#endif + +#ifndef UNIX + /* set control c trap to local routine */ + ctcinit(); +#else + /* sets terminal for raw input and calls ctcinit too */ + term_init(); + term_character(); +#endif + + lposition = 0; + lindex = 0; + lcount = 0; +} + +/* osfinish - clean up before returning to the operating system */ +void osfinish(void) +{ + term_exit(); + portaudio_exit(); +} + +/* oserror - print an error message */ +void oserror(char *msg) {printf("error: %s\n",msg);} + + +/* osaopen - open an ascii file */ +FILE *osaopen(name,mode) char *name,*mode; { + FILE *fp; + fp = fopen(name,mode); +#ifdef DEBUG_INPUT + printf("osaopen on %s yields %x\n", name, fp); + if (strcmp(name, "/home/rbd/nyquist/lib/xm-test.lsp") == 0) { + // when DEBUG_INPUT is set, this generates a compiler error + // on linux -RBD + debug_input_fp = fp; + printf("osaopen: debug_input_fp gets %x\n", debug_input_fp); + } +#endif + return fp; +} + +/* osbopen - open a binary file */ +FILE *osbopen(name,mode) char *name,*mode; + { char bmode[10]; + FILE *fp; + strcpy(bmode,mode); strcat(bmode,"b"); + fp = fopen(name,bmode); + return fp; + } + +/* osclose - close a file */ +int osclose(fp) FILE *fp; +{ +#ifdef DEBUG_INPUT + if (debug_input_fp == fp) { + debug_input_fp = NULL; + printf("osclose: debug_input_fp gets %x\n", debug_input_fp); + } +#endif + /* when XLISP is loading files and an error is encountered, the files + * are automatically closed so that the OS will not lock them, confusing + * the user. So we could get here and the file could already be closed + */ + return (fp ? fclose(fp) : 0); +} + +/* osagetc - get a character from an ascii file */ +int osagetc(fp) FILE *fp; { +#ifdef DEBUG_INPUT + int c = getc(fp); + ungetc(c, fp); +#endif + return (getc(fp)); +} + +/* osaputc - put a character to an ascii file */ +int osaputc(int ch, FILE *fp) { return (putc(ch,fp)); } + +/* osoutflush - flush output to a file */ +void osoutflush(FILE *fp) { fflush(fp); } + +extern int dbgflg; + +/* osbgetc - get a character from a binary file */ +/* int osbgetc(fp) FILE *fp; {return (getc(fp));} */ +int osbgetc(FILE *fp) { + int c = (getc(fp)); + /* if (dbgflg) printf("osbgetc: got %d from FILE %x\n", c, fp); + */ + return c; +} + +/* osbputc - put a character to a binary file */ +int osbputc(ch,fp) int ch; FILE *fp; {return (putc(ch,fp));} + +#ifdef OLDEST_OSTGETC +/* ostgetc - get a character from the terminal */ +int ostgetc() +{ + int ch; + switch (ch = term_getchar()) { + case '\n': + lbuf[lcount++] = '\n'; + lposition = 0; + if (tfp) + for (lindex = 0; lindex < lcount; ++lindex) + osaputc(lbuf[lindex],tfp); + lindex = 0; lcount = 0; + return (ch); + case '\010': + case '\177': + if (lcount) { + lcount--; + while (lposition > lpos[lcount]) { + lposition--; + } + } + break; + case '\032': + xflush(); + return (EOF); + default: + if (ch == '\t' || (ch >= 0x20 && ch < 0x7F)) { + lbuf[lcount] = ch; + lpos[lcount] = lposition; + if (ch == '\t') + do {} while (++lposition & 7); + else {lposition++;} + lcount++; + return (ch); + } + else { + xflush(); + switch (ch) { + case '\003': xltoplevel(); /* control-c */ + case '\007': xlcleanup(); /* control-g */ + case '\020': xlcontinue(); /* control-p */ + case '\032': return (EOF); /* control-z */ + + /* moved from oscheck until I figure out how to + set up interrupt to handle these two */ + case '\002': xflush(); xlbreak("BREAK",s_unbound); + break; /* control-b */ + case '\024': xinfo(); break; /* control-t */ + + default: return (ch); + } + } + } +} +#else +#if OLD_OSTGETC +/* ostgetc - get a character from the terminal */ +int ostgetc() +{ int ch; + + for (;;) { + ch = term_getchar(); + oscheck(); + switch (ch) { + case '\003': xltoplevel(); /* control-c */ + case '\007': xlcleanup(); /* control-g */ + case '\020': xlcontinue(); /* control-p */ + case '\032': return EOF; /* control-z */ + case '\002': xflush(); xlbreak("BREAK",s_unbound); + break; /* control-b */ + case '\024': xinfo(); break; /* control-t */ + case '\t': + case '\n': + default: + if (tfp) osaputc(ch, tfp); + return ch; + } + } +} +#else +#ifdef READLINE + +#include <readline/readline.h> +#include <readline/history.h> + +char *readline_line = NULL; +int readline_pos = 0; +int readline_len = 0; +int readline_first = 1; + +extern int xldebug; + +int ostgetc() +{ + int rval; + + if (readline_first) + using_history(); + + if (!readline_line) { + char prompt[10]; + if (xldebug==0) + sprintf(prompt, "> "); + else + sprintf(prompt, "%d> ", xldebug); + readline_line = readline(prompt); + if (readline_line == NULL) + return EOF; + add_history(readline_line); + readline_len = strlen(readline_line); + readline_pos = 0; + } + + rval = readline_line[readline_pos]; + if (readline_pos == readline_len) { + free(readline_line); + readline_line = NULL; + return '\n'; + } + readline_pos++; + + return rval; +} + + +#else /* no readline */ + + +void end_of_line_edit() +{ + line_edit = FALSE; + if (tfp) { + for (lindex = 0; lindex < lcount; ++lindex) + osaputc(lbuf[lindex], tfp); + } + lindex = 0; +} + +/* THIS IS THE "REAL" ostgetc(): */ +LOCAL int rawtchar() +{ + int ch; + if (typeahead_tail != typeahead_head) { + ch = typeahead[typeahead_head++]; + typeahead_head &= (typeahead_max - 1); + /* printf("[%c]", ch); */ + if (ch == 0xFF) ch = -1; /* char to int conversion of EOF */ + } else { + fflush(stdout); /* necessary on OS X with Java IDE - I don't know why. */ + /* don't use getchar() or buffering will cause out-of-order input */ + ch = term_getchar(); + /* printf("{%c}", ch); */ + } + return ch; +} + +int ostgetc() +{ +/* + * NOTE: lbuf[] accumulates characters as they are typed + * lpos[] is the column position of the characters + * lcount is the number of characters in lbuf + * lposition is current position + * lindex is index of next char to output + * line_edit is true iff we're inputing characters + * + */ + int ch; + + while (line_edit) { + ch = rawtchar(); + if (ch == EOF) xlisp_wrapup(); + oscheck(); /* in case user typed ^C */ + /* assume for now we should add the character */ + lbuf[lcount] = ch; + lpos[lcount] = lposition; + lcount++; + lposition++; + + /* now do all the special character processing */ + switch (ch) { + case '\001': /* take out non-printing character */ + lcount--; + lposition--; + mark_audio_time(); + break; + case '\n': + lposition = 0; + end_of_line_edit(); + if (echo_enabled) { + osaputc('\r', stdout); + osaputc(ch, stdout); + } + break; + /* delete key generates: 1b, 5b, 33, 7E + which is: ESC, [, 3, ~ */ + case '\010': /* backspace */ + case '\177': /* delete */ + lcount--; /* take out backspace or delete char */ + lposition--; + if (lcount) { + lcount--; + while (lposition > lpos[lcount]) { + if (echo_enabled) { + putchar('\010'); + putchar(' '); + putchar('\010'); + } + lposition--; + } + } + break; + case '\025': /* control-u */ + lcount--; + lposition--; + if (lcount) { + while (lposition > lpos[0]) { + if (echo_enabled) { + putchar('\010'); + putchar(' '); + putchar('\010'); + } + lposition--; + } + lcount = 0; + } + break; + + /* note that control-z never reaches here */ + case '\003': /* control-c */ + xltoplevel(); + lcount = 0; + break; + case '\007': /* control-g */ + lcount--; /* take out non-printing char */ + lposition--; + xlcleanup(); + lcount = 0; + break; + case '\016': + lcount--; /* take out non-printing char */ + lposition--; + hidden_msg(); /* process hidden msg chars */ + break; + case '\020': /* control-p */ + lcount--; /* take out non-printing char */ + lposition--; + xlcontinue(); + lcount = 0; + break; + case '\002': + lcount--; /* take out non-printing char */ + lposition--; + xflush(); /* control-b */ + xlbreak("BREAK",s_unbound); + break; + case '\005': /* control-e */ + lcount--; /* take out non-printing char */ + lposition--; + echo_enabled = TRUE; + break; + case '\006': /* control-f */ + lcount--; /* take out non-printing char */ + lposition--; + echo_enabled = FALSE; + break; + case '\024': /* control-t */ + lcount--; /* take out non-printing char */ + lposition--; + xinfo(); + lcount = 0; + break; + + case '\t': /* TAB */ + lposition--; /* undo the increment above */ + do { + lposition++; + if (echo_enabled) osaputc(' ', stdout); + } while (lposition & 7); + break; + default: + if (echo_enabled) osaputc(ch, stdout); + break; + } + // avoid line buffer overflow here: + if (lposition > LBSIZE - 10) { + // buffer is about to overflow, so write newline and + // feed chars to XLISP + if (echo_enabled) { + osaputc('\r', stdout); + osaputc('\n', stdout); + } + lposition = 0; + end_of_line_edit(); + } + } + if (lindex + 1 >= lcount) { + lcount = 0; + line_edit = TRUE; + } + ch = lbuf[lindex++]; + /* printf("-%c-", ch); */ + if (echo_enabled) fflush(stdout); + return ch; +} +#endif +#endif +#endif + + +/* ostputc - put a character to the terminal */ +void ostputc(int ch) + { + oscheck(); /* check for control characters */ + + /* output the character */ + if (ch == '\n') {lposition = 0;} + else {lposition++;} + + /* output the character to the transcript file */ + if (tfp) osaputc(ch,tfp); + putchar(((char) ch)); + } + +/* ostoutflush - flush output buffer */ +void ostoutflush() +{ + if (tfp) fflush(tfp); + fflush(stdout); +} + +/* osflush - flush the terminal input buffer */ +void osflush(void) +{ + lindex = lcount = lposition = 0; + line_edit = TRUE; +} + + +/* hidden_msg - process a "hidden message" +/* + * NOTE: a "hidden message" is a sequence of characters starting + * with '\016' and ending with '\021'. These are designed to allow + * a graphical interface, namely jNyqIDE, to control sliders in + * real-time (during synthesis). The character sequences are hidden + * meaning they are not echoed and they are not interpreted as LISP. + * + * This function assumes that '\016' has been received already. + */ +LOCAL void hidden_msg() +{ +#define MSGBUF_MAX 64 + char msgbuf[MSGBUF_MAX]; + int msgbufx = 0; + char type_char = rawtchar(); + char ch; + // message is terminated by '\021' + while ((ch = term_getchar()) != '\021' && ch != EOF && + msgbufx < MSGBUF_MAX - 1) { + msgbuf[msgbufx++] = ch; + } + msgbuf[msgbufx++] = 0; + // printf("hidden message: %s, len %ld\n", msgbuf, (long) strlen(msgbuf)); + if (msgbufx < MSGBUF_MAX) { + if (type_char == 'S') { // slider change message + int index; + float value; + if (sscanf(msgbuf, "%d %g", &index, &value) == 2) { + set_slider(index, value); + } + } + } /* other hidden messages could be parsed here */ +} + + +/* oscheck - check for control characters during execution */ +/* + * NOTE: to support type-ahead, unused characters are put + * into a queue to be removed by ostgetc + */ +void oscheck(void) +{ + int ch; + int k, v, n; + static int count = 0; + +#if OSC + if (nosc_enabled) nosc_poll(); +#endif + + if (ctc) { /* control-c */ + /* printf("[oscheck: control-c detected]"); */ + ctc=FALSE; ctcreset(); + xflush(); xltoplevel(); return; + } + + if ((ch = xcheck())) { + switch (ch) { + case BREAK_CHAR: /* control-b */ + /* printf("BREAK_CHAR\n"); */ + xflush(); xlbreak("BREAK",s_unbound); break; + case '\024': /* control-t */ + /* printf("control-t\n"); */ + xinfo(); break; + case '\025': /* control-u */ + /* printf("control-u\n"); */ + xcleanup(); + case '\016': { /* begin hidden message */ + /* printf("hidden msg\n"); */ + hidden_msg(); + break; + } + case '\001': /* control-a -- mark audio time */ + mark_audio_time(); break; + case -1: /* EOF - lost connection, so die */ + xlisp_wrapup(); + break; + case -2: /* no character was ready */ + break; + default: + /* printf("Got %d\n", ch); */ +#ifndef READ_LINE + /* printf("+%c+", ch); */ + typeahead[typeahead_tail++] = ch; + typeahead_tail &= (typeahead_max - 1); + if (typeahead_tail == typeahead_head) { + oserror("Input buffer overflow\n"); + } +#endif + break; + } + } + + count++; + // when compute-bound, count is incremented by 10000 in about 15s, so + // that's about 700 Hz. We want to flush any output at about 2Hz, so + // we'll pick 400 as a round number. + if (count % 400 == 0) { + fflush(stdout); + } +} + +/* xflush - flush the input line buffer and start a new line */ +LOCAL void xflush() +{ + osflush(); + ostputc('\n'); +} + +/* xsystem - execute a system command */ +LVAL xsystem() +{ /*LVAL strval;*/ + unsigned char *cmd = NULL; + + if (moreargs()) + cmd = (unsigned char *)getstring(xlgastring()); + xllastarg(); + return (system((char *) cmd) == -1 ? cvfixnum((FIXTYPE)errno) : s_true); +} + + +/* xsetdir -- set current directory of the process */ +LVAL xsetdir() +{ + char *dir = (char *)getstring(xlgastring()); + int result; + LVAL cwd = NULL; + int verbose = TRUE; + if (moreargs()) { + verbose = (xlgetarg() != NIL); + } + xllastarg(); + result = chdir(dir); + if (result) { + /* perror("SETDIR"); -- Nyquist uses SETDIR to search for directories + * at startup, so failures are normal, and seeing error messages + * could be confusing, so don't print them. The NULL return indicates + * an error, but doesn't tell which one it is. + * But now, SETDIR has a second verbose parameter that is nil when + * searching for directories. -RBD + */ + if (verbose) perror("Directory Setting Error"); + return NULL; + } + dir = getcwd(NULL, 1000); + if (dir) { + cwd = cvstring(dir); + free(dir); + } + return cwd; +} + +/* xget_temp_path -- get a path to create temp files */ +LVAL xget_temp_path() +{ + return cvstring("/tmp/"); +} + +/* xget_user -- get a string identifying the user, for use in file names */ +LVAL xget_user() +{ + char *user = getenv("USER"); + if (!user || !*user) { + errputstr("Warning: could not get user ID, using 'nyquist'\n"); + user = "nyquist"; + } + return cvstring(user); +} + + +/* xechoenabled -- set/clear echo_enabled flag (unix only) */ +LVAL xechoenabled() +{ + int flag = (xlgetarg() != NULL); + xllastarg(); + echo_enabled = flag; + return NULL; +} + + +#define OSDIR_LIST_READY 0 +#define OSDIR_LIST_STARTED 1 +#define OSDIR_LIST_DONE 2 +static int osdir_list_status = OSDIR_LIST_READY; +static DIR *osdir_dir; + +/* osdir_list_start -- open a directory listing */ +int osdir_list_start(char *path) +{ + if (osdir_list_status != OSDIR_LIST_READY) { + osdir_list_finish(); /* close current listing */ + } + osdir_dir = opendir(path); + if (!osdir_dir) { + return FALSE; + } + osdir_list_status = OSDIR_LIST_STARTED; + return TRUE; +} + + +/* osdir_list_next -- read the next entry from a directory */ +char *osdir_list_next() +{ + if (osdir_list_status != OSDIR_LIST_STARTED) { + return NULL; + } + struct dirent *entry = readdir(osdir_dir); + if (!entry) { + osdir_list_status = OSDIR_LIST_DONE; + return NULL; + } else { + return entry->d_name; + } +} + + +/* osdir_list_finish -- close an open directory */ +void osdir_list_finish() +{ + if (osdir_list_status != OSDIR_LIST_READY) { + closedir(osdir_dir); + } + osdir_list_status = OSDIR_LIST_READY; +} + + +/* xcheck -- return a character if one is present */ +LOCAL int xcheck() +{ + int ch = term_testchar(); + return ch; +} + +/* xgetkey - get a key from the keyboard */ +LVAL xgetkey() {xllastarg(); return (cvfixnum((FIXTYPE)term_getchar()));} + +/* ossymbols - enter os specific symbols */ +void ossymbols(void) {} + +/* xsetupconsole -- used to configure window in Win32 version */ +LVAL xsetupconsole() { return NIL; } + diff --git a/sys/unix/osx/run b/sys/unix/osx/run new file mode 100755 index 0000000..bd037c9 --- /dev/null +++ b/sys/unix/osx/run @@ -0,0 +1,5 @@ +#csh +# INSTRUCTIONS: for developers, in the top nyquist directory: +# ln -l sys/unix/osx/run +# ln -s macosxproject/build/ny +java -cp jnyqide/NyquistIDE.jar jnyqide.Main diff --git a/sys/unix/osx/system.lsp b/sys/unix/osx/system.lsp new file mode 100644 index 0000000..2ecd6ed --- /dev/null +++ b/sys/unix/osx/system.lsp @@ -0,0 +1,69 @@ +;; system.lsp -- system-dependent lisp code + +; local definition for play +; this one is for Mac OS-X: + +(if (not (boundp '*default-sf-format*)) + (setf *default-sf-format* snd-head-wave)) + +(if (not (boundp '*default-sound-file*)) + (compute-default-sound-file)) + +(if (not (boundp '*default-sf-dir*)) + (setf *default-sf-dir* "/tmp")) + +(format t "*default-sf-dir* (default sound file directory) is ~A~%" + *default-sf-dir*) + +(if (not (boundp '*default-sf-mode*)) + (setf *default-sf-mode* snd-mode-pcm)) + +(if (not (boundp '*default-sf-bits*)) + (setf *default-sf-bits* 16)) + +(if (not (boundp '*default-plot-file*)) + (setf *default-plot-file* (strcat (get-user) "-points.dat"))) + + +; FULL-NAME-P -- test if file name is a full path or relative path +; +; (otherwise the *default-sf-dir* will be prepended +; +(defun full-name-p (filename) + (or (eq (char filename 0) #\/) + (eq (char filename 0) #\.))) + +; RELATIVE-PATH-P -- test if filename or path is a relative path +; +(defun relative-path-p (filename) + (not (eq (char filename 0) #\/))) + +(setf *file-separator* #\/) + + +;; PLAY-FILE - play a sound file +;; +(defun play-file (name) + (s-save (s-read name) NY:ALL "" :play t)) + + +;; R - replay last file written with PLAY +(defun r () (play-file *default-sound-file*)) + +;;;; use this old version if you want to use sndplay to play +;;;; the result file rather than play the samples as they +;;;; are computed. This version does not autonormalize. +;; PLAY - write value of an expression to file and play it +;; +;(defmacro play (expr) +; `(prog (specs) +; (setf specs (s-save (force-srate *sound-srate* ,expr) +; 1000000000 *default-sound-file*)) +; (r))) +;;;; + +; local definition for play +(defmacro play (expr) + `(s-save-autonorm ,expr NY:ALL *default-sound-file* :play *soundenable*)) + +;; use standard s-plot diff --git a/sys/unix/pl b/sys/unix/pl new file mode 100644 index 0000000..b58e58c --- /dev/null +++ b/sys/unix/pl @@ -0,0 +1,2 @@ +graph < points.dat | plot -Ttek + diff --git a/sys/unix/pmax/Makefile b/sys/unix/pmax/Makefile new file mode 100644 index 0000000..8784790 --- /dev/null +++ b/sys/unix/pmax/Makefile @@ -0,0 +1,520 @@ +# +# Makefile for Nyquist, SYSTEM-TYPE is PMAX +# run make in the top-level Nyquist directory to compile Nyquist +# +# NOTE: this file is machine-generated. DO NOT EDIT! +# Instead, modify makefile.lsp and regenerate the makefile. +# Ports and bug fixes are welcome - please mail them to +# dannenberg@cs.cmu.edu. Thanks. +# + +# This is the resulting executable (normally "ny"): +NY = ny + +# Standard list of includes (common to all unix versions) +INCL = -Inyqsrc -Itran -Ixlisp -Isys/unix -Icmt -Isnd -Ifft + +# system dependent stuff for pmax: + +CC = cc +CFLAGS = -DCMTSTUFF -g $(INCL) +LN = cc +LFLAGS = -lm + + +INTGEN = misc/intgen + +# Object files for Nyquist: +OBJECTS = xlisp/extern.o xlisp/xldmem.o xlisp/xlbfun.o xlisp/xlcont.o \ + xlisp/xldbug.o xlisp/xleval.o xlisp/xlfio.o xlisp/xlftab.o \ + xlisp/xlglob.o xlisp/xlimage.o xlisp/xlinit.o xlisp/xlio.o \ + xlisp/xlisp.o xlisp/xljump.o xlisp/xllist.o xlisp/xlmath.o \ + xlisp/xlobj.o xlisp/xlpp.o xlisp/xlprin.o xlisp/xlread.o \ + xlisp/xlstr.o xlisp/xlsubr.o xlisp/xlsym.o xlisp/xlsys.o \ + tran/amosc.o tran/clip.o tran/const.o tran/fmosc.o \ + tran/integrate.o tran/log.o tran/maxv.o tran/osc.o \ + tran/prod.o tran/buzz.o tran/pwl.o tran/recip.o \ + tran/upsample.o tran/scale.o tran/sine.o tran/partial.o \ + tran/white.o tran/tone.o tran/tonev.o tran/atonev.o \ + tran/atone.o tran/reson.o tran/areson.o tran/resonvc.o \ + tran/resoncv.o tran/aresonvc.o tran/aresoncv.o tran/resonvv.o \ + tran/aresonvv.o tran/offset.o tran/slope.o tran/delay.o \ + tran/delaycv.o tran/shape.o tran/sampler.o tran/exp.o \ + tran/siosc.o tran/follow.o tran/gate.o tran/quantize.o \ + tran/ifft.o tran/congen.o tran/fromobject.o tran/fromarraystream.o \ + tran/coterm.o tran/convolve.o tran/alpass.o tran/oneshot.o \ + tran/chase.o tran/tapv.o tran/biquad.o tran/pluck.o \ + cmt/cext.o cmt/cleanup.o cmt/cmdline.o cmt/cmtcmd.o \ + cmt/moxc.o cmt/mem.o cmt/midifile.o cmt/midifns.o \ + cmt/record.o cmt/seq.o cmt/seqmread.o cmt/seqmwrite.o \ + cmt/seqread.o cmt/seqwrite.o cmt/tempomap.o cmt/timebase.o \ + cmt/userio.o nyqsrc/debug.o nyqsrc/falloc.o nyqsrc/add.o \ + nyqsrc/local.o nyqsrc/downsample.o nyqsrc/handlers.o nyqsrc/multiread.o \ + nyqsrc/multiseq.o nyqsrc/samples.o nyqsrc/seqext.o nyqsrc/seqinterf.o \ + nyqsrc/sndread.o nyqsrc/sndseq.o nyqsrc/sndwrite.o nyqsrc/sndmax.o \ + nyqsrc/sound.o nyqsrc/stats.o nyqsrc/compose.o nyqsrc/inverse.o \ + nyqsrc/resamp.o nyqsrc/resampv.o nyqsrc/ffilterkit.o nyqsrc/avg.o \ + nyqsrc/fft.o nyqsrc/sndfail.o fft/fftn.o nyqsrc/sndfnint.o \ + nyqsrc/seqfnint.o snd/audiopmax.o snd/sndpmax.o snd/ieeecvt.o \ + snd/snd.o snd/sndcvt.o snd/sndio.o snd/sndheader.o \ + sys/unix/osstuff.o sys/unix/term.o + +# Sound functions to add to xlisp +NYQHDRS = snd/snd.h nyqsrc/sound.h nyqsrc/downsample.h nyqsrc/sndread.h \ + nyqsrc/sndseq.h nyqsrc/add.h nyqsrc/multiseq.h nyqsrc/samples.h \ + nyqsrc/sndwrite.h nyqsrc/sndmax.h nyqsrc/compose.h nyqsrc/inverse.h \ + nyqsrc/resamp.h nyqsrc/resampv.h nyqsrc/fft.h nyqsrc/avg.h \ + tran/amosc.h tran/clip.h tran/const.h tran/fmosc.h \ + tran/integrate.h tran/log.h tran/maxv.h tran/osc.h \ + tran/prod.h tran/buzz.h tran/pwl.h tran/recip.h \ + tran/upsample.h tran/scale.h tran/sine.h tran/partial.h \ + tran/white.h tran/tone.h tran/tonev.h tran/atonev.h \ + tran/atone.h tran/reson.h tran/areson.h tran/resonvc.h \ + tran/resoncv.h tran/aresonvc.h tran/aresoncv.h tran/resonvv.h \ + tran/aresonvv.h tran/offset.h tran/slope.h tran/delaycc.h \ + tran/delaycv.h tran/shape.h tran/sampler.h tran/exp.h \ + tran/siosc.h tran/follow.h tran/gate.h tran/quantize.h \ + tran/ifft.h tran/congen.h tran/fromobject.h tran/fromarraystream.h \ + tran/coterm.h tran/convolve.h tran/alpass.h tran/oneshot.h \ + tran/chase.h tran/tapv.h tran/biquad.h tran/pluck.h + +CMTHDRS = cmt/seqdecls.h nyqsrc/seqext.h cmt/seq.h nyqsrc/seqinterf.h \ + cmt/seqread.h cmt/seqmread.h cmt/seqwrite.h cmt/seqmwrite.h + + +EVERYTHING = $(NY) runtime/system.lsp + +CURRENT = $(EVERYTHING) + +current: $(CURRENT) + +$(NY): $(OBJECTS) + $(LN) $(OBJECTS) $(LFLAGS) -o $(NY) + +# copy appropriate system.lsp and make it read-only; +# changes should be made to sys/unix/<system>/system.lsp +runtime/system.lsp: sys/unix/pmax/system.lsp + chmod +w runtime/system.lsp + cp -p sys/unix/pmax/system.lsp runtime/system.lsp + chmod -w runtime/system.lsp + +nyqsrc/debug.o: nyqsrc/debug.c nyqsrc/debug.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/debug.c -o nyqsrc/debug.o $(CFLAGS) + +nyqsrc/falloc.o: nyqsrc/falloc.c nyqsrc/falloc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/falloc.c -o nyqsrc/falloc.o $(CFLAGS) + +nyqsrc/add.o: nyqsrc/add.c nyqsrc/add.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/add.c -o nyqsrc/add.o $(CFLAGS) + +nyqsrc/local.o: nyqsrc/local.c xlisp/xlisp.h nyqsrc/sound.h + cc -c nyqsrc/local.c -o nyqsrc/local.o $(CFLAGS) + +nyqsrc/downsample.o: nyqsrc/downsample.c nyqsrc/downsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/downsample.c -o nyqsrc/downsample.o $(CFLAGS) + +nyqsrc/handlers.o: nyqsrc/handlers.c + cc -c nyqsrc/handlers.c -o nyqsrc/handlers.o $(CFLAGS) + +nyqsrc/multiread.o: nyqsrc/multiread.c nyqsrc/multiread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/multiread.c -o nyqsrc/multiread.o $(CFLAGS) + +nyqsrc/multiseq.o: nyqsrc/multiseq.c nyqsrc/multiseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/multiseq.c -o nyqsrc/multiseq.o $(CFLAGS) + +nyqsrc/samples.o: nyqsrc/samples.c nyqsrc/samples.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/samples.c -o nyqsrc/samples.o $(CFLAGS) + +nyqsrc/seqext.o: nyqsrc/seqext.c nyqsrc/seqext.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/seqext.c -o nyqsrc/seqext.o $(CFLAGS) + +nyqsrc/seqinterf.o: nyqsrc/seqinterf.c nyqsrc/seqinterf.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/seqinterf.c -o nyqsrc/seqinterf.o $(CFLAGS) + +nyqsrc/sndread.o: nyqsrc/sndread.c nyqsrc/sndread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sndread.c -o nyqsrc/sndread.o $(CFLAGS) + +nyqsrc/sndseq.o: nyqsrc/sndseq.c nyqsrc/sndseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sndseq.c -o nyqsrc/sndseq.o $(CFLAGS) + +nyqsrc/sndwrite.o: nyqsrc/sndwrite.c nyqsrc/sndwrite.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sndwrite.c -o nyqsrc/sndwrite.o $(CFLAGS) + +nyqsrc/sndmax.o: nyqsrc/sndmax.c nyqsrc/sndmax.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sndmax.c -o nyqsrc/sndmax.o $(CFLAGS) + +nyqsrc/sound.o: nyqsrc/sound.c nyqsrc/sound.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sound.c -o nyqsrc/sound.o $(CFLAGS) + +nyqsrc/stats.o: nyqsrc/stats.c nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/stats.c -o nyqsrc/stats.o $(CFLAGS) + +nyqsrc/compose.o: nyqsrc/compose.c nyqsrc/compose.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/compose.c -o nyqsrc/compose.o $(CFLAGS) + +nyqsrc/inverse.o: nyqsrc/inverse.c nyqsrc/inverse.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/inverse.c -o nyqsrc/inverse.o $(CFLAGS) + +nyqsrc/resamp.o: nyqsrc/resamp.c nyqsrc/resamp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/resamp.c -o nyqsrc/resamp.o $(CFLAGS) + +nyqsrc/resampv.o: nyqsrc/resampv.c nyqsrc/resampv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/resampv.c -o nyqsrc/resampv.o $(CFLAGS) + +nyqsrc/ffilterkit.o: nyqsrc/ffilterkit.c nyqsrc/ffilterkit.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/ffilterkit.c -o nyqsrc/ffilterkit.o $(CFLAGS) + +nyqsrc/avg.o: nyqsrc/avg.c nyqsrc/avg.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/avg.c -o nyqsrc/avg.o $(CFLAGS) + +nyqsrc/fft.o: nyqsrc/fft.c nyqsrc/fft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/fft.c -o nyqsrc/fft.o $(CFLAGS) + +nyqsrc/sndfail.o: nyqsrc/sndfail.c + cc -c nyqsrc/sndfail.c -o nyqsrc/sndfail.o $(CFLAGS) + +snd/audiopmax.o: snd/audiopmax.c snd/snd.h + cc -c snd/audiopmax.c -o snd/audiopmax.o $(CFLAGS) + +snd/sndpmax.o: snd/sndpmax.c snd/sndpmax.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c snd/sndpmax.c -o snd/sndpmax.o $(CFLAGS) + +snd/ieeecvt.o: snd/ieeecvt.c snd/ieeecvt.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c snd/ieeecvt.c -o snd/ieeecvt.o $(CFLAGS) + +snd/snd.o: snd/snd.c snd/snd.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c snd/snd.c -o snd/snd.o $(CFLAGS) + +snd/sndcvt.o: snd/sndcvt.c snd/snd.h + cc -c snd/sndcvt.c -o snd/sndcvt.o $(CFLAGS) + +snd/sndio.o: snd/sndio.c snd/snd.h + cc -c snd/sndio.c -o snd/sndio.o $(CFLAGS) + +snd/sndheader.o: snd/sndheader.c snd/sndheader.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c snd/sndheader.c -o snd/sndheader.o $(CFLAGS) + +fft/fftn.o: fft/fftn.c fft/fftn.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c fft/fftn.c -o fft/fftn.o $(CFLAGS) + +tran/amosc.o: tran/amosc.c tran/amosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/amosc.c -o tran/amosc.o $(CFLAGS) + +tran/clip.o: tran/clip.c tran/clip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/clip.c -o tran/clip.o $(CFLAGS) + +tran/const.o: tran/const.c tran/const.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/const.c -o tran/const.o $(CFLAGS) + +tran/fmosc.o: tran/fmosc.c tran/fmosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/fmosc.c -o tran/fmosc.o $(CFLAGS) + +tran/integrate.o: tran/integrate.c tran/integrate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/integrate.c -o tran/integrate.o $(CFLAGS) + +tran/log.o: tran/log.c tran/log.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/log.c -o tran/log.o $(CFLAGS) + +tran/maxv.o: tran/maxv.c tran/maxv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/maxv.c -o tran/maxv.o $(CFLAGS) + +tran/osc.o: tran/osc.c tran/osc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/osc.c -o tran/osc.o $(CFLAGS) + +tran/prod.o: tran/prod.c tran/prod.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/prod.c -o tran/prod.o $(CFLAGS) + +tran/buzz.o: tran/buzz.c tran/buzz.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/buzz.c -o tran/buzz.o $(CFLAGS) + +tran/pwl.o: tran/pwl.c tran/pwl.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/pwl.c -o tran/pwl.o $(CFLAGS) + +tran/recip.o: tran/recip.c tran/recip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/recip.c -o tran/recip.o $(CFLAGS) + +tran/upsample.o: tran/upsample.c tran/upsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/upsample.c -o tran/upsample.o $(CFLAGS) + +tran/scale.o: tran/scale.c tran/scale.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/scale.c -o tran/scale.o $(CFLAGS) + +tran/sine.o: tran/sine.c tran/sine.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/sine.c -o tran/sine.o $(CFLAGS) + +tran/partial.o: tran/partial.c tran/partial.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/partial.c -o tran/partial.o $(CFLAGS) + +tran/white.o: tran/white.c tran/white.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/white.c -o tran/white.o $(CFLAGS) + +tran/tone.o: tran/tone.c tran/tone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/tone.c -o tran/tone.o $(CFLAGS) + +tran/tonev.o: tran/tonev.c tran/tonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/tonev.c -o tran/tonev.o $(CFLAGS) + +tran/atonev.o: tran/atonev.c tran/atonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/atonev.c -o tran/atonev.o $(CFLAGS) + +tran/atone.o: tran/atone.c tran/atone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/atone.c -o tran/atone.o $(CFLAGS) + +tran/reson.o: tran/reson.c tran/reson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/reson.c -o tran/reson.o $(CFLAGS) + +tran/areson.o: tran/areson.c tran/areson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/areson.c -o tran/areson.o $(CFLAGS) + +tran/resonvc.o: tran/resonvc.c tran/resonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/resonvc.c -o tran/resonvc.o $(CFLAGS) + +tran/resoncv.o: tran/resoncv.c tran/resoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/resoncv.c -o tran/resoncv.o $(CFLAGS) + +tran/aresonvc.o: tran/aresonvc.c tran/aresonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/aresonvc.c -o tran/aresonvc.o $(CFLAGS) + +tran/aresoncv.o: tran/aresoncv.c tran/aresoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/aresoncv.c -o tran/aresoncv.o $(CFLAGS) + +tran/resonvv.o: tran/resonvv.c tran/resonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/resonvv.c -o tran/resonvv.o $(CFLAGS) + +tran/aresonvv.o: tran/aresonvv.c tran/aresonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/aresonvv.c -o tran/aresonvv.o $(CFLAGS) + +tran/offset.o: tran/offset.c tran/offset.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/offset.c -o tran/offset.o $(CFLAGS) + +tran/slope.o: tran/slope.c tran/slope.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/slope.c -o tran/slope.o $(CFLAGS) + +tran/delaycc.o: tran/delaycc.c tran/delaycc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/delaycc.c -o tran/delaycc.o $(CFLAGS) + +tran/delaycv.o: tran/delaycv.c tran/delaycv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/delaycv.c -o tran/delaycv.o $(CFLAGS) + +tran/shape.o: tran/shape.c tran/shape.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/shape.c -o tran/shape.o $(CFLAGS) + +tran/sampler.o: tran/sampler.c tran/sampler.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/sampler.c -o tran/sampler.o $(CFLAGS) + +tran/exp.o: tran/exp.c tran/exp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/exp.c -o tran/exp.o $(CFLAGS) + +tran/siosc.o: tran/siosc.c tran/siosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/siosc.c -o tran/siosc.o $(CFLAGS) + +tran/follow.o: tran/follow.c tran/follow.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/follow.c -o tran/follow.o $(CFLAGS) + +tran/gate.o: tran/gate.c tran/gate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/gate.c -o tran/gate.o $(CFLAGS) + +tran/quantize.o: tran/quantize.c tran/quantize.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/quantize.c -o tran/quantize.o $(CFLAGS) + +tran/ifft.o: tran/ifft.c tran/ifft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/ifft.c -o tran/ifft.o $(CFLAGS) + +tran/congen.o: tran/congen.c tran/congen.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/congen.c -o tran/congen.o $(CFLAGS) + +tran/fromobject.o: tran/fromobject.c tran/fromobject.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/fromobject.c -o tran/fromobject.o $(CFLAGS) + +tran/fromarraystream.o: tran/fromarraystream.c tran/fromarraystream.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/fromarraystream.c -o tran/fromarraystream.o $(CFLAGS) + +tran/coterm.o: tran/coterm.c tran/coterm.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/coterm.c -o tran/coterm.o $(CFLAGS) + +tran/convolve.o: tran/convolve.c tran/convolve.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/convolve.c -o tran/convolve.o $(CFLAGS) + +tran/alpass.o: tran/alpass.c tran/alpass.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/alpass.c -o tran/alpass.o $(CFLAGS) + +tran/oneshot.o: tran/oneshot.c tran/oneshot.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/oneshot.c -o tran/oneshot.o $(CFLAGS) + +tran/chase.o: tran/chase.c tran/chase.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/chase.c -o tran/chase.o $(CFLAGS) + +tran/tapv.o: tran/tapv.c tran/tapv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/tapv.c -o tran/tapv.o $(CFLAGS) + +tran/biquad.o: tran/biquad.c tran/biquad.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/biquad.c -o tran/biquad.o $(CFLAGS) + +tran/pluck.o: tran/pluck.c tran/pluck.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/pluck.c -o tran/pluck.o $(CFLAGS) + +nyqsrc/sndfnint.o: nyqsrc/sndfnint.c + cc -c nyqsrc/sndfnint.c -o nyqsrc/sndfnint.o $(CFLAGS) + +nyqsrc/seqfnint.o: nyqsrc/seqfnint.c + cc -c nyqsrc/seqfnint.c -o nyqsrc/seqfnint.o $(CFLAGS) + +xlisp/xlftab.o: nyqsrc/sndfnintptrs.h nyqsrc/sndfnintdefs.h nyqsrc/seqfnintptrs.h nyqsrc/seqfnintdefs.h + cc -c xlisp/xlftab.c -o xlisp/xlftab.o $(CFLAGS) + +xlisp/extern.o: xlisp/extern.c + cc -c xlisp/extern.c -o xlisp/extern.o $(CFLAGS) + +xlisp/xldmem.o: xlisp/xldmem.c + cc -c xlisp/xldmem.c -o xlisp/xldmem.o $(CFLAGS) + +xlisp/xlbfun.o: xlisp/xlbfun.c + cc -c xlisp/xlbfun.c -o xlisp/xlbfun.o $(CFLAGS) + +xlisp/xlcont.o: xlisp/xlcont.c + cc -c xlisp/xlcont.c -o xlisp/xlcont.o $(CFLAGS) + +xlisp/xldbug.o: xlisp/xldbug.c + cc -c xlisp/xldbug.c -o xlisp/xldbug.o $(CFLAGS) + +xlisp/xleval.o: xlisp/xleval.c + cc -c xlisp/xleval.c -o xlisp/xleval.o $(CFLAGS) + +xlisp/xlfio.o: xlisp/xlfio.c + cc -c xlisp/xlfio.c -o xlisp/xlfio.o $(CFLAGS) + +xlisp/xlglob.o: xlisp/xlglob.c + cc -c xlisp/xlglob.c -o xlisp/xlglob.o $(CFLAGS) + +xlisp/xlimage.o: xlisp/xlimage.c + cc -c xlisp/xlimage.c -o xlisp/xlimage.o $(CFLAGS) + +xlisp/xlinit.o: xlisp/xlinit.c + cc -c xlisp/xlinit.c -o xlisp/xlinit.o $(CFLAGS) + +xlisp/xlio.o: xlisp/xlio.c + cc -c xlisp/xlio.c -o xlisp/xlio.o $(CFLAGS) + +xlisp/xlisp.o: xlisp/xlisp.c + cc -c xlisp/xlisp.c -o xlisp/xlisp.o $(CFLAGS) + +xlisp/xljump.o: xlisp/xljump.c + cc -c xlisp/xljump.c -o xlisp/xljump.o $(CFLAGS) + +xlisp/xllist.o: xlisp/xllist.c + cc -c xlisp/xllist.c -o xlisp/xllist.o $(CFLAGS) + +xlisp/xlmath.o: xlisp/xlmath.c + cc -c xlisp/xlmath.c -o xlisp/xlmath.o $(CFLAGS) + +xlisp/xlobj.o: xlisp/xlobj.c + cc -c xlisp/xlobj.c -o xlisp/xlobj.o $(CFLAGS) + +xlisp/xlpp.o: xlisp/xlpp.c + cc -c xlisp/xlpp.c -o xlisp/xlpp.o $(CFLAGS) + +xlisp/xlprin.o: xlisp/xlprin.c + cc -c xlisp/xlprin.c -o xlisp/xlprin.o $(CFLAGS) + +xlisp/xlread.o: xlisp/xlread.c + cc -c xlisp/xlread.c -o xlisp/xlread.o $(CFLAGS) + +xlisp/xlstr.o: xlisp/xlstr.c + cc -c xlisp/xlstr.c -o xlisp/xlstr.o $(CFLAGS) + +xlisp/xlsubr.o: xlisp/xlsubr.c + cc -c xlisp/xlsubr.c -o xlisp/xlsubr.o $(CFLAGS) + +xlisp/xlsym.o: xlisp/xlsym.c + cc -c xlisp/xlsym.c -o xlisp/xlsym.o $(CFLAGS) + +xlisp/xlsys.o: xlisp/xlsys.c + cc -c xlisp/xlsys.c -o xlisp/xlsys.o $(CFLAGS) + +cmt/cext.o: cmt/cext.c + cc -c cmt/cext.c -o cmt/cext.o $(CFLAGS) + +cmt/cleanup.o: cmt/cleanup.c + cc -c cmt/cleanup.c -o cmt/cleanup.o $(CFLAGS) + +cmt/cmdline.o: cmt/cmdline.c + cc -c cmt/cmdline.c -o cmt/cmdline.o $(CFLAGS) + +cmt/cmtcmd.o: cmt/cmtcmd.c + cc -c cmt/cmtcmd.c -o cmt/cmtcmd.o $(CFLAGS) + +cmt/moxc.o: cmt/moxc.c + cc -c cmt/moxc.c -o cmt/moxc.o $(CFLAGS) + +cmt/mem.o: cmt/mem.c + cc -c cmt/mem.c -o cmt/mem.o $(CFLAGS) + +cmt/midifile.o: cmt/midifile.c + cc -c cmt/midifile.c -o cmt/midifile.o $(CFLAGS) + +cmt/midifns.o: cmt/midifns.c + cc -c cmt/midifns.c -o cmt/midifns.o $(CFLAGS) + +cmt/record.o: cmt/record.c + cc -c cmt/record.c -o cmt/record.o $(CFLAGS) + +cmt/seq.o: cmt/seq.c + cc -c cmt/seq.c -o cmt/seq.o $(CFLAGS) + +cmt/seqmread.o: cmt/seqmread.c + cc -c cmt/seqmread.c -o cmt/seqmread.o $(CFLAGS) + +cmt/seqmwrite.o: cmt/seqmwrite.c + cc -c cmt/seqmwrite.c -o cmt/seqmwrite.o $(CFLAGS) + +cmt/seqread.o: cmt/seqread.c + cc -c cmt/seqread.c -o cmt/seqread.o $(CFLAGS) + +cmt/seqwrite.o: cmt/seqwrite.c + cc -c cmt/seqwrite.c -o cmt/seqwrite.o $(CFLAGS) + +cmt/tempomap.o: cmt/tempomap.c + cc -c cmt/tempomap.c -o cmt/tempomap.o $(CFLAGS) + +cmt/timebase.o: cmt/timebase.c + cc -c cmt/timebase.c -o cmt/timebase.o $(CFLAGS) + +cmt/userio.o: cmt/userio.c + cc -c cmt/userio.c -o cmt/userio.o $(CFLAGS) + +sys/unix/osstuff.o: sys/unix/osstuff.c + cc -c sys/unix/osstuff.c -o sys/unix/osstuff.o $(CFLAGS) + +misc/intgen: misc/intgen.c + cd misc; make intgen + +misc/unpacker: misc/unpacker.c misc/convert.c + cd misc; make unpacker + +misc/packer: misc/packer.c misc/convert.c + cd misc; make packer + +nyqsrc/sndfnintptrs.h: $(NYQHDRS) snd/snd.h misc/intgen + $(INTGEN) nyqsrc/sndfnint $(NYQHDRS) + +nyqsrc/seqfnintptrs.h: $(CMTHDRS) misc/intgen + $(INTGEN) nyqsrc/seqfnint $(CMTHDRS) + +clean: + cd misc; make clean + rm -f $(OBJECTS) +# Note that these files are machine-generated: + rm -f nyqsrc/sndfnintptrs.h nyqsrc/sndfnint.c nyqsrc/sndfnintdefs.h + rm -f nyqsrc/seqfnintptrs.h nyqsrc/seqfnint.c nyqsrc/seqfnintdefs.h + +cleaner: clean + cd misc; make cleaner + rm -f *.backup */*.backup + rm -f *~ */*.*~ + rm -f *.save */*.save + rm -f *.CKP */*.CKP + rm -f *.BAK */*.BAK + rm -f *.old */*.old + rm -f *.gold */*.gold + rm -f playparms + rm -f points.dat diff --git a/sys/unix/pmax/system.lsp b/sys/unix/pmax/system.lsp new file mode 100644 index 0000000..6371aa0 --- /dev/null +++ b/sys/unix/pmax/system.lsp @@ -0,0 +1,37 @@ +; machine.lsp -- machine/system-dependent definitions +; rs6000 + +(if (not (boundp '*default-sf-format*)) + (setf *default-sf-format* snd-head-none)) + +(if (not (boundp '*default-sound-file*)) + (compute-default-sound-file)) + +(if (not (boundp '*default-sf-dir*)) + (setf *default-sf-dir* "/tmp/")) + +(if (not (boundp '*default-sf-mode*)) + (setf *default-sf-mode* snd-mode-pcm)) + +(if (not (boundp '*default-sf-bits*)) + (setf *default-sf-bits* 16)) + +; local definition for play + + +(defun p6k () + (system (format nil + "/usr/itc/projects/depot/tactus/bin/acpaplay ~A/~A < playparms" + *default-sf-dir* + *default-sound-file*))) + + +(defmacro play (expr) + `(prog (specs playparms) + (setf specs (s-save ',expr 1000000000 *default-sound-file*)) + (setf playparms (open "playparms" :direction :output)) + (format playparms "~A~%16~%2~%~A~%" (car specs) (cadr specs)) + (close playparms) + (p6k))) + + diff --git a/sys/unix/rs6k/Makefile b/sys/unix/rs6k/Makefile new file mode 100644 index 0000000..1ba39f4 --- /dev/null +++ b/sys/unix/rs6k/Makefile @@ -0,0 +1,529 @@ +# +# Makefile for Nyquist, SYSTEM-TYPE is RS6K +# run make in the top-level Nyquist directory to compile Nyquist +# +# NOTE: this file is machine-generated. DO NOT EDIT! +# Instead, modify makefile.lsp and regenerate the makefile. +# Ports and bug fixes are welcome - please mail them to +# dannenberg@cs.cmu.edu. Thanks. +# + +# This is the resulting executable (normally "ny"): +NY = ny + +# Standard list of includes (common to all unix versions) +INCL = -Inyqsrc -Itran -Ixlisp -Isys/unix -Icmt -Isnd -Ifft + +# system dependent stuff for rs6k: + +MIDI = /afs/cs/project/music/rs6k/midilib +CC = cc +# change -g to -O for optimization +CFLAGS = -DCMTSTUFF -g $(INCL) -I$(MIDI) +XFLAGS = $(CFLAGS) -qlanglvl=extended +LN = xlc -qattr -qlist +LFLAGS = -lm -L$(MIDI) -lmidi -lbsd -lg + + +INTGEN = misc/intgen + +# Object files for Nyquist: +OBJECTS = xlisp/extern.o xlisp/xldmem.o xlisp/xlbfun.o xlisp/xlcont.o \ + xlisp/xldbug.o xlisp/xleval.o xlisp/xlfio.o xlisp/xlftab.o \ + xlisp/xlglob.o xlisp/xlimage.o xlisp/xlinit.o xlisp/xlio.o \ + xlisp/xlisp.o xlisp/xljump.o xlisp/xllist.o xlisp/xlmath.o \ + xlisp/xlobj.o xlisp/xlpp.o xlisp/xlprin.o xlisp/xlread.o \ + xlisp/xlstr.o xlisp/xlsubr.o xlisp/xlsym.o xlisp/xlsys.o \ + tran/amosc.o tran/clip.o tran/const.o tran/fmosc.o \ + tran/integrate.o tran/log.o tran/maxv.o tran/osc.o \ + tran/prod.o tran/buzz.o tran/pwl.o tran/recip.o \ + tran/upsample.o tran/scale.o tran/sine.o tran/partial.o \ + tran/white.o tran/tone.o tran/tonev.o tran/atonev.o \ + tran/atone.o tran/reson.o tran/areson.o tran/resonvc.o \ + tran/resoncv.o tran/aresonvc.o tran/aresoncv.o tran/resonvv.o \ + tran/aresonvv.o tran/offset.o tran/slope.o tran/delay.o \ + tran/delaycv.o tran/shape.o tran/sampler.o tran/exp.o \ + tran/siosc.o tran/follow.o tran/gate.o tran/quantize.o \ + tran/ifft.o tran/congen.o tran/fromobject.o tran/fromarraystream.o \ + tran/coterm.o tran/convolve.o tran/alpass.o tran/oneshot.o \ + tran/chase.o tran/tapv.o tran/biquad.o tran/pluck.o \ + cmt/cext.o cmt/cleanup.o cmt/cmdline.o cmt/cmtcmd.o \ + cmt/moxc.o cmt/mem.o cmt/midifile.o cmt/midifns.o \ + cmt/record.o cmt/seq.o cmt/seqmread.o cmt/seqmwrite.o \ + cmt/seqread.o cmt/seqwrite.o cmt/tempomap.o cmt/timebase.o \ + cmt/userio.o nyqsrc/debug.o nyqsrc/falloc.o nyqsrc/add.o \ + nyqsrc/local.o nyqsrc/downsample.o nyqsrc/handlers.o nyqsrc/multiread.o \ + nyqsrc/multiseq.o nyqsrc/samples.o nyqsrc/seqext.o nyqsrc/seqinterf.o \ + nyqsrc/sndread.o nyqsrc/sndseq.o nyqsrc/sndwrite.o nyqsrc/sndmax.o \ + nyqsrc/sound.o nyqsrc/stats.o nyqsrc/compose.o nyqsrc/inverse.o \ + nyqsrc/resamp.o nyqsrc/resampv.o nyqsrc/ffilterkit.o nyqsrc/avg.o \ + nyqsrc/fft.o nyqsrc/sndfail.o fft/fftn.o nyqsrc/sndfnint.o \ + nyqsrc/seqfnint.o snd/audiors6k.o snd/sndrs6k.o snd/ieeecvt.o \ + snd/snd.o snd/sndcvt.o snd/sndio.o snd/sndheader.o \ + sys/unix/osstuff.o sys/unix/term.o + +# Sound functions to add to xlisp +NYQHDRS = snd/snd.h nyqsrc/sound.h nyqsrc/downsample.h nyqsrc/sndread.h \ + nyqsrc/sndseq.h nyqsrc/add.h nyqsrc/multiseq.h nyqsrc/samples.h \ + nyqsrc/sndwrite.h nyqsrc/sndmax.h nyqsrc/compose.h nyqsrc/inverse.h \ + nyqsrc/resamp.h nyqsrc/resampv.h nyqsrc/fft.h nyqsrc/avg.h \ + tran/amosc.h tran/clip.h tran/const.h tran/fmosc.h \ + tran/integrate.h tran/log.h tran/maxv.h tran/osc.h \ + tran/prod.h tran/buzz.h tran/pwl.h tran/recip.h \ + tran/upsample.h tran/scale.h tran/sine.h tran/partial.h \ + tran/white.h tran/tone.h tran/tonev.h tran/atonev.h \ + tran/atone.h tran/reson.h tran/areson.h tran/resonvc.h \ + tran/resoncv.h tran/aresonvc.h tran/aresoncv.h tran/resonvv.h \ + tran/aresonvv.h tran/offset.h tran/slope.h tran/delaycc.h \ + tran/delaycv.h tran/shape.h tran/sampler.h tran/exp.h \ + tran/siosc.h tran/follow.h tran/gate.h tran/quantize.h \ + tran/ifft.h tran/congen.h tran/fromobject.h tran/fromarraystream.h \ + tran/coterm.h tran/convolve.h tran/alpass.h tran/oneshot.h \ + tran/chase.h tran/tapv.h tran/biquad.h tran/pluck.h + +CMTHDRS = cmt/seqdecls.h nyqsrc/seqext.h cmt/seq.h nyqsrc/seqinterf.h \ + cmt/seqread.h cmt/seqmread.h cmt/seqwrite.h cmt/seqmwrite.h + + +EVERYTHING = $(NY) runtime/system.lsp + +CURRENT = $(EVERYTHING) + +current: $(CURRENT) + +$(NY): $(OBJECTS) + $(LN) $(OBJECTS) $(LFLAGS) -o $(NY) + +# copy appropriate system.lsp and make it read-only; +# changes should be made to sys/unix/<system>/system.lsp +runtime/system.lsp: sys/unix/rs6k/system.lsp + chmod +w runtime/system.lsp + cp -p sys/unix/rs6k/system.lsp runtime/system.lsp + chmod -w runtime/system.lsp + +nyqsrc/debug.o: nyqsrc/debug.c nyqsrc/debug.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/debug.c -o nyqsrc/debug.o $(CFLAGS) + +nyqsrc/falloc.o: nyqsrc/falloc.c nyqsrc/falloc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/falloc.c -o nyqsrc/falloc.o $(CFLAGS) + +nyqsrc/add.o: nyqsrc/add.c nyqsrc/add.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/add.c -o nyqsrc/add.o $(CFLAGS) + +nyqsrc/local.o: nyqsrc/local.c xlisp/xlisp.h nyqsrc/sound.h + cc -c nyqsrc/local.c -o nyqsrc/local.o $(CFLAGS) + +nyqsrc/downsample.o: nyqsrc/downsample.c nyqsrc/downsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/downsample.c -o nyqsrc/downsample.o $(CFLAGS) + +nyqsrc/handlers.o: nyqsrc/handlers.c + cc -c nyqsrc/handlers.c -o nyqsrc/handlers.o $(CFLAGS) + +nyqsrc/multiread.o: nyqsrc/multiread.c nyqsrc/multiread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/multiread.c -o nyqsrc/multiread.o $(CFLAGS) + +nyqsrc/multiseq.o: nyqsrc/multiseq.c nyqsrc/multiseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/multiseq.c -o nyqsrc/multiseq.o $(CFLAGS) + +nyqsrc/samples.o: nyqsrc/samples.c nyqsrc/samples.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/samples.c -o nyqsrc/samples.o $(CFLAGS) + +nyqsrc/seqext.o: nyqsrc/seqext.c nyqsrc/seqext.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/seqext.c -o nyqsrc/seqext.o $(CFLAGS) + +nyqsrc/seqinterf.o: nyqsrc/seqinterf.c nyqsrc/seqinterf.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/seqinterf.c -o nyqsrc/seqinterf.o $(CFLAGS) + +nyqsrc/sndread.o: nyqsrc/sndread.c nyqsrc/sndread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sndread.c -o nyqsrc/sndread.o $(CFLAGS) + +nyqsrc/sndseq.o: nyqsrc/sndseq.c nyqsrc/sndseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sndseq.c -o nyqsrc/sndseq.o $(CFLAGS) + +nyqsrc/sndwrite.o: nyqsrc/sndwrite.c nyqsrc/sndwrite.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sndwrite.c -o nyqsrc/sndwrite.o $(CFLAGS) + +nyqsrc/sndmax.o: nyqsrc/sndmax.c nyqsrc/sndmax.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sndmax.c -o nyqsrc/sndmax.o $(CFLAGS) + +nyqsrc/sound.o: nyqsrc/sound.c nyqsrc/sound.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sound.c -o nyqsrc/sound.o $(CFLAGS) + +nyqsrc/stats.o: nyqsrc/stats.c nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/stats.c -o nyqsrc/stats.o $(CFLAGS) + +nyqsrc/compose.o: nyqsrc/compose.c nyqsrc/compose.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/compose.c -o nyqsrc/compose.o $(CFLAGS) + +nyqsrc/inverse.o: nyqsrc/inverse.c nyqsrc/inverse.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/inverse.c -o nyqsrc/inverse.o $(CFLAGS) + +nyqsrc/resamp.o: nyqsrc/resamp.c nyqsrc/resamp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/resamp.c -o nyqsrc/resamp.o $(CFLAGS) + +nyqsrc/resampv.o: nyqsrc/resampv.c nyqsrc/resampv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/resampv.c -o nyqsrc/resampv.o $(CFLAGS) + +nyqsrc/ffilterkit.o: nyqsrc/ffilterkit.c nyqsrc/ffilterkit.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/ffilterkit.c -o nyqsrc/ffilterkit.o $(CFLAGS) + +nyqsrc/avg.o: nyqsrc/avg.c nyqsrc/avg.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/avg.c -o nyqsrc/avg.o $(CFLAGS) + +nyqsrc/fft.o: nyqsrc/fft.c nyqsrc/fft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/fft.c -o nyqsrc/fft.o $(CFLAGS) + +nyqsrc/sndfail.o: nyqsrc/sndfail.c + cc -c nyqsrc/sndfail.c -o nyqsrc/sndfail.o $(CFLAGS) + +snd/audiors6k.o: snd/audiors6k.c snd/snd.h + cc -c snd/audiors6k.c -o snd/audiors6k.o $(CFLAGS) + +snd/sndrs6k.o: snd/sndrs6k.c snd/sndrs6k.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c snd/sndrs6k.c -o snd/sndrs6k.o $(CFLAGS) + +snd/ieeecvt.o: snd/ieeecvt.c snd/ieeecvt.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c snd/ieeecvt.c -o snd/ieeecvt.o $(CFLAGS) + +snd/snd.o: snd/snd.c snd/snd.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c snd/snd.c -o snd/snd.o $(CFLAGS) + +snd/sndcvt.o: snd/sndcvt.c snd/snd.h + cc -c snd/sndcvt.c -o snd/sndcvt.o $(CFLAGS) + +snd/sndio.o: snd/sndio.c snd/snd.h + cc -c snd/sndio.c -o snd/sndio.o $(CFLAGS) + +snd/sndheader.o: snd/sndheader.c snd/sndheader.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c snd/sndheader.c -o snd/sndheader.o $(CFLAGS) + +fft/fftn.o: fft/fftn.c fft/fftn.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c fft/fftn.c -o fft/fftn.o $(CFLAGS) + +tran/amosc.o: tran/amosc.c tran/amosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/amosc.c -o tran/amosc.o $(CFLAGS) + +tran/clip.o: tran/clip.c tran/clip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/clip.c -o tran/clip.o $(CFLAGS) + +tran/const.o: tran/const.c tran/const.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/const.c -o tran/const.o $(CFLAGS) + +tran/fmosc.o: tran/fmosc.c tran/fmosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/fmosc.c -o tran/fmosc.o $(CFLAGS) + +tran/integrate.o: tran/integrate.c tran/integrate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/integrate.c -o tran/integrate.o $(CFLAGS) + +tran/log.o: tran/log.c tran/log.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/log.c -o tran/log.o $(CFLAGS) + +tran/maxv.o: tran/maxv.c tran/maxv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/maxv.c -o tran/maxv.o $(CFLAGS) + +tran/osc.o: tran/osc.c tran/osc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/osc.c -o tran/osc.o $(CFLAGS) + +tran/prod.o: tran/prod.c tran/prod.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/prod.c -o tran/prod.o $(CFLAGS) + +tran/buzz.o: tran/buzz.c tran/buzz.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/buzz.c -o tran/buzz.o $(CFLAGS) + +tran/pwl.o: tran/pwl.c tran/pwl.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/pwl.c -o tran/pwl.o $(CFLAGS) + +tran/recip.o: tran/recip.c tran/recip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/recip.c -o tran/recip.o $(CFLAGS) + +tran/upsample.o: tran/upsample.c tran/upsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/upsample.c -o tran/upsample.o $(CFLAGS) + +tran/scale.o: tran/scale.c tran/scale.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/scale.c -o tran/scale.o $(CFLAGS) + +tran/sine.o: tran/sine.c tran/sine.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/sine.c -o tran/sine.o $(CFLAGS) + +tran/partial.o: tran/partial.c tran/partial.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/partial.c -o tran/partial.o $(CFLAGS) + +tran/white.o: tran/white.c tran/white.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/white.c -o tran/white.o $(CFLAGS) + +tran/tone.o: tran/tone.c tran/tone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/tone.c -o tran/tone.o $(CFLAGS) + +tran/tonev.o: tran/tonev.c tran/tonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/tonev.c -o tran/tonev.o $(CFLAGS) + +tran/atonev.o: tran/atonev.c tran/atonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/atonev.c -o tran/atonev.o $(CFLAGS) + +tran/atone.o: tran/atone.c tran/atone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/atone.c -o tran/atone.o $(CFLAGS) + +tran/reson.o: tran/reson.c tran/reson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/reson.c -o tran/reson.o $(CFLAGS) + +tran/areson.o: tran/areson.c tran/areson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/areson.c -o tran/areson.o $(CFLAGS) + +tran/resonvc.o: tran/resonvc.c tran/resonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/resonvc.c -o tran/resonvc.o $(CFLAGS) + +tran/resoncv.o: tran/resoncv.c tran/resoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/resoncv.c -o tran/resoncv.o $(CFLAGS) + +tran/aresonvc.o: tran/aresonvc.c tran/aresonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/aresonvc.c -o tran/aresonvc.o $(CFLAGS) + +tran/aresoncv.o: tran/aresoncv.c tran/aresoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/aresoncv.c -o tran/aresoncv.o $(CFLAGS) + +tran/resonvv.o: tran/resonvv.c tran/resonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/resonvv.c -o tran/resonvv.o $(CFLAGS) + +tran/aresonvv.o: tran/aresonvv.c tran/aresonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/aresonvv.c -o tran/aresonvv.o $(CFLAGS) + +tran/offset.o: tran/offset.c tran/offset.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/offset.c -o tran/offset.o $(CFLAGS) + +tran/slope.o: tran/slope.c tran/slope.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/slope.c -o tran/slope.o $(CFLAGS) + +tran/delaycc.o: tran/delaycc.c tran/delaycc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/delaycc.c -o tran/delaycc.o $(CFLAGS) + +tran/delaycv.o: tran/delaycv.c tran/delaycv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/delaycv.c -o tran/delaycv.o $(CFLAGS) + +tran/shape.o: tran/shape.c tran/shape.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/shape.c -o tran/shape.o $(CFLAGS) + +tran/sampler.o: tran/sampler.c tran/sampler.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/sampler.c -o tran/sampler.o $(CFLAGS) + +tran/exp.o: tran/exp.c tran/exp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/exp.c -o tran/exp.o $(CFLAGS) + +tran/siosc.o: tran/siosc.c tran/siosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/siosc.c -o tran/siosc.o $(CFLAGS) + +tran/follow.o: tran/follow.c tran/follow.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/follow.c -o tran/follow.o $(CFLAGS) + +tran/gate.o: tran/gate.c tran/gate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/gate.c -o tran/gate.o $(CFLAGS) + +tran/quantize.o: tran/quantize.c tran/quantize.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/quantize.c -o tran/quantize.o $(CFLAGS) + +tran/ifft.o: tran/ifft.c tran/ifft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/ifft.c -o tran/ifft.o $(CFLAGS) + +tran/congen.o: tran/congen.c tran/congen.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/congen.c -o tran/congen.o $(CFLAGS) + +tran/fromobject.o: tran/fromobject.c tran/fromobject.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/fromobject.c -o tran/fromobject.o $(CFLAGS) + +tran/fromarraystream.o: tran/fromarraystream.c tran/fromarraystream.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/fromarraystream.c -o tran/fromarraystream.o $(CFLAGS) + +tran/coterm.o: tran/coterm.c tran/coterm.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/coterm.c -o tran/coterm.o $(CFLAGS) + +tran/convolve.o: tran/convolve.c tran/convolve.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/convolve.c -o tran/convolve.o $(CFLAGS) + +tran/alpass.o: tran/alpass.c tran/alpass.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/alpass.c -o tran/alpass.o $(CFLAGS) + +tran/oneshot.o: tran/oneshot.c tran/oneshot.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/oneshot.c -o tran/oneshot.o $(CFLAGS) + +tran/chase.o: tran/chase.c tran/chase.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/chase.c -o tran/chase.o $(CFLAGS) + +tran/tapv.o: tran/tapv.c tran/tapv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/tapv.c -o tran/tapv.o $(CFLAGS) + +tran/biquad.o: tran/biquad.c tran/biquad.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/biquad.c -o tran/biquad.o $(CFLAGS) + +tran/pluck.o: tran/pluck.c tran/pluck.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/pluck.c -o tran/pluck.o $(CFLAGS) + +nyqsrc/sndfnint.o: nyqsrc/sndfnint.c + cc -c nyqsrc/sndfnint.c -o nyqsrc/sndfnint.o $(CFLAGS) + +nyqsrc/seqfnint.o: nyqsrc/seqfnint.c + cc -c nyqsrc/seqfnint.c -o nyqsrc/seqfnint.o $(CFLAGS) + +xlisp/xlftab.o: nyqsrc/sndfnintptrs.h nyqsrc/sndfnintdefs.h nyqsrc/seqfnintptrs.h nyqsrc/seqfnintdefs.h + cc -c xlisp/xlftab.c -o xlisp/xlftab.o $(CFLAGS) + +xlisp/extern.o: xlisp/extern.c + cc -c xlisp/extern.c -o xlisp/extern.o $(CFLAGS) + +xlisp/xldmem.o: xlisp/xldmem.c + cc -c xlisp/xldmem.c -o xlisp/xldmem.o $(CFLAGS) + +xlisp/xlbfun.o: xlisp/xlbfun.c + cc -c xlisp/xlbfun.c -o xlisp/xlbfun.o $(CFLAGS) + +xlisp/xlcont.o: xlisp/xlcont.c + cc -c xlisp/xlcont.c -o xlisp/xlcont.o $(CFLAGS) + +xlisp/xldbug.o: xlisp/xldbug.c + cc -c xlisp/xldbug.c -o xlisp/xldbug.o $(CFLAGS) + +xlisp/xleval.o: xlisp/xleval.c + cc -c xlisp/xleval.c -o xlisp/xleval.o $(CFLAGS) + +xlisp/xlfio.o: xlisp/xlfio.c + cc -c xlisp/xlfio.c -o xlisp/xlfio.o $(CFLAGS) + +xlisp/xlglob.o: xlisp/xlglob.c + cc -c xlisp/xlglob.c -o xlisp/xlglob.o $(CFLAGS) + +xlisp/xlimage.o: xlisp/xlimage.c + cc -c xlisp/xlimage.c -o xlisp/xlimage.o $(CFLAGS) + +xlisp/xlinit.o: xlisp/xlinit.c + cc -c xlisp/xlinit.c -o xlisp/xlinit.o $(CFLAGS) + +xlisp/xlio.o: xlisp/xlio.c + cc -c xlisp/xlio.c -o xlisp/xlio.o $(CFLAGS) + +xlisp/xlisp.o: xlisp/xlisp.c + cc -c xlisp/xlisp.c -o xlisp/xlisp.o $(CFLAGS) + +xlisp/xljump.o: xlisp/xljump.c + cc -c xlisp/xljump.c -o xlisp/xljump.o $(CFLAGS) + +xlisp/xllist.o: xlisp/xllist.c + cc -c xlisp/xllist.c -o xlisp/xllist.o $(CFLAGS) + +xlisp/xlmath.o: xlisp/xlmath.c + cc -c xlisp/xlmath.c -o xlisp/xlmath.o $(CFLAGS) + +xlisp/xlobj.o: xlisp/xlobj.c + cc -c xlisp/xlobj.c -o xlisp/xlobj.o $(CFLAGS) + +xlisp/xlpp.o: xlisp/xlpp.c + cc -c xlisp/xlpp.c -o xlisp/xlpp.o $(CFLAGS) + +xlisp/xlprin.o: xlisp/xlprin.c + cc -c xlisp/xlprin.c -o xlisp/xlprin.o $(CFLAGS) + +xlisp/xlread.o: xlisp/xlread.c + cc -c xlisp/xlread.c -o xlisp/xlread.o $(CFLAGS) + +xlisp/xlstr.o: xlisp/xlstr.c + cc -c xlisp/xlstr.c -o xlisp/xlstr.o $(CFLAGS) + +xlisp/xlsubr.o: xlisp/xlsubr.c + cc -c xlisp/xlsubr.c -o xlisp/xlsubr.o $(CFLAGS) + +xlisp/xlsym.o: xlisp/xlsym.c + cc -c xlisp/xlsym.c -o xlisp/xlsym.o $(CFLAGS) + +xlisp/xlsys.o: xlisp/xlsys.c + cc -c xlisp/xlsys.c -o xlisp/xlsys.o $(CFLAGS) + +cmt/cext.o: cmt/cext.c + cc -c cmt/cext.c -o cmt/cext.o $(CFLAGS) + +cmt/cleanup.o: cmt/cleanup.c + cc -c cmt/cleanup.c -o cmt/cleanup.o $(CFLAGS) + +cmt/cmdline.o: cmt/cmdline.c + cc -c cmt/cmdline.c -o cmt/cmdline.o $(CFLAGS) + +cmt/cmtcmd.o: cmt/cmtcmd.c + cc -c cmt/cmtcmd.c -o cmt/cmtcmd.o $(CFLAGS) + +cmt/moxc.o: cmt/moxc.c + cc -c cmt/moxc.c -o cmt/moxc.o $(CFLAGS) + +cmt/mem.o: cmt/mem.c + cc -c cmt/mem.c -o cmt/mem.o $(CFLAGS) + +cmt/midifile.o: cmt/midifile.c + cc -c cmt/midifile.c -o cmt/midifile.o $(CFLAGS) + +cmt/midifns.o: cmt/midifns.c + cc -c cmt/midifns.c -o cmt/midifns.o $(CFLAGS) + +cmt/record.o: cmt/record.c + cc -c cmt/record.c -o cmt/record.o $(CFLAGS) + +cmt/seq.o: cmt/seq.c + cc -c cmt/seq.c -o cmt/seq.o $(CFLAGS) + +cmt/seqmread.o: cmt/seqmread.c + cc -c cmt/seqmread.c -o cmt/seqmread.o $(CFLAGS) + +cmt/seqmwrite.o: cmt/seqmwrite.c + cc -c cmt/seqmwrite.c -o cmt/seqmwrite.o $(CFLAGS) + +cmt/seqread.o: cmt/seqread.c + cc -c cmt/seqread.c -o cmt/seqread.o $(CFLAGS) + +cmt/seqwrite.o: cmt/seqwrite.c + cc -c cmt/seqwrite.c -o cmt/seqwrite.o $(CFLAGS) + +cmt/tempomap.o: cmt/tempomap.c + cc -c cmt/tempomap.c -o cmt/tempomap.o $(CFLAGS) + +cmt/timebase.o: cmt/timebase.c + cc -c cmt/timebase.c -o cmt/timebase.o $(CFLAGS) + +cmt/userio.o: cmt/userio.c + cc -c cmt/userio.c -o cmt/userio.o $(CFLAGS) + +sys/unix/osstuff.o: sys/unix/osstuff.c + cc -c sys/unix/osstuff.c -o sys/unix/osstuff.o $(CFLAGS) + +misc/intgen: misc/intgen.c + cd misc; make intgen + +misc/unpacker: misc/unpacker.c misc/convert.c + cd misc; make unpacker + +misc/packer: misc/packer.c misc/convert.c + cd misc; make packer + +nyqsrc/sndfnintptrs.h: $(NYQHDRS) snd/snd.h misc/intgen + $(INTGEN) nyqsrc/sndfnint $(NYQHDRS) + +nyqsrc/seqfnintptrs.h: $(CMTHDRS) misc/intgen + $(INTGEN) nyqsrc/seqfnint $(CMTHDRS) + +clean: + cd misc; make clean + rm -f $(OBJECTS) +# Note that these files are machine-generated: + rm -f nyqsrc/sndfnintptrs.h nyqsrc/sndfnint.c nyqsrc/sndfnintdefs.h + rm -f nyqsrc/seqfnintptrs.h nyqsrc/seqfnint.c nyqsrc/seqfnintdefs.h + +cleaner: clean + cd misc; make cleaner + rm -f *.backup */*.backup + rm -f *~ */*.*~ + rm -f *.save */*.save + rm -f *.CKP */*.CKP + rm -f *.BAK */*.BAK + rm -f *.old */*.old + rm -f *.gold */*.gold + rm -f playparms + rm -f points.dat + +tar: cleaner + sh -v sys/unix/cmu/tar.script + +backup: cleaner + sh -v sys/unix/cmu/backup.script diff --git a/sys/unix/rs6k/plotscript b/sys/unix/rs6k/plotscript new file mode 100644 index 0000000..a26ea60 --- /dev/null +++ b/sys/unix/rs6k/plotscript @@ -0,0 +1,3 @@ +cat $1 | graph | tplot -Ttek +echo "Type ^D to exit" +cat diff --git a/sys/unix/rs6k/system.lsp b/sys/unix/rs6k/system.lsp new file mode 100644 index 0000000..e64e070 --- /dev/null +++ b/sys/unix/rs6k/system.lsp @@ -0,0 +1,80 @@ +; machine.lsp -- machine/system-dependent definitions +; rs6000 + +(if (not (boundp '*default-sf-format*)) + (setf *default-sf-format* snd-head-NeXT)) + +(if (not (boundp '*default-sound-file*)) + (compute-default-sound-file)) + +(if (not (boundp '*default-sf-dir*)) + (setf *default-sf-dir* "/tmp/")) + +(if (not (boundp '*default-sf-mode*)) + (setf *default-sf-mode* snd-mode-pcm)) + +(if (not (boundp '*default-sf-bits*)) + (setf *default-sf-bits* 16)) + +(if (not (boundp '*default-plot-file*)) + (setf *default-plot-file* "points.dat")) + +; turn off switch to play sound as it is computed +(setf *soundenable* nil) + +; local definition for play + +(defmacro play (expr) + `(let () + (s-save-autonorm ,expr NY:ALL *default-sound-file* :play *soundenable*) + (r))) + + +(defun r () + (play-file *default-sound-file*)) + + +; PLAY-FILE -- play a file +(defun play-file (name) + (system (format nil "acpaplay ~A" (soundfilename name)))) + + +; FULL-NAME-P -- test if file name is a full path or relative path +; +; (otherwise the *default-sf-dir* will be prepended +; +(defun full-name-p (filename) + (or (eq (char filename 0) #\/) + (eq (char filename 0) #\.))) + +(setf *file-separator* #\/) + + +; save the standard function to write points to a file +; +(setfn s-plot-points s-plot) + + + +; S-PLOT - plot a small number of points +; +(defun s-plot (&rest args) + (let ((n (soundfilename *default-plot-file*))) + (apply #'s-plot-points args) + (cond ((boundp '*plotscript-file*)) + (t + (format t "*plotscript-file* is unbound, setting it to: \n") + (format t " sys/unix/rs6k/plotscript\n") + (format t "You may need to set it to a full path\n") + (setf *plotscript-file* "sys/unix/rs6k/plotscript"))) + (system (format nil "xterm -t -e ~A ~A" *plotscript-file* n)))) + + +; S-EDIT - run the audio editor on a sound +; +(defmacro s-edit (&optional expr) + `(prog () + (if ,expr (s-save ,expr 1000000000 *default-sound-file*)) + (system (format nil "audio_editor ~A &" + (soundfilename *default-sound-file*))))) + diff --git a/sys/unix/setup b/sys/unix/setup new file mode 100644 index 0000000..06a1ad8 --- /dev/null +++ b/sys/unix/setup @@ -0,0 +1,10 @@ +mkdir cmt demos lib misc nyqsrc runtime sys test tran xlisp +cd sys +mkdir unix mac win +cd unix +mkdir cmu next pmax rs6k sgi sparc +cd .. +cd win +mkdir msvc +cd .. +cd .. diff --git a/sys/unix/sgi/Makefile b/sys/unix/sgi/Makefile new file mode 100644 index 0000000..309bc19 --- /dev/null +++ b/sys/unix/sgi/Makefile @@ -0,0 +1,521 @@ +# +# Makefile for Nyquist, SYSTEM-TYPE is SGI +# run make in the top-level Nyquist directory to compile Nyquist +# +# NOTE: this file is machine-generated. DO NOT EDIT! +# Instead, modify makefile.lsp and regenerate the makefile. +# Ports and bug fixes are welcome - please mail them to +# dannenberg@cs.cmu.edu. Thanks. +# + +# This is the resulting executable (normally "ny"): +NY = ny + +# Standard list of includes (common to all unix versions) +INCL = -Inyqsrc -Itran -Ixlisp -Isys/unix -Icmt -Isnd -Ifft + +# system dependent stuff for sgi: + +CC = cc +CFLAGS = -DCMTSTUFF -g $(INCL) +LN = cc +LFLAGS = -lm +# you would need -lmd if UNIX_IRIX_MIDIFNS were defined in midifns.c + + +INTGEN = misc/intgen + +# Object files for Nyquist: +OBJECTS = xlisp/extern.o xlisp/xldmem.o xlisp/xlbfun.o xlisp/xlcont.o \ + xlisp/xldbug.o xlisp/xleval.o xlisp/xlfio.o xlisp/xlftab.o \ + xlisp/xlglob.o xlisp/xlimage.o xlisp/xlinit.o xlisp/xlio.o \ + xlisp/xlisp.o xlisp/xljump.o xlisp/xllist.o xlisp/xlmath.o \ + xlisp/xlobj.o xlisp/xlpp.o xlisp/xlprin.o xlisp/xlread.o \ + xlisp/xlstr.o xlisp/xlsubr.o xlisp/xlsym.o xlisp/xlsys.o \ + tran/amosc.o tran/clip.o tran/const.o tran/fmosc.o \ + tran/integrate.o tran/log.o tran/maxv.o tran/osc.o \ + tran/prod.o tran/buzz.o tran/pwl.o tran/recip.o \ + tran/upsample.o tran/scale.o tran/sine.o tran/partial.o \ + tran/white.o tran/tone.o tran/tonev.o tran/atonev.o \ + tran/atone.o tran/reson.o tran/areson.o tran/resonvc.o \ + tran/resoncv.o tran/aresonvc.o tran/aresoncv.o tran/resonvv.o \ + tran/aresonvv.o tran/offset.o tran/slope.o tran/delay.o \ + tran/delaycv.o tran/shape.o tran/sampler.o tran/exp.o \ + tran/siosc.o tran/follow.o tran/gate.o tran/quantize.o \ + tran/ifft.o tran/congen.o tran/fromobject.o tran/fromarraystream.o \ + tran/coterm.o tran/convolve.o tran/alpass.o tran/oneshot.o \ + tran/chase.o tran/tapv.o tran/biquad.o tran/pluck.o \ + cmt/cext.o cmt/cleanup.o cmt/cmdline.o cmt/cmtcmd.o \ + cmt/moxc.o cmt/mem.o cmt/midifile.o cmt/midifns.o \ + cmt/record.o cmt/seq.o cmt/seqmread.o cmt/seqmwrite.o \ + cmt/seqread.o cmt/seqwrite.o cmt/tempomap.o cmt/timebase.o \ + cmt/userio.o nyqsrc/debug.o nyqsrc/falloc.o nyqsrc/add.o \ + nyqsrc/local.o nyqsrc/downsample.o nyqsrc/handlers.o nyqsrc/multiread.o \ + nyqsrc/multiseq.o nyqsrc/samples.o nyqsrc/seqext.o nyqsrc/seqinterf.o \ + nyqsrc/sndread.o nyqsrc/sndseq.o nyqsrc/sndwrite.o nyqsrc/sndmax.o \ + nyqsrc/sound.o nyqsrc/stats.o nyqsrc/compose.o nyqsrc/inverse.o \ + nyqsrc/resamp.o nyqsrc/resampv.o nyqsrc/ffilterkit.o nyqsrc/avg.o \ + nyqsrc/fft.o nyqsrc/sndfail.o fft/fftn.o nyqsrc/sndfnint.o \ + nyqsrc/seqfnint.o snd/audiosgi.o snd/sndsgi.o snd/ieeecvt.o \ + snd/snd.o snd/sndcvt.o snd/sndio.o snd/sndheader.o \ + sys/unix/osstuff.o sys/unix/term.o + +# Sound functions to add to xlisp +NYQHDRS = snd/snd.h nyqsrc/sound.h nyqsrc/downsample.h nyqsrc/sndread.h \ + nyqsrc/sndseq.h nyqsrc/add.h nyqsrc/multiseq.h nyqsrc/samples.h \ + nyqsrc/sndwrite.h nyqsrc/sndmax.h nyqsrc/compose.h nyqsrc/inverse.h \ + nyqsrc/resamp.h nyqsrc/resampv.h nyqsrc/fft.h nyqsrc/avg.h \ + tran/amosc.h tran/clip.h tran/const.h tran/fmosc.h \ + tran/integrate.h tran/log.h tran/maxv.h tran/osc.h \ + tran/prod.h tran/buzz.h tran/pwl.h tran/recip.h \ + tran/upsample.h tran/scale.h tran/sine.h tran/partial.h \ + tran/white.h tran/tone.h tran/tonev.h tran/atonev.h \ + tran/atone.h tran/reson.h tran/areson.h tran/resonvc.h \ + tran/resoncv.h tran/aresonvc.h tran/aresoncv.h tran/resonvv.h \ + tran/aresonvv.h tran/offset.h tran/slope.h tran/delaycc.h \ + tran/delaycv.h tran/shape.h tran/sampler.h tran/exp.h \ + tran/siosc.h tran/follow.h tran/gate.h tran/quantize.h \ + tran/ifft.h tran/congen.h tran/fromobject.h tran/fromarraystream.h \ + tran/coterm.h tran/convolve.h tran/alpass.h tran/oneshot.h \ + tran/chase.h tran/tapv.h tran/biquad.h tran/pluck.h + +CMTHDRS = cmt/seqdecls.h nyqsrc/seqext.h cmt/seq.h nyqsrc/seqinterf.h \ + cmt/seqread.h cmt/seqmread.h cmt/seqwrite.h cmt/seqmwrite.h + + +EVERYTHING = $(NY) runtime/system.lsp + +CURRENT = $(EVERYTHING) + +current: $(CURRENT) + +$(NY): $(OBJECTS) + $(LN) $(OBJECTS) $(LFLAGS) -o $(NY) + +# copy appropriate system.lsp and make it read-only; +# changes should be made to sys/unix/<system>/system.lsp +runtime/system.lsp: sys/unix/sgi/system.lsp + chmod +w runtime/system.lsp + cp -p sys/unix/sgi/system.lsp runtime/system.lsp + chmod -w runtime/system.lsp + +nyqsrc/debug.o: nyqsrc/debug.c nyqsrc/debug.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/debug.c -o nyqsrc/debug.o $(CFLAGS) + +nyqsrc/falloc.o: nyqsrc/falloc.c nyqsrc/falloc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/falloc.c -o nyqsrc/falloc.o $(CFLAGS) + +nyqsrc/add.o: nyqsrc/add.c nyqsrc/add.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/add.c -o nyqsrc/add.o $(CFLAGS) + +nyqsrc/local.o: nyqsrc/local.c xlisp/xlisp.h nyqsrc/sound.h + cc -c nyqsrc/local.c -o nyqsrc/local.o $(CFLAGS) + +nyqsrc/downsample.o: nyqsrc/downsample.c nyqsrc/downsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/downsample.c -o nyqsrc/downsample.o $(CFLAGS) + +nyqsrc/handlers.o: nyqsrc/handlers.c + cc -c nyqsrc/handlers.c -o nyqsrc/handlers.o $(CFLAGS) + +nyqsrc/multiread.o: nyqsrc/multiread.c nyqsrc/multiread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/multiread.c -o nyqsrc/multiread.o $(CFLAGS) + +nyqsrc/multiseq.o: nyqsrc/multiseq.c nyqsrc/multiseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/multiseq.c -o nyqsrc/multiseq.o $(CFLAGS) + +nyqsrc/samples.o: nyqsrc/samples.c nyqsrc/samples.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/samples.c -o nyqsrc/samples.o $(CFLAGS) + +nyqsrc/seqext.o: nyqsrc/seqext.c nyqsrc/seqext.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/seqext.c -o nyqsrc/seqext.o $(CFLAGS) + +nyqsrc/seqinterf.o: nyqsrc/seqinterf.c nyqsrc/seqinterf.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/seqinterf.c -o nyqsrc/seqinterf.o $(CFLAGS) + +nyqsrc/sndread.o: nyqsrc/sndread.c nyqsrc/sndread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sndread.c -o nyqsrc/sndread.o $(CFLAGS) + +nyqsrc/sndseq.o: nyqsrc/sndseq.c nyqsrc/sndseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sndseq.c -o nyqsrc/sndseq.o $(CFLAGS) + +nyqsrc/sndwrite.o: nyqsrc/sndwrite.c nyqsrc/sndwrite.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sndwrite.c -o nyqsrc/sndwrite.o $(CFLAGS) + +nyqsrc/sndmax.o: nyqsrc/sndmax.c nyqsrc/sndmax.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sndmax.c -o nyqsrc/sndmax.o $(CFLAGS) + +nyqsrc/sound.o: nyqsrc/sound.c nyqsrc/sound.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sound.c -o nyqsrc/sound.o $(CFLAGS) + +nyqsrc/stats.o: nyqsrc/stats.c nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/stats.c -o nyqsrc/stats.o $(CFLAGS) + +nyqsrc/compose.o: nyqsrc/compose.c nyqsrc/compose.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/compose.c -o nyqsrc/compose.o $(CFLAGS) + +nyqsrc/inverse.o: nyqsrc/inverse.c nyqsrc/inverse.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/inverse.c -o nyqsrc/inverse.o $(CFLAGS) + +nyqsrc/resamp.o: nyqsrc/resamp.c nyqsrc/resamp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/resamp.c -o nyqsrc/resamp.o $(CFLAGS) + +nyqsrc/resampv.o: nyqsrc/resampv.c nyqsrc/resampv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/resampv.c -o nyqsrc/resampv.o $(CFLAGS) + +nyqsrc/ffilterkit.o: nyqsrc/ffilterkit.c nyqsrc/ffilterkit.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/ffilterkit.c -o nyqsrc/ffilterkit.o $(CFLAGS) + +nyqsrc/avg.o: nyqsrc/avg.c nyqsrc/avg.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/avg.c -o nyqsrc/avg.o $(CFLAGS) + +nyqsrc/fft.o: nyqsrc/fft.c nyqsrc/fft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/fft.c -o nyqsrc/fft.o $(CFLAGS) + +nyqsrc/sndfail.o: nyqsrc/sndfail.c + cc -c nyqsrc/sndfail.c -o nyqsrc/sndfail.o $(CFLAGS) + +snd/audiosgi.o: snd/audiosgi.c snd/snd.h + cc -c snd/audiosgi.c -o snd/audiosgi.o $(CFLAGS) + +snd/sndsgi.o: snd/sndsgi.c snd/sndsgi.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c snd/sndsgi.c -o snd/sndsgi.o $(CFLAGS) + +snd/ieeecvt.o: snd/ieeecvt.c snd/ieeecvt.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c snd/ieeecvt.c -o snd/ieeecvt.o $(CFLAGS) + +snd/snd.o: snd/snd.c snd/snd.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c snd/snd.c -o snd/snd.o $(CFLAGS) + +snd/sndcvt.o: snd/sndcvt.c snd/snd.h + cc -c snd/sndcvt.c -o snd/sndcvt.o $(CFLAGS) + +snd/sndio.o: snd/sndio.c snd/snd.h + cc -c snd/sndio.c -o snd/sndio.o $(CFLAGS) + +snd/sndheader.o: snd/sndheader.c snd/sndheader.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c snd/sndheader.c -o snd/sndheader.o $(CFLAGS) + +fft/fftn.o: fft/fftn.c fft/fftn.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c fft/fftn.c -o fft/fftn.o $(CFLAGS) + +tran/amosc.o: tran/amosc.c tran/amosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/amosc.c -o tran/amosc.o $(CFLAGS) + +tran/clip.o: tran/clip.c tran/clip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/clip.c -o tran/clip.o $(CFLAGS) + +tran/const.o: tran/const.c tran/const.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/const.c -o tran/const.o $(CFLAGS) + +tran/fmosc.o: tran/fmosc.c tran/fmosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/fmosc.c -o tran/fmosc.o $(CFLAGS) + +tran/integrate.o: tran/integrate.c tran/integrate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/integrate.c -o tran/integrate.o $(CFLAGS) + +tran/log.o: tran/log.c tran/log.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/log.c -o tran/log.o $(CFLAGS) + +tran/maxv.o: tran/maxv.c tran/maxv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/maxv.c -o tran/maxv.o $(CFLAGS) + +tran/osc.o: tran/osc.c tran/osc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/osc.c -o tran/osc.o $(CFLAGS) + +tran/prod.o: tran/prod.c tran/prod.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/prod.c -o tran/prod.o $(CFLAGS) + +tran/buzz.o: tran/buzz.c tran/buzz.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/buzz.c -o tran/buzz.o $(CFLAGS) + +tran/pwl.o: tran/pwl.c tran/pwl.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/pwl.c -o tran/pwl.o $(CFLAGS) + +tran/recip.o: tran/recip.c tran/recip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/recip.c -o tran/recip.o $(CFLAGS) + +tran/upsample.o: tran/upsample.c tran/upsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/upsample.c -o tran/upsample.o $(CFLAGS) + +tran/scale.o: tran/scale.c tran/scale.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/scale.c -o tran/scale.o $(CFLAGS) + +tran/sine.o: tran/sine.c tran/sine.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/sine.c -o tran/sine.o $(CFLAGS) + +tran/partial.o: tran/partial.c tran/partial.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/partial.c -o tran/partial.o $(CFLAGS) + +tran/white.o: tran/white.c tran/white.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/white.c -o tran/white.o $(CFLAGS) + +tran/tone.o: tran/tone.c tran/tone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/tone.c -o tran/tone.o $(CFLAGS) + +tran/tonev.o: tran/tonev.c tran/tonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/tonev.c -o tran/tonev.o $(CFLAGS) + +tran/atonev.o: tran/atonev.c tran/atonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/atonev.c -o tran/atonev.o $(CFLAGS) + +tran/atone.o: tran/atone.c tran/atone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/atone.c -o tran/atone.o $(CFLAGS) + +tran/reson.o: tran/reson.c tran/reson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/reson.c -o tran/reson.o $(CFLAGS) + +tran/areson.o: tran/areson.c tran/areson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/areson.c -o tran/areson.o $(CFLAGS) + +tran/resonvc.o: tran/resonvc.c tran/resonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/resonvc.c -o tran/resonvc.o $(CFLAGS) + +tran/resoncv.o: tran/resoncv.c tran/resoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/resoncv.c -o tran/resoncv.o $(CFLAGS) + +tran/aresonvc.o: tran/aresonvc.c tran/aresonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/aresonvc.c -o tran/aresonvc.o $(CFLAGS) + +tran/aresoncv.o: tran/aresoncv.c tran/aresoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/aresoncv.c -o tran/aresoncv.o $(CFLAGS) + +tran/resonvv.o: tran/resonvv.c tran/resonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/resonvv.c -o tran/resonvv.o $(CFLAGS) + +tran/aresonvv.o: tran/aresonvv.c tran/aresonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/aresonvv.c -o tran/aresonvv.o $(CFLAGS) + +tran/offset.o: tran/offset.c tran/offset.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/offset.c -o tran/offset.o $(CFLAGS) + +tran/slope.o: tran/slope.c tran/slope.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/slope.c -o tran/slope.o $(CFLAGS) + +tran/delaycc.o: tran/delaycc.c tran/delaycc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/delaycc.c -o tran/delaycc.o $(CFLAGS) + +tran/delaycv.o: tran/delaycv.c tran/delaycv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/delaycv.c -o tran/delaycv.o $(CFLAGS) + +tran/shape.o: tran/shape.c tran/shape.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/shape.c -o tran/shape.o $(CFLAGS) + +tran/sampler.o: tran/sampler.c tran/sampler.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/sampler.c -o tran/sampler.o $(CFLAGS) + +tran/exp.o: tran/exp.c tran/exp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/exp.c -o tran/exp.o $(CFLAGS) + +tran/siosc.o: tran/siosc.c tran/siosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/siosc.c -o tran/siosc.o $(CFLAGS) + +tran/follow.o: tran/follow.c tran/follow.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/follow.c -o tran/follow.o $(CFLAGS) + +tran/gate.o: tran/gate.c tran/gate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/gate.c -o tran/gate.o $(CFLAGS) + +tran/quantize.o: tran/quantize.c tran/quantize.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/quantize.c -o tran/quantize.o $(CFLAGS) + +tran/ifft.o: tran/ifft.c tran/ifft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/ifft.c -o tran/ifft.o $(CFLAGS) + +tran/congen.o: tran/congen.c tran/congen.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/congen.c -o tran/congen.o $(CFLAGS) + +tran/fromobject.o: tran/fromobject.c tran/fromobject.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/fromobject.c -o tran/fromobject.o $(CFLAGS) + +tran/fromarraystream.o: tran/fromarraystream.c tran/fromarraystream.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/fromarraystream.c -o tran/fromarraystream.o $(CFLAGS) + +tran/coterm.o: tran/coterm.c tran/coterm.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/coterm.c -o tran/coterm.o $(CFLAGS) + +tran/convolve.o: tran/convolve.c tran/convolve.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/convolve.c -o tran/convolve.o $(CFLAGS) + +tran/alpass.o: tran/alpass.c tran/alpass.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/alpass.c -o tran/alpass.o $(CFLAGS) + +tran/oneshot.o: tran/oneshot.c tran/oneshot.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/oneshot.c -o tran/oneshot.o $(CFLAGS) + +tran/chase.o: tran/chase.c tran/chase.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/chase.c -o tran/chase.o $(CFLAGS) + +tran/tapv.o: tran/tapv.c tran/tapv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/tapv.c -o tran/tapv.o $(CFLAGS) + +tran/biquad.o: tran/biquad.c tran/biquad.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/biquad.c -o tran/biquad.o $(CFLAGS) + +tran/pluck.o: tran/pluck.c tran/pluck.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/pluck.c -o tran/pluck.o $(CFLAGS) + +nyqsrc/sndfnint.o: nyqsrc/sndfnint.c + cc -c nyqsrc/sndfnint.c -o nyqsrc/sndfnint.o $(CFLAGS) + +nyqsrc/seqfnint.o: nyqsrc/seqfnint.c + cc -c nyqsrc/seqfnint.c -o nyqsrc/seqfnint.o $(CFLAGS) + +xlisp/xlftab.o: nyqsrc/sndfnintptrs.h nyqsrc/sndfnintdefs.h nyqsrc/seqfnintptrs.h nyqsrc/seqfnintdefs.h + cc -c xlisp/xlftab.c -o xlisp/xlftab.o $(CFLAGS) + +xlisp/extern.o: xlisp/extern.c + cc -c xlisp/extern.c -o xlisp/extern.o $(CFLAGS) + +xlisp/xldmem.o: xlisp/xldmem.c + cc -c xlisp/xldmem.c -o xlisp/xldmem.o $(CFLAGS) + +xlisp/xlbfun.o: xlisp/xlbfun.c + cc -c xlisp/xlbfun.c -o xlisp/xlbfun.o $(CFLAGS) + +xlisp/xlcont.o: xlisp/xlcont.c + cc -c xlisp/xlcont.c -o xlisp/xlcont.o $(CFLAGS) + +xlisp/xldbug.o: xlisp/xldbug.c + cc -c xlisp/xldbug.c -o xlisp/xldbug.o $(CFLAGS) + +xlisp/xleval.o: xlisp/xleval.c + cc -c xlisp/xleval.c -o xlisp/xleval.o $(CFLAGS) + +xlisp/xlfio.o: xlisp/xlfio.c + cc -c xlisp/xlfio.c -o xlisp/xlfio.o $(CFLAGS) + +xlisp/xlglob.o: xlisp/xlglob.c + cc -c xlisp/xlglob.c -o xlisp/xlglob.o $(CFLAGS) + +xlisp/xlimage.o: xlisp/xlimage.c + cc -c xlisp/xlimage.c -o xlisp/xlimage.o $(CFLAGS) + +xlisp/xlinit.o: xlisp/xlinit.c + cc -c xlisp/xlinit.c -o xlisp/xlinit.o $(CFLAGS) + +xlisp/xlio.o: xlisp/xlio.c + cc -c xlisp/xlio.c -o xlisp/xlio.o $(CFLAGS) + +xlisp/xlisp.o: xlisp/xlisp.c + cc -c xlisp/xlisp.c -o xlisp/xlisp.o $(CFLAGS) + +xlisp/xljump.o: xlisp/xljump.c + cc -c xlisp/xljump.c -o xlisp/xljump.o $(CFLAGS) + +xlisp/xllist.o: xlisp/xllist.c + cc -c xlisp/xllist.c -o xlisp/xllist.o $(CFLAGS) + +xlisp/xlmath.o: xlisp/xlmath.c + cc -c xlisp/xlmath.c -o xlisp/xlmath.o $(CFLAGS) + +xlisp/xlobj.o: xlisp/xlobj.c + cc -c xlisp/xlobj.c -o xlisp/xlobj.o $(CFLAGS) + +xlisp/xlpp.o: xlisp/xlpp.c + cc -c xlisp/xlpp.c -o xlisp/xlpp.o $(CFLAGS) + +xlisp/xlprin.o: xlisp/xlprin.c + cc -c xlisp/xlprin.c -o xlisp/xlprin.o $(CFLAGS) + +xlisp/xlread.o: xlisp/xlread.c + cc -c xlisp/xlread.c -o xlisp/xlread.o $(CFLAGS) + +xlisp/xlstr.o: xlisp/xlstr.c + cc -c xlisp/xlstr.c -o xlisp/xlstr.o $(CFLAGS) + +xlisp/xlsubr.o: xlisp/xlsubr.c + cc -c xlisp/xlsubr.c -o xlisp/xlsubr.o $(CFLAGS) + +xlisp/xlsym.o: xlisp/xlsym.c + cc -c xlisp/xlsym.c -o xlisp/xlsym.o $(CFLAGS) + +xlisp/xlsys.o: xlisp/xlsys.c + cc -c xlisp/xlsys.c -o xlisp/xlsys.o $(CFLAGS) + +cmt/cext.o: cmt/cext.c + cc -c cmt/cext.c -o cmt/cext.o $(CFLAGS) + +cmt/cleanup.o: cmt/cleanup.c + cc -c cmt/cleanup.c -o cmt/cleanup.o $(CFLAGS) + +cmt/cmdline.o: cmt/cmdline.c + cc -c cmt/cmdline.c -o cmt/cmdline.o $(CFLAGS) + +cmt/cmtcmd.o: cmt/cmtcmd.c + cc -c cmt/cmtcmd.c -o cmt/cmtcmd.o $(CFLAGS) + +cmt/moxc.o: cmt/moxc.c + cc -c cmt/moxc.c -o cmt/moxc.o $(CFLAGS) + +cmt/mem.o: cmt/mem.c + cc -c cmt/mem.c -o cmt/mem.o $(CFLAGS) + +cmt/midifile.o: cmt/midifile.c + cc -c cmt/midifile.c -o cmt/midifile.o $(CFLAGS) + +cmt/midifns.o: cmt/midifns.c + cc -c cmt/midifns.c -o cmt/midifns.o $(CFLAGS) + +cmt/record.o: cmt/record.c + cc -c cmt/record.c -o cmt/record.o $(CFLAGS) + +cmt/seq.o: cmt/seq.c + cc -c cmt/seq.c -o cmt/seq.o $(CFLAGS) + +cmt/seqmread.o: cmt/seqmread.c + cc -c cmt/seqmread.c -o cmt/seqmread.o $(CFLAGS) + +cmt/seqmwrite.o: cmt/seqmwrite.c + cc -c cmt/seqmwrite.c -o cmt/seqmwrite.o $(CFLAGS) + +cmt/seqread.o: cmt/seqread.c + cc -c cmt/seqread.c -o cmt/seqread.o $(CFLAGS) + +cmt/seqwrite.o: cmt/seqwrite.c + cc -c cmt/seqwrite.c -o cmt/seqwrite.o $(CFLAGS) + +cmt/tempomap.o: cmt/tempomap.c + cc -c cmt/tempomap.c -o cmt/tempomap.o $(CFLAGS) + +cmt/timebase.o: cmt/timebase.c + cc -c cmt/timebase.c -o cmt/timebase.o $(CFLAGS) + +cmt/userio.o: cmt/userio.c + cc -c cmt/userio.c -o cmt/userio.o $(CFLAGS) + +sys/unix/osstuff.o: sys/unix/osstuff.c + cc -c sys/unix/osstuff.c -o sys/unix/osstuff.o $(CFLAGS) + +misc/intgen: misc/intgen.c + cd misc; make intgen + +misc/unpacker: misc/unpacker.c misc/convert.c + cd misc; make unpacker + +misc/packer: misc/packer.c misc/convert.c + cd misc; make packer + +nyqsrc/sndfnintptrs.h: $(NYQHDRS) snd/snd.h misc/intgen + $(INTGEN) nyqsrc/sndfnint $(NYQHDRS) + +nyqsrc/seqfnintptrs.h: $(CMTHDRS) misc/intgen + $(INTGEN) nyqsrc/seqfnint $(CMTHDRS) + +clean: + cd misc; make clean + rm -f $(OBJECTS) +# Note that these files are machine-generated: + rm -f nyqsrc/sndfnintptrs.h nyqsrc/sndfnint.c nyqsrc/sndfnintdefs.h + rm -f nyqsrc/seqfnintptrs.h nyqsrc/seqfnint.c nyqsrc/seqfnintdefs.h + +cleaner: clean + cd misc; make cleaner + rm -f *.backup */*.backup + rm -f *~ */*.*~ + rm -f *.save */*.save + rm -f *.CKP */*.CKP + rm -f *.BAK */*.BAK + rm -f *.old */*.old + rm -f *.gold */*.gold + rm -f playparms + rm -f points.dat diff --git a/sys/unix/sgi/system.lsp b/sys/unix/sgi/system.lsp new file mode 100644 index 0000000..062a62f --- /dev/null +++ b/sys/unix/sgi/system.lsp @@ -0,0 +1,46 @@ +; machine.lsp -- machine/system-dependent definitions +; SGI/IRIX + +(if (not (boundp '*default-sf-format*)) + (setf *default-sf-format* snd-head-AIFF)) + +(if (not (boundp '*default-sound-file*)) + (compute-default-sound-file)) + +(if (not (boundp '*default-sf-dir*)) + (setf *default-sf-dir* "/tmp/")) + +(if (not (boundp '*default-sf-mode*)) + (setf *default-sf-mode* snd-mode-pcm)) + +(if (not (boundp '*default-sf-bits*)) + (setf *default-sf-bits* 16)) + +(if (not (boundp '*default-plot-file*)) + (setf *default-plot-file* "points.dat")) + +(defmacro play (expr) + `(let () + (s-save-autonorm ,expr NY:ALL *default-sound-file* :play *soundenable*) + (r))) + +(defun r () + (play-file *default-sound-file*)) + +; PLAY-FILE -- play a file +(defun play-file (name) + (system (strcat "sfplay " (soundfilename name)))) + + +; FULL-NAME-P -- test if file name is a full path or relative path +; +; (otherwise the *default-sf-dir* will be prepended +; +(defun full-name-p (filename) + (or (eq (char filename 0) #\/) + (eq (char filename 0) #\.))) + +(setf *file-separator* #\/) + +(sound-off) ; sgi implementation does not support real-time audio output yet + diff --git a/sys/unix/sndsystem.h b/sys/unix/sndsystem.h new file mode 100644 index 0000000..be8e49c --- /dev/null +++ b/sys/unix/sndsystem.h @@ -0,0 +1,41 @@ +/* sndsystem.h -- system-specific definitions */ +/* + NOTES: you need a different sndswitches.h for each implementation, so +this is a separate file. Things you need to define here: + +1) Either UNIX, WIN32, or MACINTOSH should be defined. + +2) Either the following function declaration: + void snd_fail(char *msg); +or + #define snd_fail(msg) ... + +3) typedef FASTFLOAT to be either a double or a float, whichever +computes faster (PowerPCs are faster at double math than float math) + +4) typedef MEMFLOAT to be how you would store a sample in memory +(this should normally be float) + +5) min() must be defined (either a macro or a function) + +6) max() must be defined (either a macro or a function) + +*/ + +#define UNIX + +#define snd_fail(msg) xlfail(msg) +#define snd_warn(msg) errputstr(msg) +typedef double FASTFLOAT; +typedef float MEMFLOAT; + +/* avoid conflict with Windows */ +#ifndef max + +/* min(n, sizeof(long)) doesn't work on RS6K without this: + * (I never tracked down what min() was called and what was wrong.) + */ +#define min(a, b) ((a) < (b) ? (a) : (b)) +#define max(a, b) ((a) > (b) ? (a) : (b)) + +#endif diff --git a/sys/unix/sparc/Makefile b/sys/unix/sparc/Makefile new file mode 100644 index 0000000..5a0fba2 --- /dev/null +++ b/sys/unix/sparc/Makefile @@ -0,0 +1,520 @@ +# +# Makefile for Nyquist, SYSTEM-TYPE is SPARC +# run make in the top-level Nyquist directory to compile Nyquist +# +# NOTE: this file is machine-generated. DO NOT EDIT! +# Instead, modify makefile.lsp and regenerate the makefile. +# Ports and bug fixes are welcome - please mail them to +# dannenberg@cs.cmu.edu. Thanks. +# + +# This is the resulting executable (normally "ny"): +NY = ny + +# Standard list of includes (common to all unix versions) +INCL = -Inyqsrc -Itran -Ixlisp -Isys/unix -Icmt -Isnd -Ifft + +# system dependent stuff for sparc: + +CC = gcc +CFLAGS = -DCMTSTUFF -g $(INCL) +LN = $(CC) +LFLAGS = -lm + + +INTGEN = misc/intgen + +# Object files for Nyquist: +OBJECTS = xlisp/extern.o xlisp/xldmem.o xlisp/xlbfun.o xlisp/xlcont.o \ + xlisp/xldbug.o xlisp/xleval.o xlisp/xlfio.o xlisp/xlftab.o \ + xlisp/xlglob.o xlisp/xlimage.o xlisp/xlinit.o xlisp/xlio.o \ + xlisp/xlisp.o xlisp/xljump.o xlisp/xllist.o xlisp/xlmath.o \ + xlisp/xlobj.o xlisp/xlpp.o xlisp/xlprin.o xlisp/xlread.o \ + xlisp/xlstr.o xlisp/xlsubr.o xlisp/xlsym.o xlisp/xlsys.o \ + tran/amosc.o tran/clip.o tran/const.o tran/fmosc.o \ + tran/integrate.o tran/log.o tran/maxv.o tran/osc.o \ + tran/prod.o tran/buzz.o tran/pwl.o tran/recip.o \ + tran/upsample.o tran/scale.o tran/sine.o tran/partial.o \ + tran/white.o tran/tone.o tran/tonev.o tran/atonev.o \ + tran/atone.o tran/reson.o tran/areson.o tran/resonvc.o \ + tran/resoncv.o tran/aresonvc.o tran/aresoncv.o tran/resonvv.o \ + tran/aresonvv.o tran/offset.o tran/slope.o tran/delay.o \ + tran/delaycv.o tran/shape.o tran/sampler.o tran/exp.o \ + tran/siosc.o tran/follow.o tran/gate.o tran/quantize.o \ + tran/ifft.o tran/congen.o tran/fromobject.o tran/fromarraystream.o \ + tran/coterm.o tran/convolve.o tran/alpass.o tran/oneshot.o \ + tran/chase.o tran/tapv.o tran/biquad.o tran/pluck.o \ + cmt/cext.o cmt/cleanup.o cmt/cmdline.o cmt/cmtcmd.o \ + cmt/moxc.o cmt/mem.o cmt/midifile.o cmt/midifns.o \ + cmt/record.o cmt/seq.o cmt/seqmread.o cmt/seqmwrite.o \ + cmt/seqread.o cmt/seqwrite.o cmt/tempomap.o cmt/timebase.o \ + cmt/userio.o nyqsrc/debug.o nyqsrc/falloc.o nyqsrc/add.o \ + nyqsrc/local.o nyqsrc/downsample.o nyqsrc/handlers.o nyqsrc/multiread.o \ + nyqsrc/multiseq.o nyqsrc/samples.o nyqsrc/seqext.o nyqsrc/seqinterf.o \ + nyqsrc/sndread.o nyqsrc/sndseq.o nyqsrc/sndwrite.o nyqsrc/sndmax.o \ + nyqsrc/sound.o nyqsrc/stats.o nyqsrc/compose.o nyqsrc/inverse.o \ + nyqsrc/resamp.o nyqsrc/resampv.o nyqsrc/ffilterkit.o nyqsrc/avg.o \ + nyqsrc/fft.o nyqsrc/sndfail.o fft/fftn.o nyqsrc/sndfnint.o \ + nyqsrc/seqfnint.o snd/audiosparc.o snd/sndsparc.o snd/ieeecvt.o \ + snd/snd.o snd/sndcvt.o snd/sndio.o snd/sndheader.o \ + sys/unix/osstuff.o sys/unix/term.o + +# Sound functions to add to xlisp +NYQHDRS = snd/snd.h nyqsrc/sound.h nyqsrc/downsample.h nyqsrc/sndread.h \ + nyqsrc/sndseq.h nyqsrc/add.h nyqsrc/multiseq.h nyqsrc/samples.h \ + nyqsrc/sndwrite.h nyqsrc/sndmax.h nyqsrc/compose.h nyqsrc/inverse.h \ + nyqsrc/resamp.h nyqsrc/resampv.h nyqsrc/fft.h nyqsrc/avg.h \ + tran/amosc.h tran/clip.h tran/const.h tran/fmosc.h \ + tran/integrate.h tran/log.h tran/maxv.h tran/osc.h \ + tran/prod.h tran/buzz.h tran/pwl.h tran/recip.h \ + tran/upsample.h tran/scale.h tran/sine.h tran/partial.h \ + tran/white.h tran/tone.h tran/tonev.h tran/atonev.h \ + tran/atone.h tran/reson.h tran/areson.h tran/resonvc.h \ + tran/resoncv.h tran/aresonvc.h tran/aresoncv.h tran/resonvv.h \ + tran/aresonvv.h tran/offset.h tran/slope.h tran/delaycc.h \ + tran/delaycv.h tran/shape.h tran/sampler.h tran/exp.h \ + tran/siosc.h tran/follow.h tran/gate.h tran/quantize.h \ + tran/ifft.h tran/congen.h tran/fromobject.h tran/fromarraystream.h \ + tran/coterm.h tran/convolve.h tran/alpass.h tran/oneshot.h \ + tran/chase.h tran/tapv.h tran/biquad.h tran/pluck.h + +CMTHDRS = cmt/seqdecls.h nyqsrc/seqext.h cmt/seq.h nyqsrc/seqinterf.h \ + cmt/seqread.h cmt/seqmread.h cmt/seqwrite.h cmt/seqmwrite.h + + +EVERYTHING = $(NY) runtime/system.lsp + +CURRENT = $(EVERYTHING) + +current: $(CURRENT) + +$(NY): $(OBJECTS) + $(LN) $(OBJECTS) $(LFLAGS) -o $(NY) + +# copy appropriate system.lsp and make it read-only; +# changes should be made to sys/unix/<system>/system.lsp +runtime/system.lsp: sys/unix/sparc/system.lsp + chmod +w runtime/system.lsp + cp -p sys/unix/sparc/system.lsp runtime/system.lsp + chmod -w runtime/system.lsp + +nyqsrc/debug.o: nyqsrc/debug.c nyqsrc/debug.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/debug.c -o nyqsrc/debug.o $(CFLAGS) + +nyqsrc/falloc.o: nyqsrc/falloc.c nyqsrc/falloc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/falloc.c -o nyqsrc/falloc.o $(CFLAGS) + +nyqsrc/add.o: nyqsrc/add.c nyqsrc/add.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/add.c -o nyqsrc/add.o $(CFLAGS) + +nyqsrc/local.o: nyqsrc/local.c xlisp/xlisp.h nyqsrc/sound.h + cc -c nyqsrc/local.c -o nyqsrc/local.o $(CFLAGS) + +nyqsrc/downsample.o: nyqsrc/downsample.c nyqsrc/downsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/downsample.c -o nyqsrc/downsample.o $(CFLAGS) + +nyqsrc/handlers.o: nyqsrc/handlers.c + cc -c nyqsrc/handlers.c -o nyqsrc/handlers.o $(CFLAGS) + +nyqsrc/multiread.o: nyqsrc/multiread.c nyqsrc/multiread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/multiread.c -o nyqsrc/multiread.o $(CFLAGS) + +nyqsrc/multiseq.o: nyqsrc/multiseq.c nyqsrc/multiseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/multiseq.c -o nyqsrc/multiseq.o $(CFLAGS) + +nyqsrc/samples.o: nyqsrc/samples.c nyqsrc/samples.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/samples.c -o nyqsrc/samples.o $(CFLAGS) + +nyqsrc/seqext.o: nyqsrc/seqext.c nyqsrc/seqext.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/seqext.c -o nyqsrc/seqext.o $(CFLAGS) + +nyqsrc/seqinterf.o: nyqsrc/seqinterf.c nyqsrc/seqinterf.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/seqinterf.c -o nyqsrc/seqinterf.o $(CFLAGS) + +nyqsrc/sndread.o: nyqsrc/sndread.c nyqsrc/sndread.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sndread.c -o nyqsrc/sndread.o $(CFLAGS) + +nyqsrc/sndseq.o: nyqsrc/sndseq.c nyqsrc/sndseq.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sndseq.c -o nyqsrc/sndseq.o $(CFLAGS) + +nyqsrc/sndwrite.o: nyqsrc/sndwrite.c nyqsrc/sndwrite.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sndwrite.c -o nyqsrc/sndwrite.o $(CFLAGS) + +nyqsrc/sndmax.o: nyqsrc/sndmax.c nyqsrc/sndmax.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sndmax.c -o nyqsrc/sndmax.o $(CFLAGS) + +nyqsrc/sound.o: nyqsrc/sound.c nyqsrc/sound.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/sound.c -o nyqsrc/sound.o $(CFLAGS) + +nyqsrc/stats.o: nyqsrc/stats.c nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/stats.c -o nyqsrc/stats.o $(CFLAGS) + +nyqsrc/compose.o: nyqsrc/compose.c nyqsrc/compose.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/compose.c -o nyqsrc/compose.o $(CFLAGS) + +nyqsrc/inverse.o: nyqsrc/inverse.c nyqsrc/inverse.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/inverse.c -o nyqsrc/inverse.o $(CFLAGS) + +nyqsrc/resamp.o: nyqsrc/resamp.c nyqsrc/resamp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/resamp.c -o nyqsrc/resamp.o $(CFLAGS) + +nyqsrc/resampv.o: nyqsrc/resampv.c nyqsrc/resampv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/resampv.c -o nyqsrc/resampv.o $(CFLAGS) + +nyqsrc/ffilterkit.o: nyqsrc/ffilterkit.c nyqsrc/ffilterkit.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/ffilterkit.c -o nyqsrc/ffilterkit.o $(CFLAGS) + +nyqsrc/avg.o: nyqsrc/avg.c nyqsrc/avg.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/avg.c -o nyqsrc/avg.o $(CFLAGS) + +nyqsrc/fft.o: nyqsrc/fft.c nyqsrc/fft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c nyqsrc/fft.c -o nyqsrc/fft.o $(CFLAGS) + +nyqsrc/sndfail.o: nyqsrc/sndfail.c + cc -c nyqsrc/sndfail.c -o nyqsrc/sndfail.o $(CFLAGS) + +snd/audiosparc.o: snd/audiosparc.c snd/snd.h + cc -c snd/audiosparc.c -o snd/audiosparc.o $(CFLAGS) + +snd/sndsparc.o: snd/sndsparc.c snd/sndsparc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c snd/sndsparc.c -o snd/sndsparc.o $(CFLAGS) + +snd/ieeecvt.o: snd/ieeecvt.c snd/ieeecvt.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c snd/ieeecvt.c -o snd/ieeecvt.o $(CFLAGS) + +snd/snd.o: snd/snd.c snd/snd.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c snd/snd.c -o snd/snd.o $(CFLAGS) + +snd/sndcvt.o: snd/sndcvt.c snd/snd.h + cc -c snd/sndcvt.c -o snd/sndcvt.o $(CFLAGS) + +snd/sndio.o: snd/sndio.c snd/snd.h + cc -c snd/sndio.c -o snd/sndio.o $(CFLAGS) + +snd/sndheader.o: snd/sndheader.c snd/sndheader.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c snd/sndheader.c -o snd/sndheader.o $(CFLAGS) + +fft/fftn.o: fft/fftn.c fft/fftn.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c fft/fftn.c -o fft/fftn.o $(CFLAGS) + +tran/amosc.o: tran/amosc.c tran/amosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/amosc.c -o tran/amosc.o $(CFLAGS) + +tran/clip.o: tran/clip.c tran/clip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/clip.c -o tran/clip.o $(CFLAGS) + +tran/const.o: tran/const.c tran/const.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/const.c -o tran/const.o $(CFLAGS) + +tran/fmosc.o: tran/fmosc.c tran/fmosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/fmosc.c -o tran/fmosc.o $(CFLAGS) + +tran/integrate.o: tran/integrate.c tran/integrate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/integrate.c -o tran/integrate.o $(CFLAGS) + +tran/log.o: tran/log.c tran/log.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/log.c -o tran/log.o $(CFLAGS) + +tran/maxv.o: tran/maxv.c tran/maxv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/maxv.c -o tran/maxv.o $(CFLAGS) + +tran/osc.o: tran/osc.c tran/osc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/osc.c -o tran/osc.o $(CFLAGS) + +tran/prod.o: tran/prod.c tran/prod.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/prod.c -o tran/prod.o $(CFLAGS) + +tran/buzz.o: tran/buzz.c tran/buzz.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/buzz.c -o tran/buzz.o $(CFLAGS) + +tran/pwl.o: tran/pwl.c tran/pwl.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/pwl.c -o tran/pwl.o $(CFLAGS) + +tran/recip.o: tran/recip.c tran/recip.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/recip.c -o tran/recip.o $(CFLAGS) + +tran/upsample.o: tran/upsample.c tran/upsample.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/upsample.c -o tran/upsample.o $(CFLAGS) + +tran/scale.o: tran/scale.c tran/scale.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/scale.c -o tran/scale.o $(CFLAGS) + +tran/sine.o: tran/sine.c tran/sine.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/sine.c -o tran/sine.o $(CFLAGS) + +tran/partial.o: tran/partial.c tran/partial.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/partial.c -o tran/partial.o $(CFLAGS) + +tran/white.o: tran/white.c tran/white.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/white.c -o tran/white.o $(CFLAGS) + +tran/tone.o: tran/tone.c tran/tone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/tone.c -o tran/tone.o $(CFLAGS) + +tran/tonev.o: tran/tonev.c tran/tonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/tonev.c -o tran/tonev.o $(CFLAGS) + +tran/atonev.o: tran/atonev.c tran/atonev.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/atonev.c -o tran/atonev.o $(CFLAGS) + +tran/atone.o: tran/atone.c tran/atone.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/atone.c -o tran/atone.o $(CFLAGS) + +tran/reson.o: tran/reson.c tran/reson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/reson.c -o tran/reson.o $(CFLAGS) + +tran/areson.o: tran/areson.c tran/areson.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/areson.c -o tran/areson.o $(CFLAGS) + +tran/resonvc.o: tran/resonvc.c tran/resonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/resonvc.c -o tran/resonvc.o $(CFLAGS) + +tran/resoncv.o: tran/resoncv.c tran/resoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/resoncv.c -o tran/resoncv.o $(CFLAGS) + +tran/aresonvc.o: tran/aresonvc.c tran/aresonvc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/aresonvc.c -o tran/aresonvc.o $(CFLAGS) + +tran/aresoncv.o: tran/aresoncv.c tran/aresoncv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/aresoncv.c -o tran/aresoncv.o $(CFLAGS) + +tran/resonvv.o: tran/resonvv.c tran/resonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/resonvv.c -o tran/resonvv.o $(CFLAGS) + +tran/aresonvv.o: tran/aresonvv.c tran/aresonvv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/aresonvv.c -o tran/aresonvv.o $(CFLAGS) + +tran/offset.o: tran/offset.c tran/offset.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/offset.c -o tran/offset.o $(CFLAGS) + +tran/slope.o: tran/slope.c tran/slope.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/slope.c -o tran/slope.o $(CFLAGS) + +tran/delaycc.o: tran/delaycc.c tran/delaycc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/delaycc.c -o tran/delaycc.o $(CFLAGS) + +tran/delaycv.o: tran/delaycv.c tran/delaycv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/delaycv.c -o tran/delaycv.o $(CFLAGS) + +tran/shape.o: tran/shape.c tran/shape.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/shape.c -o tran/shape.o $(CFLAGS) + +tran/sampler.o: tran/sampler.c tran/sampler.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/sampler.c -o tran/sampler.o $(CFLAGS) + +tran/exp.o: tran/exp.c tran/exp.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/exp.c -o tran/exp.o $(CFLAGS) + +tran/siosc.o: tran/siosc.c tran/siosc.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/siosc.c -o tran/siosc.o $(CFLAGS) + +tran/follow.o: tran/follow.c tran/follow.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/follow.c -o tran/follow.o $(CFLAGS) + +tran/gate.o: tran/gate.c tran/gate.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/gate.c -o tran/gate.o $(CFLAGS) + +tran/quantize.o: tran/quantize.c tran/quantize.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/quantize.c -o tran/quantize.o $(CFLAGS) + +tran/ifft.o: tran/ifft.c tran/ifft.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/ifft.c -o tran/ifft.o $(CFLAGS) + +tran/congen.o: tran/congen.c tran/congen.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/congen.c -o tran/congen.o $(CFLAGS) + +tran/fromobject.o: tran/fromobject.c tran/fromobject.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/fromobject.c -o tran/fromobject.o $(CFLAGS) + +tran/fromarraystream.o: tran/fromarraystream.c tran/fromarraystream.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/fromarraystream.c -o tran/fromarraystream.o $(CFLAGS) + +tran/coterm.o: tran/coterm.c tran/coterm.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/coterm.c -o tran/coterm.o $(CFLAGS) + +tran/convolve.o: tran/convolve.c tran/convolve.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/convolve.c -o tran/convolve.o $(CFLAGS) + +tran/alpass.o: tran/alpass.c tran/alpass.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/alpass.c -o tran/alpass.o $(CFLAGS) + +tran/oneshot.o: tran/oneshot.c tran/oneshot.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/oneshot.c -o tran/oneshot.o $(CFLAGS) + +tran/chase.o: tran/chase.c tran/chase.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/chase.c -o tran/chase.o $(CFLAGS) + +tran/tapv.o: tran/tapv.c tran/tapv.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/tapv.c -o tran/tapv.o $(CFLAGS) + +tran/biquad.o: tran/biquad.c tran/biquad.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/biquad.c -o tran/biquad.o $(CFLAGS) + +tran/pluck.o: tran/pluck.c tran/pluck.h nyqsrc/sound.h nyqsrc/falloc.h nyqsrc/cque.h + cc -c tran/pluck.c -o tran/pluck.o $(CFLAGS) + +nyqsrc/sndfnint.o: nyqsrc/sndfnint.c + cc -c nyqsrc/sndfnint.c -o nyqsrc/sndfnint.o $(CFLAGS) + +nyqsrc/seqfnint.o: nyqsrc/seqfnint.c + cc -c nyqsrc/seqfnint.c -o nyqsrc/seqfnint.o $(CFLAGS) + +xlisp/xlftab.o: nyqsrc/sndfnintptrs.h nyqsrc/sndfnintdefs.h nyqsrc/seqfnintptrs.h nyqsrc/seqfnintdefs.h + cc -c xlisp/xlftab.c -o xlisp/xlftab.o $(CFLAGS) + +xlisp/extern.o: xlisp/extern.c + cc -c xlisp/extern.c -o xlisp/extern.o $(CFLAGS) + +xlisp/xldmem.o: xlisp/xldmem.c + cc -c xlisp/xldmem.c -o xlisp/xldmem.o $(CFLAGS) + +xlisp/xlbfun.o: xlisp/xlbfun.c + cc -c xlisp/xlbfun.c -o xlisp/xlbfun.o $(CFLAGS) + +xlisp/xlcont.o: xlisp/xlcont.c + cc -c xlisp/xlcont.c -o xlisp/xlcont.o $(CFLAGS) + +xlisp/xldbug.o: xlisp/xldbug.c + cc -c xlisp/xldbug.c -o xlisp/xldbug.o $(CFLAGS) + +xlisp/xleval.o: xlisp/xleval.c + cc -c xlisp/xleval.c -o xlisp/xleval.o $(CFLAGS) + +xlisp/xlfio.o: xlisp/xlfio.c + cc -c xlisp/xlfio.c -o xlisp/xlfio.o $(CFLAGS) + +xlisp/xlglob.o: xlisp/xlglob.c + cc -c xlisp/xlglob.c -o xlisp/xlglob.o $(CFLAGS) + +xlisp/xlimage.o: xlisp/xlimage.c + cc -c xlisp/xlimage.c -o xlisp/xlimage.o $(CFLAGS) + +xlisp/xlinit.o: xlisp/xlinit.c + cc -c xlisp/xlinit.c -o xlisp/xlinit.o $(CFLAGS) + +xlisp/xlio.o: xlisp/xlio.c + cc -c xlisp/xlio.c -o xlisp/xlio.o $(CFLAGS) + +xlisp/xlisp.o: xlisp/xlisp.c + cc -c xlisp/xlisp.c -o xlisp/xlisp.o $(CFLAGS) + +xlisp/xljump.o: xlisp/xljump.c + cc -c xlisp/xljump.c -o xlisp/xljump.o $(CFLAGS) + +xlisp/xllist.o: xlisp/xllist.c + cc -c xlisp/xllist.c -o xlisp/xllist.o $(CFLAGS) + +xlisp/xlmath.o: xlisp/xlmath.c + cc -c xlisp/xlmath.c -o xlisp/xlmath.o $(CFLAGS) + +xlisp/xlobj.o: xlisp/xlobj.c + cc -c xlisp/xlobj.c -o xlisp/xlobj.o $(CFLAGS) + +xlisp/xlpp.o: xlisp/xlpp.c + cc -c xlisp/xlpp.c -o xlisp/xlpp.o $(CFLAGS) + +xlisp/xlprin.o: xlisp/xlprin.c + cc -c xlisp/xlprin.c -o xlisp/xlprin.o $(CFLAGS) + +xlisp/xlread.o: xlisp/xlread.c + cc -c xlisp/xlread.c -o xlisp/xlread.o $(CFLAGS) + +xlisp/xlstr.o: xlisp/xlstr.c + cc -c xlisp/xlstr.c -o xlisp/xlstr.o $(CFLAGS) + +xlisp/xlsubr.o: xlisp/xlsubr.c + cc -c xlisp/xlsubr.c -o xlisp/xlsubr.o $(CFLAGS) + +xlisp/xlsym.o: xlisp/xlsym.c + cc -c xlisp/xlsym.c -o xlisp/xlsym.o $(CFLAGS) + +xlisp/xlsys.o: xlisp/xlsys.c + cc -c xlisp/xlsys.c -o xlisp/xlsys.o $(CFLAGS) + +cmt/cext.o: cmt/cext.c + cc -c cmt/cext.c -o cmt/cext.o $(CFLAGS) + +cmt/cleanup.o: cmt/cleanup.c + cc -c cmt/cleanup.c -o cmt/cleanup.o $(CFLAGS) + +cmt/cmdline.o: cmt/cmdline.c + cc -c cmt/cmdline.c -o cmt/cmdline.o $(CFLAGS) + +cmt/cmtcmd.o: cmt/cmtcmd.c + cc -c cmt/cmtcmd.c -o cmt/cmtcmd.o $(CFLAGS) + +cmt/moxc.o: cmt/moxc.c + cc -c cmt/moxc.c -o cmt/moxc.o $(CFLAGS) + +cmt/mem.o: cmt/mem.c + cc -c cmt/mem.c -o cmt/mem.o $(CFLAGS) + +cmt/midifile.o: cmt/midifile.c + cc -c cmt/midifile.c -o cmt/midifile.o $(CFLAGS) + +cmt/midifns.o: cmt/midifns.c + cc -c cmt/midifns.c -o cmt/midifns.o $(CFLAGS) + +cmt/record.o: cmt/record.c + cc -c cmt/record.c -o cmt/record.o $(CFLAGS) + +cmt/seq.o: cmt/seq.c + cc -c cmt/seq.c -o cmt/seq.o $(CFLAGS) + +cmt/seqmread.o: cmt/seqmread.c + cc -c cmt/seqmread.c -o cmt/seqmread.o $(CFLAGS) + +cmt/seqmwrite.o: cmt/seqmwrite.c + cc -c cmt/seqmwrite.c -o cmt/seqmwrite.o $(CFLAGS) + +cmt/seqread.o: cmt/seqread.c + cc -c cmt/seqread.c -o cmt/seqread.o $(CFLAGS) + +cmt/seqwrite.o: cmt/seqwrite.c + cc -c cmt/seqwrite.c -o cmt/seqwrite.o $(CFLAGS) + +cmt/tempomap.o: cmt/tempomap.c + cc -c cmt/tempomap.c -o cmt/tempomap.o $(CFLAGS) + +cmt/timebase.o: cmt/timebase.c + cc -c cmt/timebase.c -o cmt/timebase.o $(CFLAGS) + +cmt/userio.o: cmt/userio.c + cc -c cmt/userio.c -o cmt/userio.o $(CFLAGS) + +sys/unix/osstuff.o: sys/unix/osstuff.c + cc -c sys/unix/osstuff.c -o sys/unix/osstuff.o $(CFLAGS) + +misc/intgen: misc/intgen.c + cd misc; make intgen + +misc/unpacker: misc/unpacker.c misc/convert.c + cd misc; make unpacker + +misc/packer: misc/packer.c misc/convert.c + cd misc; make packer + +nyqsrc/sndfnintptrs.h: $(NYQHDRS) snd/snd.h misc/intgen + $(INTGEN) nyqsrc/sndfnint $(NYQHDRS) + +nyqsrc/seqfnintptrs.h: $(CMTHDRS) misc/intgen + $(INTGEN) nyqsrc/seqfnint $(CMTHDRS) + +clean: + cd misc; make clean + rm -f $(OBJECTS) +# Note that these files are machine-generated: + rm -f nyqsrc/sndfnintptrs.h nyqsrc/sndfnint.c nyqsrc/sndfnintdefs.h + rm -f nyqsrc/seqfnintptrs.h nyqsrc/seqfnint.c nyqsrc/seqfnintdefs.h + +cleaner: clean + cd misc; make cleaner + rm -f *.backup */*.backup + rm -f *~ */*.*~ + rm -f *.save */*.save + rm -f *.CKP */*.CKP + rm -f *.BAK */*.BAK + rm -f *.old */*.old + rm -f *.gold */*.gold + rm -f playparms + rm -f points.dat diff --git a/sys/unix/sparc/system.lsp b/sys/unix/sparc/system.lsp new file mode 100644 index 0000000..4d6dfb3 --- /dev/null +++ b/sys/unix/sparc/system.lsp @@ -0,0 +1,33 @@ +; machine.lsp -- machine/system-dependent definitions +; sparc + +(setf *default-sound-srate* 8192) + +(if (not (boundp '*default-sf-format*)) + (setf *default-sf-format* snd-head-NeXT)) + +(if (not (boundp '*default-sound-file*)) + (compute-default-sound-file)) + +(if (not (boundp '*default-sf-dir*)) + (setf *default-sf-dir* "/tmp")) + +(if (not (boundp '*default-sf-mode*)) + (setf *default-sf-mode* snd-mode-pcm)) + +(if (not (boundp '*default-sf-bits*)) + (setf *default-sf-bits* 16)) + +; local definition for play + +(defun r () + (system (format nil + "play ~A" + *default-sound-file*))) + +(defmacro play (expr) + `(prog (specs) + (setf specs (s-save ,expr NY:ALL *default-sound-file*)) + (r))) + + diff --git a/sys/unix/switches.h b/sys/unix/switches.h new file mode 100644 index 0000000..28ae513 --- /dev/null +++ b/sys/unix/switches.h @@ -0,0 +1,197 @@ +/* see sys/switches.h.template */ + +/* CHANGE LOG + * -------------------------------------------------------------------- + * 28Apr03 dm major reorganization of conditional compilation in Nyquist + */ + +#define HAS_STDLIB_H 1 +#define HAS_SYS_TYPES_H 1 +#define HAS_SYS_STAT_H 1 +#undef HAS_STAT_H +#undef HAS_MALLOC_H + +#define HAS_GETTIMEOFDAY 1 + +// I think that READ_LINE prevents user from typing control characters to +// get info during lisp execution. This needs to be tested. Using READ_LINE +// is preventing any character echoing now, maybe due to new "improved" +// command line handling added recently. -RBD + +// #define READ_LINE 1 + +/* this is defined in xlisp.h - RBD +#if i386 +#define XL_LITTLE_ENDIAN 1 +#elif __i386__ +#define XL_LITTLE_ENDIAN 1 +#else +#define XL_BIG_ENDIAN 1 +#endif +*/ + +#undef USE_RANDOM +#define USE_RAND 1 + +/* define this to be printf, or define your own fn of the form + void nyquist_printf(char *format, ...); + (for a GUI) +*/ +#define nyquist_printf printf + +#if __APPLE__ && __GNUC__ /* Mac OS X */ +#define NEED_ULONG 1 +#else +#include <sys/types.h> +#undef NEED_ULONG +#endif + +#undef NEED_USHORT +#define NEED_BYTE 1 + +#define NEED_ROUND 1 + +#undef NEED_DEFINE_MALLOC + +/* definitions for libsndfile */ + +/* Target processor clips on negative float to int conversion */ +/* (true on i386 and PPC) */ +#define CPU_CLIPS_NEGATIVE 1 + +/* Target processor clips on positive float to int conversion */ +/* (true on i386 and PPC) */ +#define CPU_CLIPS_POSITIVE 1 + +#ifdef __APPLE__ + #if defined (__LITTLE_ENDIAN__) + /* Target processor is little endian. */ + #define CPU_IS_LITTLE_ENDIAN 1 + /* Target processor is big endian. */ + #define CPU_IS_BIG_ENDIAN 0 + #else + /* Target processor is little endian. */ + #define CPU_IS_LITTLE_ENDIAN 0 + /* Target processor is big endian. */ + #define CPU_IS_BIG_ENDIAN 1 + #endif +#else + #if defined(__linux__) || defined(__GLIBC__) + #include <endian.h> + #if __BYTE_ORDER == __LITTLE_ENDIAN + /* Target processor is little endian. */ + #define CPU_IS_LITTLE_ENDIAN 1 + /* Target processor is big endian. */ + #define CPU_IS_BIG_ENDIAN 0 + #else + /* Target processor is little endian. */ + #define CPU_IS_LITTLE_ENDIAN 0 + /* Target processor is big endian. */ + #define CPU_IS_BIG_ENDIAN 1 + #endif + #else /* default is little endian */ + /* Target processor is little endian. */ + #define CPU_IS_LITTLE_ENDIAN 1 + /* Target processor is big endian. */ + #define CPU_IS_BIG_ENDIAN 0 + #endif +#endif + +/* Set to 1 if S_IRGRP is defined */ +#define HAVE_DECL_S_IRGRP 1 + +/* Set to 1 if the compiler supports the struct hack. */ +#define HAVE_FLEXIBLE_ARRAY 1 + +/* Define to 1 if you have the `fsync' function. */ +#define HAVE_FSYNC 1 + +/* Define to 1 if you have the `gmtime' function. */ +#define HAVE_GMTIME 1 + +/* Define to 1 if you have the `gmtime_r' function. */ +#define HAVE_GMTIME_R 1 + +/* Define to 1 if you have the <inttypes.h> header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define if you have C99's lrint function. */ +#define HAVE_LRINT 1 + +/* Define if you have C99's lrintf function. */ +#define HAVE_LRINTF 1 + +/* Define to 1 if you have the `snprintf' function. */ +#define HAVE_SNPRINTF 1 + +/* Define to 1 if the system has the type `ssize_t'. */ +#define HAVE_SSIZE_T 1 + +/* Define to 1 if you have the <stdint.h> header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/types.h> header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define to 1 if you have the <unistd.h> header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `vsnprintf' function. */ +#define HAVE_VSNPRINTF 1 + +/* Set to 1 if compiling for MacOSX */ +#ifdef __APPLE__ + #define OS_IS_MACOSX 1 +#else + #define OS_IS_MACOSX 0 +#endif + +/* Set to 1 if compiling for Win32 */ +#define OS_IS_WIN32 0 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Set to 1 to use the native windows API */ +#define USE_WINDOWS_API 0 + +#ifdef __GNUC__ + #define SIZEOF_LONG_LONG 8 +#endif + +/* The size of `int64_t', as computed by sizeof. */ +#define SIZEOF_INT64_T 8 + +/* The size of long as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* Set to long if unknown */ +#define SIZEOF_SF_COUNT_T 8 + +/* explicitly choose a platform */ +#define UNIX 1 +#undef WINDOWS +#undef MICROSOFT +#undef DOS +#undef MACINTOSH + +#define BUFFERED_SYNCHRONOUS_INPUT 1 +#define SPACE_FOR_PLAY 10000 +#define MAX_CHANNELS 16 + +/* this will enable code to read midi files, etc. */ +#define CMTSTUFF 1 + +/* NYQUIST tells some CMT code that we're really in + * XLISP and NYQUIST + */ +#define NYQUIST 1 + +#include "swlogic.h" + diff --git a/sys/unix/term.c b/sys/unix/term.c new file mode 100644 index 0000000..2218feb --- /dev/null +++ b/sys/unix/term.c @@ -0,0 +1,133 @@ +/* term.c -- Routines for managing terminal I/O settings by Alan Cox. + * From LJ 17 */ + +/* Thanks to Dave Cook for rescuing it */ + +/* CHANGE LOG + * -------------------------------------------------------------------- + * 28Apr03 dm include ioctl.h and declare void ctcinit(); + */ + + +#include <termios.h> +#ifndef __APPLE__ +#include <asm/ioctls.h> +#endif +#include <sys/ioctl.h> +#include <signal.h> +#include <stdlib.h> +#include <unistd.h> +#include <stdio.h> + +void ctcinit(); + +/* This will be used for new terminal settings. */ +static struct termios current; + +/* This will hold the initial state so that we can restor it later. */ +static struct termios initial; + +/* Restor the termianl settings to those saved when term_init was called. */ +void term_restore(void) +{ + tcsetattr(0, TCSANOW, &initial); +} + +/* Clean up termianl; called on exit. */ +void term_exit() +{ + term_restore(); +} + +/* Will be called when contrl-Z is pressed; + * this correctly handles the terminal. */ +void term_ctrlz() +{ + signal(SIGTSTP, term_ctrlz); + term_restore(); + kill(getpid(), SIGSTOP); +} + +/* Will be called when the application is continued + * after having been stopped. */ +void term_cont() +{ + signal(SIGCONT, term_cont); + tcsetattr(0, TCSANOW, ¤t); +} + +/* Needs to be called to initialize the terminal. */ +void term_init(void) +{ + /* If stdin isn't a terminal this fails. + But then so does tcsetattr(), so it doesn't matter. */ + tcgetattr(0, &initial); + /* Save a copy to work with later. */ + current = initial; + /* We _must_ clean up when we exit. */ + /* signal(SIGINT, term_exit); */ + ctcinit(); /* XLisp wants to catch ctrl C */ + signal(SIGQUIT, term_exit); + /* Control-Z must also be handled. */ + signal(SIGTSTP, term_ctrlz); + signal(SIGCONT, term_cont); + atexit(term_exit); +} + +/* Set character-by-character input mode. */ +void term_character(void) +{ + /* One or more characters are sufficient to cause a read return. */ + current.c_cc[VMIN] = 1; + /* No timeout; read waits forever until ready. */ + current.c_cc[VTIME] = 0; + /* Line-by-line mode off */ + current.c_lflag &= ~ICANON; +#ifndef READ_LINE + current.c_lflag &= ~ECHO; +#endif + tcsetattr(0, TCSANOW, ¤t); +} + +/* Return to line-by-line input mode. */ +void term_line(void) +{ + current.c_lflag |= ICANON; + tcsetattr(0, TCSANOW, ¤t); +} + + +#define ERROR(s) return (perror(s), -1) + +/* term_testchar -- tell whether character is ready or not, + * + * if ready, return it, otherwise return -2 + */ +int term_testchar() +{ + int n; + char c; + + if (ioctl(0, FIONREAD, &n) < 0) + ERROR("IOgetchar"); + if (n == 0) return -2; + switch(read(0, &c, 1)) { + case 1: + return c; + case 0: + return EOF; + default: + ERROR("IOgetchar-read"); + } +} + + +/* term_getchar -- get a character (block if necessary) */ +/**/ +int term_getchar() +{ + char c; + int rslt = read(0, &c, 1); + return (rslt == 1 ? c : EOF); +} + diff --git a/sys/unix/term.h b/sys/unix/term.h new file mode 100644 index 0000000..4a6ac4c --- /dev/null +++ b/sys/unix/term.h @@ -0,0 +1,6 @@ +void term_init(); +void term_exit(); +void ctcinit(); /* not implemented in term.h */ +int term_testchar(); +int term_getchar(); +void term_character(); diff --git a/sys/unix/termtest.c b/sys/unix/termtest.c new file mode 100644 index 0000000..08d4c84 --- /dev/null +++ b/sys/unix/termtest.c @@ -0,0 +1,28 @@ +/* this was written to test the term.c code, which was + found on the web for use in XLisp to enable ^C and other + character-by-character handling + */ + +#include "term.h" +#include <signal.h> + +void ctcinit() +{ + signal(SIGINT, term_exit); +} + + +main() +{ + int c; + int count = 0; + term_init(); + term_character(); + while ((c = term_testchar()) == -2) count++; + printf("got %c after %d\n", c, count); + while ((c = getchar()) != 'x') { + printf("got '%c' = %x\n", c, c); + } + term_exit(); +} + diff --git a/sys/win/README.txt b/sys/win/README.txt new file mode 100644 index 0000000..70d5d9f --- /dev/null +++ b/sys/win/README.txt @@ -0,0 +1,143 @@ +README.txt -- Nyquist information for Windows + +Installation +------------ +The Win32 version of Nyquist is packaged as a compiled (runtime) +system in an executable installer. For most users, the runtime version +contain everything you need to run Nyquist, including the executable, +examples, and documentation, packaged as an executable installer +program. After executing the installer, just find Nyquist in your +Start menu to run it. You may begin typing expressions such as the +ones in the following "Examples" section of the Nyquist manual (in +doc/nyquistman.pdf or doc/home.html). + +(See "The 'java is not recognized' Error" below if you get this error +message.) + +A source version is also available (the same source download is for +Win32, Mac OS X, and Linux). The source version is intended for +developers who want to recompile Nyquist. The contents of the source +archive are extracted to the C:\nyquist directory, but you can put it +anywhere you like. You can then open the workspace file, nyquist.sln, +using Microsoft Visual C++. You can build and run the command line +version of Nyquist from within Visual C++. There is a batch file, +comp-ide.bat, for bulding the Nyquist IDE. This requires the Java SDK +from Sun Microsystems. + + +Optional +-------- +Nyquist needs to know where to find the standard runtime files. The +location of runtime files must be stored in the Registry. The +installers create a registry entry, but if you move Nyquist or deal +with different versions, you can edit the Registry manually as +follows: + + Run the Registry editor (e.g. type regedit into the Start Search + box of the Start menu and type the Enter key). + + Find and highlight the SOFTWARE key under HKEY_LOCAL_MACHINE. + + Open the CMU key (if it is not there, use the Edit:New:Key menu + item to create a CMU key. CMU is case sensitive.) + + Highlight the new CMU key. + + Open the Nyquist key (if it is not there, use the Edit:New:Key menu + item to create a Nyquist key. Nyquist is case sensitive.) + + Highlight the new Nyquist key. + + Find the XLISPPATH string (if it is not there, use the + Edit:New:String menu item to create a new string and change the + name by typing XLISPPATH). + + Select XLISPPATH and choose the Edit:Modify... menu item. + In the String Edit box, type a list of paths you want Nyquist to + search for lisp files. For example, if you installed Nyquist as + C:\nyquist, then type: + + C:\nyquist\runtime,C:\nyquist\lib + + The paths should be separated by a comma or semicolon and no + space. The runtime path is essential, and the lib path may become + essential in a future release. You can also add paths to personal + libraries of Lisp and Nyquist code. + + Click the OK button of the string box and exit from the Registry + Editor application. + + +What if Nyquist functions are undefined? +---------------------------------------- +If you do not have administrative privileges for your machine, the +installer may fail to set up the Registry entry that Nyquist uses to +find initialization files. In this case, Nyquist will run a lisp +interpreter, but many Nyquist functions will not be defined. If you +can log in as administrator, do it and reinstall Nyquist. If you do +not have permission, you can still run Nyquist as follows: + +Create a file named init.lsp in the same directory as Nyquist.exe +(the default location is C:\Program Files\Nyquist, but you may +have installed it in some other location.) Put the following text +in init.lsp: + + (setf *search-path* + "C:/Program Files/Nyquist/runtime,C:/Program Files/Nyquist/lib") + (load "C:/Program Files/Nyquist/runtime/init.lsp") + +Note: in the three places where you see C:/Program Files/Nyquist, +insert the full path where Nyquist is actually installed. Use forward +slashes (/) rather than back slashes (\) to separate directories. For +example, if Nyquist is installed at D:\rbd\nyquist, then init.lsp +should contain: + + (setf *search-path* "D:/rbd/nyquist/runtime,D:/rbd/nyquist/lib") + (load "d:/rbd/nyquist/runtime/init.lsp") + +The variable *search-path*, if defined, is used in place of the +registry to determine search paths for files. + +SystemRoot +---------- +(Ignore this paragraph if you are not planning to use Open Sound +Control under Windows.) + +If Nyquist prints an error message and quits when you enable Open +Sound Control (using osc-enable), check to see if you have an +environment variable SystemRoot, e.g. type set to a command prompt and +look for the value of SystemRoot. The normal value is C:\windows. If +the value is something else, you should put the environment entry, for +example: + + SystemRoot="D:\windows" + +into a file named systemroot (no extension). Put this file in your +nyquist directory. When you run jNyqIDE, it will look for this file +and pass the contents as an environment variable to Nyquist. The +Nyquist process needs this to open a UDP socket, which is needed for +Open Sound Control. + +The "java is not recognized" Error +---------------------------------- +Sometimes, Nyquist will run directly from the installer, but then it +will not start from the Windows Start menu. You can try running the +nyquist/jnyqide.bat program from a Windows shell. If that fails, and +you see an error similar to "java is not recognized as in internal or +external command error", the problem may be that paths are not set up +properly to allow the Windows shell to find java. Right click on "My +Computer" on the Windows desktop and select "Properties." Under the +"Advanced" tab, press the "Environment Variables" button, and look for +PATH under "System Variables." Make sure the Java bin directory is on +the path. If it is not, you will have to find your installation of +Java and add the appropriate directory to the PATH variable, +e.g. "C:\Program Files\Java\jdk1.6.0\bin." + +Right click on "My Computer" on the Windows desktop and select +"Properties." Under the "Advanced" tap, press the "Environment +Variables" button, and look for PATH under "System Variables." Make +sure the Java bin directory is on the path. If it is not, you will +have to find your installation of Java and add the appropriate +directory to the PATH variable, e.g. "C:\Program +Files\Java\jdk1.6.0\bin." + diff --git a/sys/win/msvc/sndsystem.h b/sys/win/msvc/sndsystem.h new file mode 100644 index 0000000..3cd5fa2 --- /dev/null +++ b/sys/win/msvc/sndsystem.h @@ -0,0 +1 @@ +#include "sndwin32.h" diff --git a/sys/win/msvc/stdint.h b/sys/win/msvc/stdint.h new file mode 100644 index 0000000..9ffb5e9 --- /dev/null +++ b/sys/win/msvc/stdint.h @@ -0,0 +1,240 @@ +// ISO C9x compliant stdint.h for Microsoft Visual Studio +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 +// +// Copyright (c) 2006-2008 Alexander Chemeris +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. The name of the author may be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +/////////////////////////////////////////////////////////////////////////////// + +// since this is an addition to the liblo library, I'm adding another +// change (not normally part of stdint.h for VC++ compatibility: +#ifndef inline +#define inline __inline +#endif + +typedef long ssize_t; + +#ifndef _MSC_VER // [ +#error "Use this header only with Microsoft Visual C++ compilers!" +#endif // _MSC_VER ] + +#ifndef _MSC_STDINT_H_ // [ +#define _MSC_STDINT_H_ + +#if _MSC_VER > 1000 +#pragma once +#endif + +#include <limits.h> + +// For Visual Studio 6 in C++ mode wrap <wchar.h> include with 'extern "C++" {}' +// or compiler give many errors like this: +// error C2733: second C linkage of overloaded function 'wmemchr' not allowed +#if (_MSC_VER < 1300) && defined(__cplusplus) + extern "C++" { +#endif +# include <wchar.h> +#if (_MSC_VER < 1300) && defined(__cplusplus) + } +#endif + +// Define _W64 macros to mark types changing their size, like intptr_t. +#ifndef _W64 +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif + + +// 7.18.1 Integer types + +// 7.18.1.1 Exact-width integer types +typedef __int8 int8_t; +typedef __int16 int16_t; +typedef __int32 int32_t; +typedef __int64 int64_t; +typedef unsigned __int8 uint8_t; +typedef unsigned __int16 uint16_t; +typedef unsigned __int32 uint32_t; +typedef unsigned __int64 uint64_t; + +// 7.18.1.2 Minimum-width integer types +typedef int8_t int_least8_t; +typedef int16_t int_least16_t; +typedef int32_t int_least32_t; +typedef int64_t int_least64_t; +typedef uint8_t uint_least8_t; +typedef uint16_t uint_least16_t; +typedef uint32_t uint_least32_t; +typedef uint64_t uint_least64_t; + +// 7.18.1.3 Fastest minimum-width integer types +typedef int8_t int_fast8_t; +typedef int16_t int_fast16_t; +typedef int32_t int_fast32_t; +typedef int64_t int_fast64_t; +typedef uint8_t uint_fast8_t; +typedef uint16_t uint_fast16_t; +typedef uint32_t uint_fast32_t; +typedef uint64_t uint_fast64_t; + +// 7.18.1.4 Integer types capable of holding object pointers +#ifdef _WIN64 // [ + typedef __int64 intptr_t; + typedef unsigned __int64 uintptr_t; +#else // _WIN64 ][ + typedef _W64 int intptr_t; + typedef _W64 unsigned int uintptr_t; +#endif // _WIN64 ] + +// 7.18.1.5 Greatest-width integer types +typedef int64_t intmax_t; +typedef uint64_t uintmax_t; + + +// 7.18.2 Limits of specified-width integer types + +#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 + +// 7.18.2.1 Limits of exact-width integer types +#define INT8_MIN ((int8_t)_I8_MIN) +#define INT8_MAX _I8_MAX +#define INT16_MIN ((int16_t)_I16_MIN) +#define INT16_MAX _I16_MAX +#define INT32_MIN ((int32_t)_I32_MIN) +#define INT32_MAX _I32_MAX +#define INT64_MIN ((int64_t)_I64_MIN) +#define INT64_MAX _I64_MAX +#define UINT8_MAX _UI8_MAX +#define UINT16_MAX _UI16_MAX +#define UINT32_MAX _UI32_MAX +#define UINT64_MAX _UI64_MAX + +// 7.18.2.2 Limits of minimum-width integer types +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MIN INT64_MIN +#define INT_LEAST64_MAX INT64_MAX +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +// 7.18.2.3 Limits of fastest minimum-width integer types +#define INT_FAST8_MIN INT8_MIN +#define INT_FAST8_MAX INT8_MAX +#define INT_FAST16_MIN INT16_MIN +#define INT_FAST16_MAX INT16_MAX +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MIN INT64_MIN +#define INT_FAST64_MAX INT64_MAX +#define UINT_FAST8_MAX UINT8_MAX +#define UINT_FAST16_MAX UINT16_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +// 7.18.2.4 Limits of integer types capable of holding object pointers +#ifdef _WIN64 // [ +# define INTPTR_MIN INT64_MIN +# define INTPTR_MAX INT64_MAX +# define UINTPTR_MAX UINT64_MAX +#else // _WIN64 ][ +# define INTPTR_MIN INT32_MIN +# define INTPTR_MAX INT32_MAX +# define UINTPTR_MAX UINT32_MAX +#endif // _WIN64 ] + +// 7.18.2.5 Limits of greatest-width integer types +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX + +// 7.18.3 Limits of other integer types + +#ifdef _WIN64 // [ +# define PTRDIFF_MIN _I64_MIN +# define PTRDIFF_MAX _I64_MAX +#else // _WIN64 ][ +# define PTRDIFF_MIN _I32_MIN +# define PTRDIFF_MAX _I32_MAX +#endif // _WIN64 ] + +#define SIG_ATOMIC_MIN INT_MIN +#define SIG_ATOMIC_MAX INT_MAX + +#ifndef SIZE_MAX // [ +# ifdef _WIN64 // [ +# define SIZE_MAX _UI64_MAX +# else // _WIN64 ][ +# define SIZE_MAX _UI32_MAX +# endif // _WIN64 ] +#endif // SIZE_MAX ] + +// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h> +#ifndef WCHAR_MIN // [ +# define WCHAR_MIN 0 +#endif // WCHAR_MIN ] +#ifndef WCHAR_MAX // [ +# define WCHAR_MAX _UI16_MAX +#endif // WCHAR_MAX ] + +#define WINT_MIN 0 +#define WINT_MAX _UI16_MAX + +#endif // __STDC_LIMIT_MACROS ] + + +// 7.18.4 Limits of other integer types + +#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 + +// 7.18.4.1 Macros for minimum-width integer constants + +#define INT8_C(val) val##i8 +#define INT16_C(val) val##i16 +#define INT32_C(val) val##i32 +#define INT64_C(val) val##i64 + +#define UINT8_C(val) val##ui8 +#define UINT16_C(val) val##ui16 +#define UINT32_C(val) val##ui32 +#define UINT64_C(val) val##ui64 + +// 7.18.4.2 Macros for greatest-width integer constants +#define INTMAX_C INT64_C +#define UINTMAX_C UINT64_C + +#endif // __STDC_CONSTANT_MACROS ] + + +#endif // _MSC_STDINT_H_ ] diff --git a/sys/win/msvc/switches.h b/sys/win/msvc/switches.h new file mode 100644 index 0000000..9e21c6e --- /dev/null +++ b/sys/win/msvc/switches.h @@ -0,0 +1,175 @@ +/* switches.h -- conditional compilation features for WIN32 systems */ + +/* CHANGE LOG + * -------------------------------------------------------------------- + * 28Apr03 dm major reorganization of conditional compilation in Nyquist + */ + +#ifdef SWITCHES +Error: switches.h included more than once. +#endif + +#define HAS_STDLIB_H 1 +#define HAS_SYS_TYPES_H 1 +#define HAS_SYS_STAT_H 1 +#undef HAS_STAT_H +#undef HAS_MALLOC_H + +/* define one of HAS_GETTIMEOFDAY, HAS_FTIME, */ +#undef HAS_GETTIMEOFDAY +#undef HAS_FTIME + +#undef READ_LINE + +#undef USE_RANDOM +#define USE_RAND 1 + + +/* since there are 2 versions Nyquist for windows: nyquist and nyqwin, + we use WINGUI to decide which to compile + */ +#ifndef WINGUI +/* use C library printf as nyquist_printf() */ +#define USE_PRINTF 1 +#endif + +/* define this to be printf, or define your own fn of the form + void nyquist_printf(char *format, ...); + (for a GUI) +*/ +void nyquist_printf(char *format, ...); + +#define NEED_ULONG 1 +#define NEED_USHORT 1 +#define NEED_BYTE 1 + +#define NEED_ROUND 1 + +#undef NEED_DEFINE_MALLOC + +/* definitions for libsndfile */ + +/* Target processor clips on negative float to int conversion */ +/* (true on i386) */ +#define CPU_CLIPS_NEGATIVE 1 + +/* Target processor clips on positive float to int conversion */ +/* (true on i386) */ +#define CPU_CLIPS_POSITIVE 1 + +/* Target processor is little endian. */ +#define CPU_IS_LITTLE_ENDIAN 1 +/* Target processor is big endian. */ +#define CPU_IS_BIG_ENDIAN 0 + +/* Set to 1 if S_IRGRP is defined */ +#define HAVE_DECL_S_IRGRP 0 + +/* Set to 1 if the compiler supports the struct hack. */ +#define HAVE_FLEXIBLE_ARRAY 1 + +/* Define to 1 if you have the `fsync' function. */ +#define HAVE_FSYNC 1 + +/* Define to 1 if you have the `gmtime' function. */ +#define HAVE_GMTIME 1 + +/* Define to 1 if you have the `gmtime_r' function. */ +#undef HAVE_GMTIME_R + +/* Define to 1 if you have the <inttypes.h> header file. */ +#define HAVE_INTTYPES_H 0 + +/* Define if you have C99's lrint function. */ +#define HAVE_LRINT 0 + +/* Define if you have C99's lrintf function. */ +#define HAVE_LRINTF 0 + +/* Define to 1 if you have the `snprintf' function. */ +#define snprintf _snprintf +#define HAVE_SNPRINTF 1 + +/* Define to 1 if the system has the type `ssize_t'. */ +#define ssize_t SSIZE_T +#define HAVE_SSIZE_T 1 + +/* Define to 1 if you have the <stdint.h> header file. */ +#define HAVE_STDINT_H 0 + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/types.h> header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define to 1 if you have the <unistd.h> header file. */ +#define HAVE_UNISTD_H 0 + +/* Define to 1 if you have the `vsnprintf' function. */ +#define HAVE_VSNPRINTF 1 + +/* Set to 1 if compiling for MacOSX */ +#define OS_IS_MACOSX 0 + +/* Set to 1 if compiling for Win32 */ +#define OS_IS_WIN32 1 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Set to 1 to use the native windows API */ +#define USE_WINDOWS_API 1 + +/* The size of `int64_t', as computed by sizeof. */ +/* Omit this if int64_t is not a type */ +#undef SIZEOF_INT64_T + +/* The size of long as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* Set to long if unknown */ +#define SIZEOF_SF_COUNT_T 8 + +/* explicitly choose a platform */ +#undef UNIX + +#ifndef WINDOWS +#define WINDOWS 1 +#endif + +#ifndef WIN32 +#define WIN32 1 +#endif + +#ifndef MICROSOFT +#define MICROSOFT 1 +#endif + +#ifndef DOS +#define DOS 1 +#endif + +#undef MACINTOSH + +// Under Windows, we do not want synchronous input because then we do not +// get the break character (^G) while XLISP is busy. Actually, there is a +// way to send a message to the process, but the Java IDE cannot send +// Windows messages, so we have to check for console character input +// using the _kbhit function. +//#define BUFFERED_SYNCHRONOUS_INPUT 1 +#define SPACE_FOR_PLAY 10000 +#define MAX_CHANNELS 16 + +/* this will enable code to read midi files, etc. */ +#define CMTSTUFF 1 + +/* NYQUIST tells some CMT code that we're really in + * XLISP and NYQUIST + */ +#define NYQUIST 1 + +#include "swlogic.h" diff --git a/sys/win/msvc/system.lsp b/sys/win/msvc/system.lsp new file mode 100644 index 0000000..b750fe6 --- /dev/null +++ b/sys/win/msvc/system.lsp @@ -0,0 +1,131 @@ +; machine.lsp -- machine/system-dependent definitions +; Windows + +;; default behavior is to call SETUP-CONSOLE to get large white typescript +;; +;; set *setup-console* to nil in your personal init.lsp to override this behavior +;; (this may be necessary to work with emacs) +;; +(if (not (boundp '*setup-console*)) (setf *setup-console* t)) +(if *setup-console* (setup-console)) + +(if (not (boundp '*default-sf-format*)) + (setf *default-sf-format* snd-head-Wave)) + +(if (not (boundp '*default-sound-file*)) + (compute-default-sound-file)) + +(if (not (boundp '*default-sf-dir*)) + (setf *default-sf-dir* "")) + +(if (not (boundp '*default-sf-mode*)) + (setf *default-sf-mode* snd-mode-pcm)) + +(if (not (boundp '*default-sf-bits*)) + (setf *default-sf-bits* 16)) + +(if (not (boundp '*default-plot-file*)) + (setf *default-plot-file* "points.dat")) + +;(if (not (boundp '*plotscript-file*)) +; (setf *plotscript-file* "sys/unix/rs6k/plotscript")) + +; local definition for play +(defmacro play (expr) + `(s-save-autonorm ,expr NY:ALL *default-sound-file* :play *soundenable*)) + + +(defun r () + (s-save (s-read *default-sound-file*) NY:ALL "" :play t) +) + + +; PLAY-FILE -- play a file +(defun play-file (name) + (s-save (s-read name) NY:ALL "" :play t)) + + +; FULL-NAME-P -- test if file name is a full path or relative path +; +; (otherwise the *default-sf-dir* will be prepended +; +(defun full-name-p (filename) + (or (eq (char filename 0) #\\) + (eq (char filename 0) #\/) + (eq (char filename 0) #\.) + (and (> (length filename) 2) + (both-case-p (char filename 0)) + (equal (char filename 1) #\:)))) + +; RELATIVE-PATH-P -- test if filename or path is a relative path +; +; note that properly converting a Windows path from relative to +; absolute is complicated by paths like: E:MYFILE.LSP +; Nyquist assumes that if there is a drive letter, the path is +; absolute, e.g. E:\TMP\MYFILE.LSP and if there is no drive, +; the path is relative, e.g. you cannot have \TMP\MYFILE.LSP +; +(defun relative-path-p (filename) + (or (< (length filename) 2) + (not (both-case-p (char filename 0))) + (not (equal (char filename 1) #\:)))) + + +(setf *file-separator* #\\) + +(defun ny:load-file () (load "*.*")) +(defun ny:reload-file () (load "*")) + + +; save the standard function to write points to a file +; +;(setfn s-plot-points s-plot) + +;(defun array-max-abs (points) +; (let ((m 0.0)) +; (dotimes (i (length points)) +; (setf m (max m (abs (aref points i))))) +; m)) + +;(setf graph-width 600) +;(setf graph-height 220) + +;(defun s-plot (snd &optional (n 600)) +; (show-graphics) +; (clear-graphics) +; (cond ((soundp snd) +; (s-plot-2 snd n (/ graph-height 2) graph-height)) +; (t +; (let ((gh (/ graph-height (length snd))) +; hs) +; (dotimes (i (length snd)) +; (setf hs (s-plot-2 (aref snd i) n (+ (/ gh 2) (* i gh)) gh hs))))))) +; +; +;(defun s-plot-2 (snd n y-offset graph-height horizontal-scale) +; (prog ((points (snd-samples snd n)) +; maxpoint horizontal-scale vertical-scale) +; (setf maxpoint (array-max-abs points)) +; (moveto 0 y-offset) +; (lineto graph-width y-offset) +; (moveto 0 y-offset) +; (cond ((null horizontal-scale) +; (setf horizontal-scale (/ (float graph-width) (length points))))) +; (setf vertical-scale (- (/ (float graph-height) 2 maxpoint))) +; (dotimes (i (length points)) +; (lineto (truncate (* horizontal-scale i)) +; (+ y-offset (truncate (* vertical-scale (aref points i)))))) +; (format t "X Axis: ~A to ~A (seconds)\n" (snd-t0 snd) (/ (length points) (snd-srate snd))) +; (format t "Y Axis: ~A to ~A\n" (- maxpoint) maxpoint) +; (format t "~A samples plotted.\n" (length points)) +; (return horizontal-scale) +; )) +; +; S-EDIT - run the audio editor on a sound +; +;(defmacro s-edit (&optional expr) +; `(prog () +; (if ,expr (s-save ,expr 1000000000 *default-sound-file*)) +; (system (format nil "audio_editor ~A &" +; (soundfilename *default-sound-file*))))) + diff --git a/sys/win/msvc/winfun.c b/sys/win/msvc/winfun.c new file mode 100644 index 0000000..f1c4b9c --- /dev/null +++ b/sys/win/msvc/winfun.c @@ -0,0 +1,276 @@ +/* winfun.c - windows user interface functions for xlisp */ +/* Written by Brian Kendig. */ +/*Windows Console and DirectSound code added by Morgan Green and Chris Tchou*/ + +//#include <Quickdraw.h> +//#include <Windows.h> +//#include <Memory.h> +#include <windows.h> +#include <switches.h> +#include "xlisp.h" +#include "sound.h" + +/* Added by Ning Hu May.2001 +xsetdir - set current directory of the process */ +LVAL xsetdir() { + TCHAR ssCurDir[MAX_PATH], szCurDir[MAX_PATH]; + int verbose = TRUE; + + strcpy(ssCurDir, getstring(xlgastring())); + if (moreargs()) { + verbose = (xlgetarg() != NIL); + } + xllastarg(); + if (SetCurrentDirectory(ssCurDir)) { + if (GetCurrentDirectory( + sizeof(szCurDir)/sizeof(TCHAR), szCurDir)) { + return cvstring(szCurDir); + /* create the result string + stdputstr("Current Directory: "); + stdputstr(szCurDir); + stdputstr("\n"); */ + } + } + if (verbose) stdputstr("Directory Setting Error\n"); + + /* return nil on error*/ + return NIL; +} + +/* xget_temp_path -- get a path to create temp files */ +LVAL xget_temp_path() +{ + char *p; + char szDir[MAX_PATH]; + char szDirLC[MAX_PATH]; + int rslt = GetTempPath(MAX_PATH, szDir); + if (rslt > MAX_PATH || rslt <= 0) { + return cvstring(""); + } else { + /* Vista apparently treats c:\windows with + * special semantics, so just don't allow + * GetTempPath to put us in c:\windows... + */ + strcpy(szDirLC, szDir); /* convert to lower case */ + for (p = szDirLC; *p; p++) { + *p = tolower(*p); + } + if (strstr(szDirLC, "c:\\windows")) { + /* c:\windows is bad. */ + return cvstring(""); + } + return cvstring(szDir); + } +} + +//Updated End + + +/* osbgetc - get a character from a binary file ====== added for console*/ +/* int osbgetc(fp) FILE *fp; {return (getc(fp));} */ +int osbgetc(FILE *fp) +{ + int c; c = (getc(fp)); +/* if (dbgflg) printf("osbgetc: got %d from FILE %x\n", c, fp); */ + return c; +} + + + +LVAL xsystem (V) { return NIL; } +LVAL xgetkey (V) { return NIL; } + + +void ossymbols() +{ + HWND mywin; +#ifdef WIN32_SNAZZY_CONSOLE + HANDLE myhandle; + COORD winsize, origin; + WORD textattrib; + DWORD n; +#endif + mywin = GetForegroundWindow(); + SetConsoleTitle("Nyquist"); + +#ifdef WIN32_SNAZZY_CONSOLE // -eub + myhandle = GetStdHandle(STD_OUTPUT_HANDLE); + origin.X = 0; + origin.Y = 0; + winsize.X = 100; + winsize.Y = 40; + textattrib = BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_INTENSITY; + + FillConsoleOutputAttribute(myhandle, textattrib, winsize.X * winsize.Y, origin, &n); + SetConsoleScreenBufferSize(myhandle, winsize); + FillConsoleOutputAttribute(myhandle, textattrib, winsize.X * winsize.Y, origin, &n); + SetConsoleTextAttribute(myhandle, textattrib); +#endif + + setvbuf(stdout, NULL, _IONBF, 0); // makes it work under NT emacs 20.3 -eub + +} + + +LVAL xsetupconsole() +{ + HWND mywin; + HANDLE myhandle; + COORD winsize, origin; + WORD textattrib; + DWORD n; + mywin = GetForegroundWindow(); + SetConsoleTitle("Nyquist"); + + myhandle = GetStdHandle(STD_OUTPUT_HANDLE); + origin.X = 0; + origin.Y = 0; + winsize.X = 100; + winsize.Y = 40; + textattrib = BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_INTENSITY; + + FillConsoleOutputAttribute(myhandle, textattrib, winsize.X * winsize.Y, origin, &n); + SetConsoleScreenBufferSize(myhandle, winsize); + FillConsoleOutputAttribute(myhandle, textattrib, winsize.X * winsize.Y, origin, &n); + SetConsoleTextAttribute(myhandle, textattrib); + return NIL; +} + +void get_xlisp_path(char *p, long p_max) +{ + HKEY hkey; + DWORD dwType; + LVAL lval; + extern LVAL s_search_path; + + *p = 0; /* for simplicity, we assume if !*p that path was not found */ + /* therefore, no path is equivalent to an empty string path */ + + /* first, look for path in global variable *SEARCH-PATH* */ + lval = getvalue(s_search_path); + if (lval && stringp(lval)) { + strncpy(p, getstring(lval), p_max); + p[p_max - 1] = 0; /* make sure string is terminated, even if truncated */ + } + if (*p) return; /* we got search path, so don't look in registry */ + + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, KEY_READ, &hkey) != + ERROR_SUCCESS) { + return; + } + if (RegOpenKeyEx(hkey, "CMU", 0, KEY_READ, &hkey) != + ERROR_SUCCESS) { + return; + } + if (RegOpenKeyEx(hkey, "Nyquist", 0, KEY_READ, &hkey) != + ERROR_SUCCESS) { + return; + } + if (RegQueryValueEx(hkey, "XLISPPATH", NULL, &dwType, p, &p_max) != + ERROR_SUCCESS) { + *p = 0; + return; + } +} + +LVAL xget_user() +{ + // not implemented for Windows, just use "nyquist" + return cvstring("nyquist"); +} + + +#ifdef WINGUI +/* NOTE: define WINGUI in the Project Settings for the NyqWin projects. + * Do not define WINGUI for console versions of Nyquist + */ + +/**************************************************************************** +* fileopen +* Inputs: +* char *deflt: the default file name (e.g. from command line) +* char *extension: default extension +* char *mode: read ("r") or write ("w") +* char *prompt: prompt for user +* Returns: +* opened file pointer +* Effect: +* opens file, prompts for user input if necessary and warns about +* possible confusion. If deflt is a null string or NULL, the user will +* be prompted for a name. The routine loops until a file is opened. +* If the mode is "r", a check is made to see if the file exists +* with and without the extension. If both exist a warning is given. +* For mode "w", a check is made to see if the file will be overwritten. +* The extension is automatically added if the default or user-typed +* file has no "." At the bottom of the loop body, if no file has +* been opened, the user is prompted for another file name. +****************************************************************************/ + +char fileopen_name[100]; /* name of the opened file */ + +HINSTANCE hInst; /* current instance */ +HWND hMainWindow; /* main window handle */ + + +char *getfilename(char *deflt, char *extension, char *mode, char *prompt) +{ + char filter[64]; + char *filter_ptr = NULL; + OPENFILENAME open_file_name; + + if (extension && extension[0] == 0) extension = NULL; + if (strcmp(extension, "lsp") == 0) { + strcpy(filter, "Lisp files"); + } else if (extension) { + sprintf(filter, "%s files", extension); + } + if (extension) { + sprintf(filter + strlen(filter), "%c*.%s%cAll files%c*.*%c", + 0, extension, 0, 0, 0); + filter_ptr = filter; + } + if (!deflt) deflt = ""; /* treat NULL as the empty string */ + strcpy(fileopen_name, deflt); + + open_file_name.lStructSize = sizeof(OPENFILENAME); + open_file_name.hwndOwner = hMainWindow; + + open_file_name.hInstance = hInst; + open_file_name.lpstrFilter = filter_ptr; + open_file_name.lpstrCustomFilter = NULL; + open_file_name.nMaxCustFilter = 0; + open_file_name.nFilterIndex = 0; + open_file_name.lpstrFile = fileopen_name; + open_file_name.nMaxFile = 100; + open_file_name.lpstrFileTitle = NULL; + open_file_name.nMaxFileTitle = 0; + open_file_name.lpstrInitialDir = NULL; + open_file_name.lpstrTitle = prompt; + open_file_name.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST; + open_file_name.nFileOffset = 0; + open_file_name.nFileExtension = 0; + open_file_name.lpstrDefExt = extension; + open_file_name.lCustData = 0; + open_file_name.lpfnHook = 0; + open_file_name.lpTemplateName = 0; + if (((*mode == 'r') && GetOpenFileName(&open_file_name)) || + ((*mode == 'w') && GetSaveFileName(&open_file_name))) { + return open_file_name.lpstrFile; + } + return NULL; +} + + + +FILE *fileopen(char *deflt, char *extension, char *mode, char *prompt) +{ + FILE *fp = NULL; /* file corresponding to filename */ + if (getfilename(deflt, extension, mode, prompt)) { + fp = fopen(fileopen_name, mode); + } + return fp; +} + +#endif + + diff --git a/sys/win/msvc/winfun.h b/sys/win/msvc/winfun.h new file mode 100644 index 0000000..ba88071 --- /dev/null +++ b/sys/win/msvc/winfun.h @@ -0,0 +1,11 @@ +#ifdef __cplusplus +extern "C" { +#endif + +void get_xlisp_path(char *p, long p_max); +char *getfilename(char *deflt, char *extension, char *mode, char *prompt); +FILE *fileopen(char *deflt, char *extension, char *mode, char *prompt); + +#ifdef __cplusplus +} +#endif diff --git a/sys/win/msvc/winstuff.c b/sys/win/msvc/winstuff.c new file mode 100644 index 0000000..6670014 --- /dev/null +++ b/sys/win/msvc/winstuff.c @@ -0,0 +1,398 @@ +/* winstuff.c - windows interface routines for xlisp */ +/* Written by Chris Tchou. */ +/* This file contains the stuff that the other xlisp files call directly. */ + +/* Changes by Roger Dannenberg, Jan 2006: +Previously, the input thread would block on input, so if a command line +instantiation of Nyquist called (EXIT), the process would still block +in getchar() until the user typed a newline. Now, I only start the +input thread if ostgetc is called (input is really needed). This will +still read ahead and block, but only in cases where you are already +interactive. + +/* Changes by Roger Dannenberg, April 2004: +To support interrupts to Lisp processing, XLISP call oscheck frequently to +test for an abort or break condition. This condition can be activated by +special handlers, e.g. if a software interrupt is generated by Ctrl-C. +Alternatively, the application can read ahead and look for break characters +in the input stream. A third approach, implemented by Ning Hu for her +Delphi-based IDE, is to send a Windows message to the process. Unfortunately, +the Java IDE does not support sending a Windows message, nor can console +IO be used to read ahead (console IO does not work because, when started by +Java, Nyquist standard IO is redirected through pipes). The two solutions +to enable break character prcessing seem to be: + 1) extend Java with C code to find the process and send Windows messages + 2) add a thread to perform read ahead and break character processing +Option 2 contains the ugliness to Nyquist IO, which is already big and ugly, +and leaves Java alone, which is something I don't know much about anyway, +so I have chosen option 2: create a thread and read ahead. This uses only +about 50 lines of code. + +A shortcoming of this approach is that, except for Ctrl-C, break characters +like ^P, ^B, and ^U require the user to type RETURN to end the input line +and allow the character to be processed. + +The thread will set a signal whenever a line of input is delivered so that +Nyquist can block waiting for input. The signal will also be set when a +^C or ^G is detected. + +For flexibility, compatibility with the Delphi IDE (NyqIDE) is retained by +continuing to check for Windows process messages. +*/ + +#include <windows.h> /* Added by Ning Hu Apr.2001 */ +#include <process.h> /* Added by Dannenberg Apr 2004 */ +#include <signal.h> /* Added by Dannneberg, Apr 2004 */ +#include "exitpa.h" /* Added by Dannneberg, Apr 2004 */ + + +const char os_pathchar = '\\'; +const char os_sepchar = ','; + + +#undef ERROR +#include <stdio.h> +//#include <QuickDraw.h> /* for Random */ +#include <memory.h> /* for DisposPtr */ +#include <string.h> +//#include <SegLoad.h> /* for ExitToShell */ +#include "xlisp.h" +#include "cext.h" +#include "userio.h" +#include "sliders.h" +#include "sound.h" /* define nosc_enabled */ + +/* externals */ +extern FILE *tfp; /* transcript file pointer */ +extern int cursorPos; +extern char *macgets (void); +//Added by Ning Hu Apr.2001 +extern int _isatty(int); +extern int redirect_flag; +//Add end + +/* local variables */ +int lposition; +static char *linebuf = NULL, *lineptr; +static int numChars; + +/* input thread */ +unsigned long input_thread_handle = -1; +#define NEED_INPUT if (input_thread_handle == -1) start_input_thread(); +#define input_buffer_max 1024 +#define input_buffer_mask (input_buffer_max - 1) +char input_buffer[1024]; +volatile int input_buffer_head = 0; +volatile int input_buffer_tail = 0; +volatile int buffer_eof = 0; +HANDLE input_buffer_ready = NULL; + +BOOL WINAPI ctrl_c_handler(DWORD dwCtrlType) +{ + if (dwCtrlType == CTRL_C_EVENT) { + abort_flag = ABORT_LEVEL; + return TRUE; + } + return FALSE; +} + +#ifdef DEBUG_INPUT +extern FILE *to_input_buffer; +#endif + +void input_thread_run(void *args) +{ + int c; + /* this gets called, possible later, in io_init() in userio.c, but + * that doesn't seem to prevent this thread from being killed by + * CTRL-C, so call it here to be safe. + */ + SetConsoleCtrlHandler(ctrl_c_handler, TRUE); + /* printf("input_thread_run\n"); */ + + while (!buffer_eof) { + int head; + c = getchar(); + if (c == EOF && abort_flag) { + // when user types ^C, an EOF is generated for some reason. + // Ignore it... + if (abort_flag == ABORT_LEVEL) c = ABORT_CHAR; + else c = BREAK_CHAR; + } else if (c == ABORT_CHAR) { + abort_flag = ABORT_LEVEL; + } else if (!abort_flag && c == BREAK_CHAR) { + // notice that a break will be ignored until XLISP + // handles the ABORT_LEVEL + abort_flag = BREAK_LEVEL; + } else if (c == BREAK_CHAR) { + ; // ignore this because abort_flag is set to ABORT_LEVEL + } else if (c == '\005' || c == '\006') { // control-e or control-f + ; // ignore these. IDE will send control-f to turn off echo, but + // under Windows, echo is already turned off. We filter control-f + // here to avoid generating an error message. Maybe the IDE should + // not send control-f in the first place, but the IDE is cross-platform + // and does not know it's running under Windows, whereas this file + // is platform dependent. + } else if (c == '\016') { // begin hidden message +#define MSGBUF_MAX 64 + char msgbuf[MSGBUF_MAX]; + int msgbufx = 0; + char type_char = getchar(); // read message type character + printf("begin hidden message: %c\n", type_char); + if (type_char == EOF) buffer_eof = TRUE; + else { + // message is terminated by '\021' + while ((c = getchar()) != '\021' && + c != EOF && + msgbufx < MSGBUF_MAX - 1) { + msgbuf[msgbufx++] = c; + } + msgbuf[msgbufx++] = 0; + printf("message: %s\n", msgbuf); + if (c == EOF) buffer_eof = TRUE; + else if (msgbufx < MSGBUF_MAX) { + if (type_char == 'S') { // slider change message + // message format is index<space>value + int index; + float value; + if (sscanf(msgbuf, "%d %g", &index, &value) == 2) { + set_slider(index, value); + printf("set_slider %d %g\n", index, value); + } + } + } + } + } else if (c == EOF) { + buffer_eof = TRUE; + } else { + // insert character into the FIFO + head = (input_buffer_head + 1) & input_buffer_mask; + while (head == input_buffer_tail) Sleep(100); + input_buffer[input_buffer_head] = c; +#ifdef DEBUG_INPUT + if (to_input_buffer) putc(c, to_input_buffer); +#endif + input_buffer_head = head; + } + if (c == '\n' || abort_flag || buffer_eof) { + SetEvent(input_buffer_ready); + // wake up Nyquist if it is waiting for input + } + } + // printf("Input thread exiting\n"); +} + +//int isascii (char c) { return 1; } /* every char is an ascii char, isn't it? */ + +void start_input_thread() +{ + // create thread to process input + input_thread_handle = _beginthread(input_thread_run, 0, NULL); + if (input_thread_handle == -1) { + printf("Unable to create input thread, errno = %d\n", errno); + EXIT(1); + } +} + +void osinit (char *banner) +{ + printf("%s\n", banner); + if (_isatty( _fileno( stdin ) ) ){ + redirect_flag = 0; +#ifdef DEBUG + printf( "stdout has not been redirected to a file\n" ); //for debugging use +#endif + } else { + redirect_flag = 1; +#ifdef DEBUG + printf( "stdout has been redirected to a file\n"); //for debugging use +#endif + } + // signal when input is ready + input_buffer_ready = CreateEvent(NULL, FALSE, FALSE, NULL); + if (input_buffer_ready == NULL) { + printf("Unable to create Event object\n"); + EXIT(1); + } +} + +FILE *osaopen (char *name, char *mode) { + return fopen (name, mode); +} + +FILE *osbopen (char *name, char *mode) { + char nmode[4]; + strcpy (nmode, mode); strcat (nmode, "b"); + return (fopen (name, nmode)); +} + +int osclose (FILE *fp) { return (fclose (fp)); } +int osaputc (int ch, FILE *fp) { return (putc (ch, fp)); } +int osbputc (int ch, FILE *fp) { return (putc (ch, fp)); } +void osoutflush(FILE *fp) { fflush(fp); } + +/* osagetc - get a character from an ascii file */ +int osagetc(fp) + FILE *fp; +{ + return (getc(fp)); +} + +extern int abort_flag; +extern int redirect_flag; //Added by Ning Hu Apr.2001 +int ostgetc (void) +{ + int c; + NEED_INPUT; + while (!buffer_eof && (input_buffer_tail == input_buffer_head)) { + oscheck(); + WaitForSingleObject(input_buffer_ready, INFINITE); + } + if (buffer_eof) c = EOF; + else { + c = input_buffer[input_buffer_tail]; + input_buffer_tail = (input_buffer_tail + 1) & input_buffer_mask; + } + if (c == '\025') { // control-u + xlcleanup(); + } else if (c == '\020') { // control-p + xlcontinue(); + } else if (c == '\024') { // control-t + xinfo(); + } + return c; +} + + +void ostputc (int ch) { +// macputc (ch); + putchar(ch); // console + + if (tfp) osaputc (ch, tfp); +} + +void ostoutflush() +{ + if (tfp) fflush(tfp); + fflush(stdout); +} + + +void osflush (void) { + lineptr = linebuf; + numChars = 0; + lposition = 0; +} + + +void oscheck (void) { + MSG lpMsg; + +#if OSC + if (nosc_enabled) nosc_poll(); +#endif + + // check_aborted(); -- call to userio.c superceded by code here in winstuff.c +// printf("Current Thread: %d\n", GetCurrentThreadId()); //for debugging use + // look for Windows messages from NyqIDE (a Delphi program) + if ((redirect_flag) && (PeekMessage(&lpMsg, NULL, 0, 0, PM_REMOVE)!=0)) { + if (lpMsg.message == WM_CHAR) { + switch (lpMsg.wParam) { + case ABORT_CHAR: abort_flag = ABORT_LEVEL; + break; + case BREAK_CHAR: // for nyquist, defined to be 2 + case 7: // NyqIDE sends 7 (BEL) as break character + abort_flag = BREAK_LEVEL; + break; + } + // printf("Get message: %d %d %d\n", lpMsg.wParam, BREAK_CHAR, abort_flag); //for debugging use + } + } + if (abort_flag == ABORT_LEVEL) { + abort_flag = 0; + osflush(); + xltoplevel(); + } else if (abort_flag == BREAK_LEVEL) { + abort_flag = 0; + osflush(); + xlbreak("BREAK", s_unbound); + } +} +//Update end + +void oserror (char *msg) { + char line[100], *p; + sprintf (line,"error: %s\n",msg); + for (p = line; *p != '\0'; ++p) ostputc (*p); +} + +void osfinish(void) { + portaudio_exit(); + /* dispose of everything... */ +// if (linebuf) DisposPtr (linebuf); +// MacWrapUp (); +// ExitToShell (); +} + +int renamebackup (char *filename) { return 0; } + + + + +static WIN32_FIND_DATA FindFileData; +static HANDLE hFind = INVALID_HANDLE_VALUE; +#define OSDIR_LIST_READY 0 +#define OSDIR_LIST_STARTED 1 +#define OSDIR_LIST_DONE 2 +static int osdir_list_status = OSDIR_LIST_READY; +#define OSDIR_MAX_PATH 256 +static char osdir_path[OSDIR_MAX_PATH]; + +// osdir_list_start -- prepare to list a directory +int osdir_list_start(char *path) +{ + if (strlen(path) >= OSDIR_MAX_PATH - 2) { + xlcerror("LISTDIR path too big", "return nil", NULL); + return FALSE; + } + strcpy(osdir_path, path); + strcat(osdir_path, "/*"); // make a pattern to match all files + if (osdir_list_status != OSDIR_LIST_READY) { + osdir_list_finish(); // close previously interrupted listing + } + hFind = FindFirstFile(osdir_path, &FindFileData); // get the "." + if (hFind == INVALID_HANDLE_VALUE) return FALSE; + if (FindNextFile(hFind, &FindFileData) == 0) return FALSE; // get the ".." + osdir_list_status = OSDIR_LIST_STARTED; + return TRUE; +} + + +char *osdir_list_next() +{ + if (FindNextFile(hFind, &FindFileData) == 0) { + osdir_list_status = OSDIR_LIST_DONE; + return NULL; + } + return FindFileData.cFileName; +} + +void osdir_list_finish() +{ + if (osdir_list_status != OSDIR_LIST_READY) { + FindClose(hFind); + } + osdir_list_status = OSDIR_LIST_READY; +} + + +/* xechoenabled -- set/clear echo_enabled flag (unix only) */ +LVAL xechoenabled() +{ + int flag = (xlgetarg() != NULL); + xllastarg(); + // echo_enabled = flag; -- do nothing in Windows + return NULL; +} + + diff --git a/sys/win/nyqrelide.iss b/sys/win/nyqrelide.iss new file mode 100644 index 0000000..821c2bd --- /dev/null +++ b/sys/win/nyqrelide.iss @@ -0,0 +1,44 @@ +; Script generated by the Inno Setup Script Wizard.
+; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
+
+[Setup]
+; NOTE: The value of AppId uniquely identifies this application.
+; Do not use the same AppId value in installers for other applications.
+; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
+AppId={{3E29123D-0726-441C-8A38-42836B05F74C}
+AppName=NyquistIDE
+AppVerName=NyquistIDE 3.04
+AppPublisher=Roger B. Dannenberg
+AppPublisherURL=http://www.cs.cmu.edu/~music/nyquist
+AppSupportURL=http://www.cs.cmu.edu/~music/nyquist
+AppUpdatesURL=http://www.cs.cmu.edu/~music/nyquist
+DefaultDirName={pf}\Nyquist
+DefaultGroupName=Nyquist
+LicenseFile=C:\Users\rbd\nyquist\nyqrelide\license.txt
+InfoAfterFile=C:\Users\rbd\nyquist\nyqrelide\Readme.txt
+OutputDir=setup
+OutputBaseFilename=setupnyqiderun
+SetupIconFile=C:\Users\rbd\nyquist\sys\win\wingui\nycon.ico
+Compression=lzma
+SolidCompression=yes
+
+[Languages]
+Name: "english"; MessagesFile: "compiler:Default.isl"
+
+[Tasks]
+Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
+
+[Files]
+Source: "C:\Users\rbd\nyquist\nyqrelide\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
+; NOTE: Don't use "Flags: ignoreversion" on any shared system files
+
+[Registry]
+Root: HKLM32; Subkey: "Software\CMU\Nyquist"; ValueType: string; ValueName: "XLISPPATH"; ValueData: "{app}\runtime,{app}\lib"
+
+[Icons]
+Name: "{group}\NyquistIDE"; Filename: "{app}\jnyqide.bat"; WorkingDir: "{app}"
+Name: "{commondesktop}\NyquistIDE"; Filename: "{app}\jnyqide.bat"; WorkingDir: "{app}"; Tasks: desktopicon
+
+[Run]
+Filename: "{app}\jnyqide.bat"; WorkingDir: "{app}"; Description: "{cm:LaunchProgram,NyquistIDE}"; Flags: shellexec postinstall skipifsilent
+
diff --git a/sys/win/wingui/button.h b/sys/win/wingui/button.h new file mode 100644 index 0000000..1f5e248 --- /dev/null +++ b/sys/win/wingui/button.h @@ -0,0 +1,2 @@ +// button.h -- simple slider input + diff --git a/sys/win/wingui/cppext.h b/sys/win/wingui/cppext.h new file mode 100644 index 0000000..319449a --- /dev/null +++ b/sys/win/wingui/cppext.h @@ -0,0 +1,39 @@ +#pragma warning( disable: 4237 ) // eub: temporary kludge + +// RBD -- this will define true, false, bool +#include "yvals.h" + +//these preprocessor checks seem to get rid of compiler +// error (redecl boolean) +// typedef int bool; +//#ifndef TRUE +#define TRUE 1 +#define FALSE 0 +//#endif + +#define EOS '\000' + +// now defined by yvals.h: +//#define true 1 +//#define false 0 + +#define MALLOC ::malloc // note -- these macros are not consistently used +#define FREE ::free + +void *MEMGET(long n); +void *MEMFREE(void *data, long n); + +#define STREQ(a, b) (strcmp((a), (b)) == 0) + +typedef unsigned long uint32; +typedef long int32; +typedef unsigned short uint16; +typedef short int16; +typedef unsigned char uint8; + +//istvan 082197 +// RBD commented out the following, instead, we're including yvals.h, +// a microsoft-dependent file +// #ifndef bool +// typedef unsigned char bool; +// #endif diff --git a/sys/win/wingui/longque.cpp b/sys/win/wingui/longque.cpp new file mode 100644 index 0000000..c477649 --- /dev/null +++ b/sys/win/wingui/longque.cpp @@ -0,0 +1,34 @@ +#include "stddef.h" +#include "cppext.h" +#include "longque.h" +#include "stdlib.h" + +void longque::init(int size) +{ + head = 0; + tail = 0; + count = 0; + max = size; + buff = (long *) malloc(sizeof(long) * size); +} + + +void longque::finish() +{ + free(buff); +} + + +//1 producer-consumer safe +long longque::remove() +{ + long l; + if (count <= 0) return 0; + count--; + l = buff[head++]; + if (head == max) head = 0; + return l; +} + + + diff --git a/sys/win/wingui/longque.h b/sys/win/wingui/longque.h new file mode 100644 index 0000000..c8e1e0a --- /dev/null +++ b/sys/win/wingui/longque.h @@ -0,0 +1,28 @@ +class longque { +public: + void init(int size); + void finish(); + //1 producer-consumer safe + void insert(long l) { + buff[tail] = l; + count++; + tail++; + if (tail == max) tail = 0; + } + long remove(); + bool fullp() { + return count >= max; + } + bool emptyp() { + return count <= 0; + } +protected: + int max; + long *buff; + int head; + int tail; + int count; +}; + + + diff --git a/sys/win/wingui/nycon.ico b/sys/win/wingui/nycon.ico Binary files differnew file mode 100644 index 0000000..92ce305 --- /dev/null +++ b/sys/win/wingui/nycon.ico diff --git a/sys/win/wingui/resource.h b/sys/win/wingui/resource.h new file mode 100644 index 0000000..7db69c1 --- /dev/null +++ b/sys/win/wingui/resource.h @@ -0,0 +1,21 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by winmain.rc +// +#define IDM_ABOUT 100 +#define IDI_NYCON 101 +#define ID_FILE_LOAD 101 +#define ID_FILE_RELOAD 102 +#define ID_FILE_EXIT 103 +#define IDC_STATIC -1 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 103 +#define _APS_NEXT_COMMAND_VALUE 104 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/sys/win/wingui/slider.h b/sys/win/wingui/slider.h new file mode 100644 index 0000000..9b765ad --- /dev/null +++ b/sys/win/wingui/slider.h @@ -0,0 +1,6 @@ +// slider.h -- simple slider input + +#define NUMSLIDERS 9 +extern HWND sliders[NUMSLIDERS]; + +void set_slider_pos(HWND hwnd, int ival); diff --git a/sys/win/wingui/textio.cpp b/sys/win/wingui/textio.cpp new file mode 100644 index 0000000..caa3926 --- /dev/null +++ b/sys/win/wingui/textio.cpp @@ -0,0 +1,244 @@ +// textio.cpp -- handles text input and output to edit control + + +/* +Overview of character input: + ostgetc is called to get characters from stdin for XLisp + ostgetc gets characters using ggetchar() and performs line editing + ggetchar gets characters using wait_ascii() + wait_ascii() get characters from typein:queue; it calls + process_win_events if there are no characters, and it returns + ABORT_CHAR or BREAK_CHAR if abort_flag is set + characters get into typein::queue when the key handler is called + + get_ascii is similar to wait_ascii, but it doesn't wait: it just + checks for input with process_win_events and returns a character + if there is one, otherwise, it returns false +*/ + +#include <stddef.h> +#include <stdarg.h> +#include <stdio.h> +#include <windows.h> +#include "cppext.h" +#include "longque.h" +#include "textio.h" +#include "typein.h" + +#include "button.h" +#include "slider.h" +#include "winmain.h" +#include "assert.h" +extern "C" { +#include "xlisp.h" +} + +#define GPRINTF_MESSAGE_LEN 500 + + +//istvanmerge +//int abort_flag = 0; + +longque typein::queue; + + +void typein::init() +{ + queue.init(100); +} + + +void typein::finish() +{ + queue.finish(); +} + + + +void typein::handler(char *inp) +{ + if (!queue.fullp()) { + if (*inp == ABORT_CHAR) { + abort_flag = ABORT_LEVEL; + free(inp); + } else if (!abort_flag && *inp == BREAK_CHAR) { + abort_flag = BREAK_LEVEL; + free(inp); + } else if (!abort_flag && *inp == INFO_CHAR) { + xinfo(); + free(inp); + } else queue.insert((long) inp); + } +} + + +extern char *next_ascii; + +int get_ascii(char *c) +{ + check_aborted(); /* input buffer check */ + if (!next_ascii && typein::queue.emptyp()) return false; + *c = wait_ascii(); + return true; // recurse with new string +} + + +/* check_aborted -- see if any characters are available, check for ctrl C */ + +int check_aborted() +{ + process_win_events(USE_PEEK); + /* handle input messages, if ^C, handler will set abort flag */ + return abort_flag; +} + + + +/* define with va_alist and use vsprintf to get temp */ +void gprintf(long where, char *format, ...) +{ + char temp[GPRINTF_MESSAGE_LEN]; + va_list pvar; + va_start(pvar, format); + _vsnprintf(temp, GPRINTF_MESSAGE_LEN, format, pvar); + va_end(pvar); + + switch((long) where) { + case GTRANS: + break; + case GERROR: + break; + case GFATAL: + edit_append("FATAL: "); + edit_append(temp); + break; + case GDEBUG: + edit_append("DEBUG: "); + edit_append(temp); + break; + default: + edit_append("UNKNOWN: "); + edit_append(temp); + break; + } + edit_append(temp); +} + + + +void nyquist_printf(char *format, ...) +{ + char temp[GPRINTF_MESSAGE_LEN]; + va_list pvar; + va_start(pvar, format); + _vsnprintf(temp, GPRINTF_MESSAGE_LEN, format, pvar); + va_end(pvar); + edit_append(temp); +} + + +/************************************************************************** +* gputchar +* General putchar +**************************************************************************/ + +void gputchar(int c) +{ + char tmp[4]; + tmp[0] = c; + tmp[1] = 0; + edit_append(tmp); +} + + +/************************************************************************** +* ggetchar +* General getchar +**************************************************************************/ + +int ggetchar() +{ + return wait_ascii(); +} + +/************************************************************************** +* ggets +* General gets +**************************************************************************/ + + +char *ggets(char *str) +{ + char *s = str; + int c; + + do { + c = ggetchar(); + if (c == '\b' /* backspace */) { + if (s != str) { + gputchar('\b'); + gputchar((int)' '); + gputchar('\b'); + s--; + } else { + gputchar((int)0x07); + } + } else *s++ = (char) c; + } while (c != (int) '\n' && !abort_flag); + + *(s-1) = EOS; + if (abort_flag) *str = EOS; + return str; +} + + +/**************************************************************************** +* askbool +* Inputs: +* char *prompt: string to prompt for user input +* int deflt: true or false default +* Returns: +* boolean: true or false as entered by user +* Effect: +* prompts user for yes or no input, returns result +****************************************************************************/ + +int askbool(char *prompt, int deflt) +{ +#define undefined -1 + char defchar; /* the default answer */ + char c; /* user input */ + char in_string[100]; + int result = -1; /* the result: -1 = undefined, 0 = false, 1 = true */ + if (deflt) defchar = 'y'; + else defchar = 'n'; + while (result == undefined) { + gprintf(GTRANS, "%s? [%c]: ", prompt, defchar); + ggets(in_string); + c = in_string[0]; + if (islower(c)) c = toupper(c); + if (c == 'Y') result = true; + else if (c == 'N') result = false; + else if (c == EOS) result = deflt; + else if (abort_flag) result = deflt; + /* space before Please to separate from user's type-in: */ + else gprintf(GTRANS, " Please type Y or N.\n"); + } + if (abort_flag == BREAK_LEVEL) { + abort_flag = 0; + result = deflt; + gprintf(GTRANS, "\n"); + } + return result; +} + + + + +void io_init() +{ +} + + + + diff --git a/sys/win/wingui/textio.h b/sys/win/wingui/textio.h new file mode 100644 index 0000000..002d253 --- /dev/null +++ b/sys/win/wingui/textio.h @@ -0,0 +1,36 @@ +#define CR '\n' +#define ABORT_CHAR 0x03 +#define BREAK_CHAR 0x02 +#define CLEANUP_CHAR 0x07 +#define INFO_CHAR '\024' + +#define BREAK_LEVEL 1 +#define ABORT_LEVEL 2 + +#ifdef __cplusplus +extern "C" { +#endif + +int ggetchar(void); +void gprintf(long where, char *format, ...); +void gputchar(int c); +int get_ascii(char *c); +char *ggets(char *str); +int check_aborted(); +int askbool(char *prompt, int deflt); +char wait_ascii(); +void io_init(); +/* this is not entirely kosher: nyquist_printf is also declared in sound.h + so that all C programs will see it. Perhaps it should go into cext.h, but + I'm not sure I want to drag all that into here. + */ +void nyquist_printf(char *format, ...); + +#ifdef __cplusplus +} +#endif + +#define GTRANS 0 +#define GERROR 1 +#define GFATAL 2 +#define GDEBUG 3 diff --git a/sys/win/wingui/typein.h b/sys/win/wingui/typein.h new file mode 100644 index 0000000..3ab5b75 --- /dev/null +++ b/sys/win/wingui/typein.h @@ -0,0 +1,8 @@ +class typein { +public: + static longque queue; + static void init(void); + static void finish(void); + static void handler(char *inp); +}; + diff --git a/sys/win/wingui/winguistuff.c b/sys/win/wingui/winguistuff.c new file mode 100644 index 0000000..ec9857b --- /dev/null +++ b/sys/win/wingui/winguistuff.c @@ -0,0 +1,344 @@ +/* winstuff.c - windows interface routines for xlisp */ +/* Written by Chris Tchou. */ +/* This file contains the stuff that the other xlisp files call directly. */ + +#include "windows.h" +#include <stdio.h> +//#include <QuickDraw.h> /* for Random */ +#include <memory.h> /* for DisposPtr */ +#include <string.h> +//#include <SegLoad.h> /* for ExitToShell */ +#include "xlisp.h" +#include "textio.h" + +#if OSC +#include "sliders.h" /* define sliders */ +#include "sound.h" /* define nosc_enabled */ +#endif + +const char os_pathchar = '\\'; +const char os_sepchar = ','; + + +/* externals */ +extern FILE *tfp; /* transcript file pointer */ +extern int cursorPos; +extern char *macgets (void); + +#define LBSIZE 200 + +/* local variables */ +static char lbuf[LBSIZE]; +static int lpos[LBSIZE]; +static int lindex; +static int lcount = 0; +static int lposition; +static int line_edit = TRUE; + +//int isascii (char c) { return 1; } /* every char is an ascii char, isn't it? */ + +void osinit (char *banner) { +// int i; + char version[] = "\nWindows console interface by Roger Dannenberg.\n"; +// InitMac (); /* initialize the mac interface routines */ +// lposition = 0; /* initialize the line editor */ +// for (i = 0; banner[i] != '\0'; i++) macputc (banner[i]); +// for (i = 0; version[i] != '\0'; i++) macputc (version[i]); + nyquist_printf(banner); + nyquist_printf(version); +} + + +FILE *osaopen (char *name, char *mode) { + return fopen (name, mode); +} + +FILE *osbopen (char *name, char *mode) { + char nmode[4]; + strcpy (nmode, mode); strcat (nmode, "b"); + return (fopen (name, nmode)); +} + +int osclose (FILE *fp) { return (fclose (fp)); } +int osaputc (int ch, FILE *fp) { return (putc (ch, fp)); } +int osbputc (int ch, FILE *fp) { return (putc (ch, fp)); } +void osoutflush(FILE *fp) { fflush(fp); } + +/* osagetc - get a character from an ascii file */ +int osagetc(fp) + FILE *fp; +{ + return (getc(fp)); +} + + +extern int abort_flag; + + +#define OLDGETC +#ifdef OLDGETC + +int ostgetc (void) { +/* int i; + + if (numChars <= 0) { /* get some more */ +/* if (linebuf) DisposPtr (linebuf); + linebuf = macgets (); + i = 0; + while (linebuf[i] != '\0') i++; + numChars = i; + if (tfp) for (i = 0; i < numChars; i++) osaputc (linebuf[i], tfp); + lineptr = linebuf; + } + numChars--; + if (*lineptr == '\r') { + lineptr++; + return '\n'; + } else return (*lineptr++);*/ + + int ch = ggetchar(); + oscheck(); /* in case user typed ^C */ + if (ch == BREAK_CHAR && abort_flag == BREAK_LEVEL) { + abort_flag = 0; + } + return ch; +} + +#else + +void end_of_line_edit() +{ + line_edit = FALSE; + if (tfp) { + for (lindex = 0; lindex < lcount; ++lindex) + osaputc(lbuf[lindex], tfp); + } + lindex = 0; +} + + + +int ostgetc() +{ +/* + * NOTE: lbuf[] accumulates characters as they are typed + * lpos[] is the column position of the characters + * lcount is the number of characters in lbuf + * lposition is current position + * lindex is index of next char to output + * line_edit is true iff we're inputing characters + * + */ + int ch; + + while (line_edit) { + ch = ggetchar(); + oscheck(); /* in case user typed ^C */ + if (ch == BREAK_CHAR && abort_flag == BREAK_LEVEL) { + abort_flag = 0; + } + /* assume for now we should add the character */ + lbuf[lcount] = ch; + lpos[lcount] = lposition; + lcount++; + lposition++; + + /* now do all the special character processing */ + switch (ch) { + case '\n': + lposition = 0; + end_of_line_edit(); + gputchar('\r'); + gputchar(ch); + break; + /* delete key generates: 1b, 5b, 33, 7E + which is: ESC, [, 3, ~ */ + case '\010': /* backspace */ + case '\177': /* delete */ + lcount--; /* take out backspace or delete char */ + lposition--; + if (lcount) { + lcount--; + while (lposition > lpos[lcount]) { + gputchar('\010'); + gputchar(' '); + gputchar('\010'); + lposition--; + } + } + break; + case '\025': /* control-u */ + lcount--; + lposition--; + if (lcount) { + while (lposition > lpos[0]) { + gputchar('\010'); + gputchar(' '); + gputchar('\010'); + lposition--; + } + lcount = 0; + } + break; + + /* note that control-z never reaches here */ + case '\003': /* control-c */ + xltoplevel(); + lcount = 0; + break; + case '\007': /* control-g */ + xlcleanup(); + lcount = 0; + break; + case '\020': /* control-p */ + xlcontinue(); + lcount = 0; + break; + case '\002': + ostputc('\n'); /* control-b */ + xlbreak("BREAK",s_unbound); + break; + case '\024': /* control-t */ + xinfo(); + lcount = 0; + break; + case '\t': /* TAB */ + lposition--; /* undo the increment above */ + do { + lposition++; + gputchar(' '); + } while (lposition & 7); + break; + default: + gputchar(ch); + break; + } + } + if (lindex + 1 >= lcount) { + lcount = 0; + line_edit = TRUE; + } + ch = lbuf[lindex++]; + /* printf("[%c]", ch); */ + fflush(stdout); + return ch; +} +#endif + + +void ostputc (int ch) { +// macputc (ch); + gputchar(ch); // console + + if (tfp) osaputc (ch, tfp); +} + +void ostoutflush() +{ + if (tfp) fflush(tfp); + /* since ostputc calls gputchar which just calls putchar, + I'm going to flush stdout rather than extending the + "g" abstraction with a gflush() call. -RBD + */ + fflush(stdout); +} + +void osflush (void) { + lindex = lcount = lposition = 0; + line_edit = TRUE; +} + +extern int abort_flag; + +void oscheck (void) { + +#if OSC + if (nosc_enabled) nosc_poll(); +#endif + + check_aborted(); + if (abort_flag == ABORT_LEVEL) { + abort_flag = 0; + osflush(); + xltoplevel(); + } else if (abort_flag == BREAK_LEVEL) { + abort_flag = 0; + osflush(); + xlbreak("BREAK",s_unbound); + } +} + +void oserror (char *msg) { + char line[100], *p; + sprintf (line,"error: %s\n",msg); + for (p = line; *p != '\0'; ++p) ostputc (*p); +} + +void osfinish (void) { + portaudio_exit(); + /* dispose of everything... */ +// if (linebuf) DisposPtr (linebuf); +// MacWrapUp (); +// ExitToShell (); +} + +int renamebackup (char *filename) { return 0; } + + + +static WIN32_FIND_DATA FindFileData; +static HANDLE hFind = INVALID_HANDLE_VALUE; +#define OSDIR_LIST_READY 0 +#define OSDIR_LIST_STARTED 1 +#define OSDIR_LIST_DONE 2 +static osdir_list_status = OSDIR_LIST_READY; +#define OSDIR_MAX_PATH 256 +static char osdir_path[OSDIR_MAX_PATH]; + +// osdir_list_start -- prepare to list a directory +int osdir_list_start(char *path) +{ + if (strlen(path) >= OSDIR_MAX_PATH - 2) { + xlcerror("LISTDIR path too big", "return nil", NULL); + return FALSE; + } + strcpy(osdir_path, path); + strcat(osdir_path, "/*"); // make a pattern to match all files + if (osdir_list_status != OSDIR_LIST_READY) { + osdir_list_finish(); // close previously interrupted listing + } + hFind = FindFirstFile(osdir_path, &FindFileData); // get the "." + if (hFind == INVALID_HANDLE_VALUE) return FALSE; + if (FindNextFile(hFind, &FindFileData) == 0) return FALSE; // get the ".." + osdir_list_status = OSDIR_LIST_STARTED; + return TRUE; +} + + +char *osdir_list_next() +{ + if (FindNextFile(hFind, &FindFileData) == 0) { + osdir_list_status = OSDIR_LIST_DONE; + return NULL; + } + return FindFileData.cFileName; +} + +void osdir_list_finish() +{ + if (osdir_list_status != OSDIR_LIST_READY) { + FindClose(hFind); + } + osdir_list_status = OSDIR_LIST_READY; +} + + +/* xechoenabled -- set/clear echo_enabled flag (unix only) */ +LVAL xechoenabled() +{ + int flag = (xlgetarg() != NULL); + xllastarg(); + // echo_enabled = flag; -- do nothing in Windows + return NULL; +} + diff --git a/sys/win/wingui/winmain.aps b/sys/win/wingui/winmain.aps Binary files differnew file mode 100644 index 0000000..9efff7e --- /dev/null +++ b/sys/win/wingui/winmain.aps diff --git a/sys/win/wingui/winmain.cpp b/sys/win/wingui/winmain.cpp new file mode 100644 index 0000000..8b21f08 --- /dev/null +++ b/sys/win/wingui/winmain.cpp @@ -0,0 +1,657 @@ +#include "windows.h" /* required for all Windows applications */ +#include "cppext.h" +#include "longque.h" +#include "button.h" +#include "slider.h" +#include "winmain.h" /* specific to this program */ +#include "stdlib.h" +#include "string.h" +#include "stdio.h" +#include "textio.h" +#include "mmsystem.h" +#include <crtdbg.h> +#include <mapiwin.h> // for Sleep() +#include "stdio.h" +#include "resource.h" +#include "typein.h" +#include "xlispfns.h" +#include "winfun.h" + +//#define THUMBTRACK // tries to get continuous scrollbars with SB_THUMBTRACK messages. + // doesn't work -- zone 1 doesn't seem to wake up until the button-up. + +//#include "saudio.h" + +//#define D if(0) + +HWND buttons[NUMBUTTONS]; +HWND sliders[NUMSLIDERS]; + +HWND textinput; +HWND textoutput; +HFONT hfont; + +HWND alt_win; +WNDPROC alt_proc; + + +extern "C" { + HINSTANCE hInst; /* current instance */ + HWND hMainWindow; /* main window handle */ +} +/* HINSTANCE hInst; /* current instance */ +/* HWND hMainWindow; /* main window handle */ + + +int quit_value; // return value from WinMain +int abort_flag = 0; + + +// there's some state here: +// when we get a message from the input queue, it is an entire +// string. We save the string and a pointer to the next char +// +char *get_ascii_string = NULL; +char *next_ascii = NULL; + +//asciiwait -- wait for ascii input +char wait_ascii() +{ + if (next_ascii && *next_ascii) { + char c = *next_ascii++; + if (c == '\r') c = '\n'; + _RPT1(_CRT_WARN, "|%c|", c); + return c; + } + if (get_ascii_string) { + _RPT2(_CRT_WARN, "free get_ascii_string %x %s\n", + get_ascii_string, get_ascii_string); + free(get_ascii_string); + get_ascii_string = NULL; + next_ascii = NULL; + } + // no input, so look for Windows messages + while (typein::queue.emptyp() && !abort_flag) { + process_win_events(USE_GET); + } + if (abort_flag == ABORT_LEVEL) return ABORT_CHAR; + if (abort_flag == BREAK_LEVEL) return BREAK_CHAR; + get_ascii_string = (char *) typein::queue.remove(); + _RPT2(_CRT_WARN, "removed %x: %s\n", get_ascii_string, get_ascii_string); + edit_append(get_ascii_string); + next_ascii = get_ascii_string; + return wait_ascii(); +} + + +//process_win_events -- receive and handle windows by either: +// USE_PEEK: non-blocking +// USE_GET: blocks +void process_win_events(int method) +{ + MSG msg; + edit_append(""); // flush the output + if (method == USE_GET) { + //blocks until at least a message arrives + if (GetMessage(&msg, //msg stored here + NULL, //receive ALL application messages + NULL,NULL)) //no msg filtering + { + //standard windows loop + TranslateMessage(&msg); //posts another msg if there is a virtual to WM_CHAR mapping + DispatchMessage(&msg); //calls object's receive function + } else { + //is this ever entered??? + quit_value = msg.wParam; + abort_flag = ABORT_CHAR; + exit(0); + } + } else { + //default: process all messges that already exist (non-blocking) + while (PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE | PM_NOYIELD)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } +} + +//STUFF TO PROVIDE CONSOLE------------------------------------------------- +//terminate strings and strip out LF +int lf2crlf(char *dest, char *src) +{ + char *d = dest; + while (*src) { + if (*src == '\n') { + *dest++ = '\r'; + } + *dest++ = *src++; + } + *dest = EOS; + return dest - d; /* string length */ +} + +#define EDIT_HIGH_WATER 10000 +#define EDIT_LOW_WATER 9000 + +#define EABUFFMAX 110 +static char eabuff[EABUFFMAX]; /* edit_append buffer */ +static char eabuffx = 0; + +static void edit_append2(char *txt2); + +/* edit_append -- optimizes output by buffering + * + * call with empty string to flush buffer + */ +void edit_append(char *txt) +{ + /* new algorithm to deal with long strings on input: + * if input is longer than 50, insert a zero and + * call recursively; then undo the zero and continue. + */ + char txt2[100]; + while (strlen(txt) > 50) { + char temp = txt[50]; + txt[50] = 0; + edit_append(txt); /* strlen(txt) == 50 */ + txt = txt + 50; + txt[0] = temp; + } + int len = lf2crlf(txt2, txt); + if ((eabuffx + len + 1 > EABUFFMAX) || ((len == 0) && eabuffx)) { + edit_append2(eabuff); + eabuffx = 0; + } + strcpy(eabuff + eabuffx, txt2); + eabuffx += len; +} + + +static void edit_append2(char *txt2) +{ + int len; + int lines; + if (*txt2 == '\b') { // special case: erase last character + long len = SendMessage(textoutput, WM_GETTEXTLENGTH, (WPARAM) 0, (LPARAM) 0); + if (len > 0) { + // select the last character: + SendMessage(textoutput, EM_SETSEL, (WPARAM) len - 1, (LPARAM) -1); + // delete the last character: + SendMessage(textoutput, EM_REPLACESEL, (WPARAM) 0, (LPARAM) ((LPSTR) "")); + } + return; + } + // to put insertion point at the end, first select + // everything ... + //wparam is UINT ; lparam is LONG + SendMessage(textoutput, EM_SETSEL, (WPARAM) 0, (LPARAM) -1); + // then remove selection, leaving cursor at the end: + SendMessage(textoutput, EM_SETSEL, (WPARAM) -1, (LPARAM) -1); + // now, replacement actually appends to the buffer: + SendMessage(textoutput, EM_REPLACESEL, (WPARAM) 0, (LPARAM) ((LPSTR) txt2)); + // if the number of characters exceeds EDIT_HIGH_WATER, then + // trim the number of characters to EDIT_LOW_WATER by deleting + // all lines up to the one containing total-EDIT_LOW_WATER + lines = (int) SendMessage(textoutput, EM_GETLINECOUNT, (WPARAM) 0, (LPARAM) 0); + len = (int) SendMessage(textoutput, EM_LINEINDEX, (WPARAM)(lines - 1), (LPARAM) 0); + len += (int) SendMessage(textoutput, EM_LINELENGTH, (WPARAM)(lines - 1), (LPARAM) 0); + if (len > EDIT_HIGH_WATER) { + //these SendMessages operate to completion + lines = (int) SendMessage(textoutput, EM_LINEFROMCHAR, + (WPARAM)(len - EDIT_LOW_WATER), (LPARAM) 0); + len = (int) SendMessage(textoutput, EM_LINEINDEX, (WPARAM)(lines), (LPARAM) 0); + SendMessage(textoutput, EM_SETSEL, (WPARAM) 0, (LPARAM)(len)); + SendMessage(textoutput, EM_REPLACESEL, (WPARAM) 0, (LPARAM) ((LPSTR) "")); + } +} + +//THE STUFF REQUIRED BY WINDOWS APPLICATIONS---------------------------------- + + +// we will subclass the textinput window with a window procedure that detects +// the Enter key (hex 0x0d) and sets a flag. Then in the main window proc, +// when an EN_CHANGE message is received, we will know the user typed Enter, +// so we can transfer the text to XLISP. +// +// This would be a good place also to add editing characters to scroll through +// previous entries. +// +WNDPROC DefaultEditWndProc = NULL; +#define ENTER_KEY 0x0d +bool enter_flag = false; + + +long CALLBACK EditWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + if (message == WM_CHAR) { + if (wParam == ENTER_KEY) enter_flag = true; + _RPT1(_CRT_WARN, "wm_char is %x\n", wParam); + } + return CallWindowProc(DefaultEditWndProc, hWnd, message, wParam, lParam); +} + + + +//All applications need to register +BOOL InitApplication(HINSTANCE hInstance /* current instance */) +{ + WNDCLASS wc; + + /* Fill in window class structure with parameters that describe the */ + /* main window. */ + wc.style = NULL; /* Class style(s). */ + wc.lpfnWndProc = MainWndProc; /* Function to retrieve messages for */ + /* windows of this class. */ + wc.cbClsExtra = 0; /* No per-class extra data. */ + wc.cbWndExtra = 0; /* No per-window extra data. */ + wc.hInstance = hInstance; /* Application that owns the class. */ + wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_NYCON)); + wc.hCursor = LoadCursor(NULL, IDC_ARROW); + wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); + wc.lpszMenuName = "MAINMENU"; /* Name of menu resource in .RC file. */ + wc.lpszClassName = "CMTWClass"; /* Name used in call to CreateWindow. */ + + /* Register the window class and return success/failure code. */ + return (RegisterClass(&wc)); + +} + + +static char *button_names[NUMBUTTONS] = { "Load File", "Reload File", + "Replay Sound", "Break", "Top", "Up", "Info", "F1", "F2", "F3", "F4" }; + + +//each time this application is run, the following program must be run +BOOL InitInstance( + HINSTANCE hInstance, /* Current instance identifier. */ + int nCmdShow) /* Param for first ShowWindow() call. */ +{ + int i; + RECT rect; + LRESULT rslt; + + /* Save the instance handle in static variable, which will be used in */ + /* many subsequent calls from this application to Windows. */ + + hInst = hInstance; + + /* Create a main window for this application instance. */ + + hMainWindow = CreateWindow( + "CMTWClass", /* See RegisterClass() call. */ + "Nyquist", /* Text for window title bar. */ + WS_OVERLAPPEDWINDOW, /* Window style. */ + CW_USEDEFAULT, /* Default horizontal position. */ + CW_USEDEFAULT, /* Default vertical position. */ + CW_USEDEFAULT, /* Default width. */ + CW_USEDEFAULT, /* Default height. */ + NULL, /* Overlapped windows have no parent. */ + NULL, /* Use the window class menu. */ + hInstance, /* This instance owns this window. */ + NULL /* Pointer not needed. */ + ); + + /* If window could not be created, return "failure" */ + + if (!hMainWindow) + return (FALSE); + + GetClientRect(hMainWindow, (LPRECT) &rect); + + /* Make the window visible; update its client area; and return "success" */ + + const int button_y = 25; // size in pixels + const int slider_x = 20; + const int slider_gap = 1; + const int input_height = 48; // how high is input type-in edit control + int slider_xsum = slider_x * NUMSLIDERS; + int button_ysum = button_y * NUMBUTTONS_VERT; + + + ShowWindow(hMainWindow, nCmdShow); /* Show the window */ + UpdateWindow(hMainWindow); /* Sends WM_PAINT message */ + for (i = 0; i < NUMBUTTONS; i++) { + int x = 0; + int y = i * button_y; + int width = slider_xsum; + if (i > 2) { + y = (3 + (i - 3) / 2) * button_y; + width = width / 2; + if ((i & 1) == 0) x = width; + } + buttons[i] = CreateWindow("Button", //lpszClassName + button_names[i],//windowName + BS_PUSHBUTTON | //Style: 1) PB + WS_CHILD | // 2) must reside w/in parent + WS_VISIBLE, // 3) initially visible + x, y, width, button_y, + hMainWindow, //owner window + (HMENU)(IDC_BUTTON+i), + //&buttonsH[i], //child window Id + hInstance, //application instance + NULL); //WM_CREATE argument + + //activate current window & display w/current size and position + ShowWindow(buttons[i], SW_SHOW); + //update (nonempty) client area via WM_PAINT + UpdateWindow(buttons[i]); + } + + for (i=0; i<NUMSLIDERS; ++i) { + char name[5]; + sprintf(name, "%d", i); + sliders[i] = CreateWindow("Scrollbar", name, WS_CHILD | WS_VISIBLE | SBS_VERT /*| WS_BORDER */, + slider_x * i + slider_gap, button_ysum, slider_x - slider_gap, (rect.bottom - rect.top) - button_ysum, + hMainWindow, (HMENU)(IDC_SLIDER+i), hInstance, NULL); // (was IDC_BUTTON) + SetScrollRange(sliders[i], SB_CTL, 0, 127, 1); + ShowWindow(sliders[i], SW_SHOW); + UpdateWindow(sliders[i]); + } + + + + textinput = CreateWindow("Edit", NULL, + WS_CHILD | WS_VISIBLE | ES_MULTILINE | + WS_VSCROLL | ES_AUTOVSCROLL | WS_BORDER, + slider_xsum, 0, + (rect.right - rect.left) - slider_xsum, + input_height, + hMainWindow, (HMENU)(IDC_EDIT_INPUT), hInstance, NULL); + // subclass the input window so we can catch the Enter key + DefaultEditWndProc = (WNDPROC) SetWindowLong(textinput, GWL_WNDPROC, (long) EditWndProc); + + textoutput = CreateWindow("Edit", NULL, + WS_CHILD | WS_VISIBLE | ES_MULTILINE | ES_READONLY | + WS_VSCROLL | ES_AUTOVSCROLL | WS_BORDER, + slider_xsum, input_height - 1, + (rect.right - rect.left) - slider_xsum, + (rect.bottom - rect.top) - input_height, + hMainWindow, (HMENU)(IDC_EDIT), hInstance, NULL); + + hfont = CreateFont(0, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, + ANSI_CHARSET, OUT_RASTER_PRECIS, CLIP_DEFAULT_PRECIS, + DEFAULT_QUALITY, FIXED_PITCH | FF_DONTCARE, + "Courier"); + + + rslt = SendMessage(textoutput, WM_SETFONT, (WPARAM) hfont, + MAKELPARAM(TRUE, 0)); + + ShowWindow(textoutput, SW_SHOW); + UpdateWindow(textoutput); + + rslt = SendMessage(textinput, WM_SETFONT, (WPARAM) hfont, + MAKELPARAM(TRUE, 0)); + + ShowWindow(textinput, SW_SHOW); + UpdateWindow(textinput); + + return (TRUE); /* Returns the value from PostQuitMessage */ + +} + +//this is the hook called where any windows application starts up +extern "C" int WINAPI WinMain( + HINSTANCE hInstance, /* current instance */ + HINSTANCE hPrevInstance, /* previous instance */ + LPSTR lpCmdLine, /* command line */ + int nCmdShow) /* show-window type (open/icon) */ +{ + _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_DEBUG); + _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_WNDW); // EUB + +#if defined(_DEBUG) && 0 + int flags = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); + flags |= _CRTDBG_CHECK_ALWAYS_DF; // do expensive memory checking -eub + flags |= _CRTDBG_LEAK_CHECK_DF; // check for leaks at termination + _CrtSetDbgFlag(flags); + _CrtCheckMemory(); +#endif + + typein::init(); + + if (!hPrevInstance) /* Other instances of app running? */ + if (!InitApplication(hInstance)) /* Initialize shared things */ + return (FALSE); /* Exits if unable to initialize */ + + /* Perform initializations that apply to a specific instance */ + + if (!InitInstance(hInstance, nCmdShow)) return (FALSE); + + run_xlisp(); + + return quit_value; +} + + +char *button_msgs[] = { + "(ny:load-file)\n", + "(ny:reload-file)\n", + "(r)\n", + "\002", + "\003", + "\007", + "\024", + "(F1)\n", + "(F2)\n", + "(F3)\n", + "(F4)\n" }; + + +static void type_this(char *ptr) +{ + char *s = (char *) malloc(strlen(ptr) + 1); + _RPT1(_CRT_WARN, "type_this mallocs %x\n", s); + strcpy(s, ptr); + typein::handler(s); +} + + + +//This is the Main Window Receive Function +long CALLBACK MainWndProc( + HWND hWnd, /* window handle */ + UINT message, /* type of message */ + WPARAM wParam, /* additional information */ + LPARAM lParam) /* additional information */ +{ + switch (message) { + case WM_CHAR: { + //message: character code is posted via Translate Message + TCHAR c = (TCHAR) wParam; + //lKeyData = lParam; extended, ctrl, etc keys are ignored!!! + // typein::handler(c); + break; + } + case WM_COMMAND: { + //message: command from application menu + short int code = HIWORD(wParam); + int wid = LOWORD(wParam); + HWND hwndCtrl = (HWND) lParam; + if (code == 0 && wid == IDM_ABOUT) { + DialogBox(hInst, /*current inst*/ "ABOUTBOX", /*resource to use*/ + hWnd, /* parent*/ (DLGPROC) About /*About() instance address*/); + } else if (code == 0 && wid == ID_FILE_LOAD) { + type_this(button_msgs[0]); + } else if (code == 0 && wid == ID_FILE_RELOAD) { + type_this(button_msgs[1]); + } else if (code == 0 && wid == ID_FILE_EXIT) { + type_this("(exit)\n"); + } else if (wid >= IDC_BUTTON && wid < IDC_BUTTON + NUMBUTTONS) { + SetFocus(textinput); /* get focus back */ + type_this(button_msgs[wid - IDC_BUTTON]); + } else if (wid == IDC_EDIT_INPUT) { + if (code == EN_CHANGE) { + if (enter_flag) { + enter_flag = false; + long len = SendMessage(hwndCtrl, WM_GETTEXTLENGTH, 0, 0); + len++; // allow for terminating null character + char *buffer = (char *) malloc(len); + SendMessage(hwndCtrl, WM_GETTEXT, (WPARAM) len, (LPARAM) buffer); + _RPT2(_CRT_WARN, "inserting %x: %s\n", buffer, buffer); + typein::handler(buffer); + SendMessage(hwndCtrl, WM_SETTEXT, (WPARAM) 0, (LPARAM) ""); + } + } + } else if (wid == IDC_EDIT) { + if (code == EN_CHANGE) { + } else { + } + } else { + /*Let Windows process it*/ + printf("unhandled: message %d\n", message); + return (DefWindowProc(hWnd, message, wParam, lParam)); + } + break; + } + case WM_DESTROY: + //message: window being destroyed + PostQuitMessage(0); + break; +#ifdef MOUSEBUTTON_INPUT + case WM_LBUTTONDOWN: { + //message: left mouse button pressed while cursor in client area + //never used, need SetCaputure??? + int /*???*/ xPos LOWORD(lParam); + int /*???*/ yPos HIWORD(lParam); + //int /*???*/ fwKeys; virtual keys not used!!! + buffer[0] = '<'; + _itoa(xPos,buffer+1,10/*radix*/); + i = strlen(buffer); + buffer[i++] = ','; + _itoa(yPos,buffer+i,10/*radix*/); + i = strlen(buffer); + buffer[i++] = '>'; + buffer[i] = 0; + edit_append(buffer); + break; +#endif +#ifdef DEBUGINPUT + //WM_USER msg codes are from the callbacks------------------------- + case WM_USER_TIMEOUT: { + //dummy message just unblocks GetMessage + break; + } + //remaining wMsg codes generated elsewhere------------------------------------ + case WM_KILLFOCUS: { + //message: this window's loosing focus, focus must be set to new window + HWND newFocus = (HWND) wParam; + if (newFocus == textoutput) { + //why not also set buttons, sliders...??? + SetFocus(hWnd); + } + break; + } + case WM_VSCROLL: { + //message: control bar scroll I/O + //where is window scroll bar handled??? + //why is this not also a WM_COMMAND??? + HWND hwndCtrl = (HWND) lParam; + short int nPos = HIWORD(wParam); + int code = LOWORD(wParam); + int i; + for (i = 0; i < NUMSLIDERS; i++) { + if (sliders[i] == hwndCtrl) { + int pos = GetScrollPos(hwndCtrl /*parent*/, SB_CTL /*control*/); + switch (code) { + case SB_LINEUP: pos--; break; + case SB_LINEDOWN: pos++; break; + case SB_PAGEUP: pos -= 10; break; + case SB_PAGEDOWN: pos += 10; break; + case SB_ENDSCROLL: + break; //why not continue??? + case SB_THUMBTRACK: +#ifdef THUMBTRACK + pos = nPos; + break; +#else + continue; // no silly multiple messages +#endif + //break; + case SB_THUMBPOSITION: +#ifndef THUMBTRACK + pos = nPos; +#endif + break; + case SB_TOP: pos = 0; break; + case SB_BOTTOM: pos = 127; break; + default: continue; //avoid SetScrollPos + } + // SetScrollRange() set the range to 0-127, but clip just to make sure: + if (pos < 0) pos = 0; + if (pos > 127) pos = 127; + if (code != SB_ENDSCROLL +#ifdef THUMBTRACK + && code != SB_THUMBTRACK +#endif + ) { + //ctrlevents.insert(CTRLEVENT(IDC_SLIDER + i, 127 - pos)); + } + SetScrollPos(hwndCtrl /*parent*/, SB_CTL /*control sb*/, pos /*new position*/, TRUE /*redraw*/); + break; + } + } + break; + } +#endif + default: + //Pass on all unproccessed messages + return (DefWindowProc(hWnd, message, wParam, lParam)); + } + return (NULL); //all messages currently return this... +} + + +/**************************************************************************** + + FUNCTION: About(HWND, unsigned, WORD, LONG) + + PURPOSE: Processes messages for "About" dialog box + + MESSAGES: + + WM_INITDIALOG - initialize dialog box + WM_COMMAND - Input received + + COMMENTS: + + No initialization is needed for this particular dialog box, but TRUE + must be returned to Windows. + + Wait for user to click on "Ok" button, then close the dialog box. + +****************************************************************************/ + +extern "C" BOOL CALLBACK About( + HWND hDlg, /* window handle of the dialog box */ + unsigned message, /* type of message */ + WORD wParam, /* message-specific information */ + LONG lParam) +{ + switch (message) + { + case WM_INITDIALOG: /* message: initialize dialog box */ + return (TRUE); + + case WM_COMMAND: /* message: received a command */ + if (wParam == IDOK /* "OK" box selected? */ + || wParam == IDCANCEL) /* System menu close command? */ + { + EndDialog(hDlg, TRUE); /* Exits the dialog box */ + return TRUE; + } + break; + } + return FALSE; /* Didn't process a message */ +} + + +/* Load File support */ + +extern "C" + +void RegisterWindow(HWND w, WNDPROC p) { + alt_win = w; + alt_proc = p; +} diff --git a/sys/win/wingui/winmain.h b/sys/win/wingui/winmain.h new file mode 100644 index 0000000..955a9c3 --- /dev/null +++ b/sys/win/wingui/winmain.h @@ -0,0 +1,28 @@ +#include "resource.h" + +#ifdef __cplusplus +extern "C" { +#endif + +BOOL InitApplication(HANDLE); +BOOL InitInstance(HANDLE, int); +long CALLBACK MainWndProc(HWND, UINT, WPARAM, LPARAM); +BOOL CALLBACK About(HWND, unsigned, WORD, LONG); +void RegisterWindow(HWND, WNDPROC); + +#define IDC_EDIT 300 +#define IDC_EDIT_INPUT 301 +#define IDC_BUTTON 400 +#define IDC_SLIDER 500 + +#define NUMBUTTONS 11 +// 7 buttons high: +#define NUMBUTTONS_VERT 7 + +extern int abort_flag; + +#ifdef __cplusplus +} +#endif + +#include "winmain2.h" diff --git a/sys/win/wingui/winmain.rc b/sys/win/wingui/winmain.rc new file mode 100644 index 0000000..9dd5de1 --- /dev/null +++ b/sys/win/wingui/winmain.rc @@ -0,0 +1,120 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +#undef APSTUDIO_HIDDEN_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +MAINMENU MENU DISCARDABLE +BEGIN + POPUP "&File" + BEGIN + MENUITEM "&Load...", ID_FILE_LOAD + MENUITEM "&Reload", ID_FILE_RELOAD + MENUITEM SEPARATOR + MENUITEM "E&xit", ID_FILE_EXIT + END + POPUP "&Help" + BEGIN + MENUITEM "&About Nyquist...", IDM_ABOUT + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +ABOUTBOX DIALOG DISCARDABLE 22, 17, 177, 98 +STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU +CAPTION "About Nyquist" +FONT 8, "MS Sans Serif" +BEGIN + CTEXT "Nyquist, a language for music composition",IDC_STATIC,0, + 5,177,8 + CTEXT " and sound synthesis.",IDC_STATIC,0,14,177,8 + CTEXT "Version 2.16",IDC_STATIC,0,76,177,8 + DEFPUSHBUTTON "OK",IDOK,145,84,32,14,WS_GROUP + CTEXT "Copyright (c) 2001, by Roger B. Dannenberg",IDC_STATIC, + 0,66,177,8 + CTEXT "http://www.cs.cmu.edu/~rbd/nyquist",IDC_STATIC,0,26,177, + 8 + ICON IDI_NYCON,IDC_STATIC,79,38,21,20 +END + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""windows.h""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_NYCON ICON DISCARDABLE "nycon.ico" +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/sys/win/wingui/winmain2.h b/sys/win/wingui/winmain2.h new file mode 100644 index 0000000..711bd76 --- /dev/null +++ b/sys/win/wingui/winmain2.h @@ -0,0 +1,41 @@ +extern int quit_flag; +extern int waiting_flag; +extern long start_time; // initial system time in ms +extern long the_time; // current time - updated by periodic interrupt + +extern HWND hMainWindow; /* main window handle */ + +void edit_append(char *txt); +void debugeventwait(); +bool get_mouse(int &x, int &y); +void wait_mouse(int &x, int &y); +void pause(long ms); + +// parameters to process_win_events() +#define USE_GET 0 +#define USE_PEEK 1 + +void process_win_events(int method); + +#define CTRLEVENT(a, b) (((long) (a))<<16 | (b)) + +#define WM_USER_TIMEOUT (WM_USER + 0) +#define WM_USER_TIMESHOW (WM_USER + 1) +#define WM_USER_TIMESHOW1 (WM_USER + 2) + +#define WM_USER_MIDI_INPUT (WM_USER + 10) +#define WM_USER_MIDISHOW (WM_USER + 11) +#define WM_USER_MIDISHOW1 (WM_USER + 12) + +#define WM_USER_MIDI_IN_ERROR (WM_USER + 20) +#define WM_USER_MIDI_OUT_ERROR (WM_USER + 21) + +#define TIMERCB 1 +#define MIDIINCB 2 +#define FROMTIMERCB(x) ((x) == TIMERCB) +#define FROMMIDIINCB(x) ((x) == MIDIINCB) + +#define TEXT_WIN_HT 200 + + + diff --git a/sys/win/wingui/xlextstart.c b/sys/win/wingui/xlextstart.c new file mode 100644 index 0000000..be321fe --- /dev/null +++ b/sys/win/wingui/xlextstart.c @@ -0,0 +1 @@ +/* nothing to do */ diff --git a/sys/win/wingui/xlispfns.c b/sys/win/wingui/xlispfns.c new file mode 100644 index 0000000..e9b0584 --- /dev/null +++ b/sys/win/wingui/xlispfns.c @@ -0,0 +1,11 @@ +#include "xlisp.h" +#include "xlispfns.h" + + +void run_xlisp() +{ + xlisp_main_init(0,NULL); + xlisp_main(); + /* clean up */ + xlisp_wrapup(); +} diff --git a/sys/win/wingui/xlispfns.h b/sys/win/wingui/xlispfns.h new file mode 100644 index 0000000..256584a --- /dev/null +++ b/sys/win/wingui/xlispfns.h @@ -0,0 +1,9 @@ +#ifdef __cplusplus +extern "C" { +#endif + +void run_xlisp(); + +#ifdef __cplusplus +} +#endif |