ftp.nice.ch/peanuts/GeneralData/Documents/dsp/DSPTutorial.tar.gz#/DSPTutorial/Examples/07_IBulder_and_Sound.prv/AllPass.m

This is AllPass.m in view mode; [Download] [Up]

/* Generated by Interface Builder */

#import "AllPass.h"
#define TWOPOW23 8388608

@implementation AllPass

- open
{
int s_err;
int i;

    [super open];
    SNDReadDSPfile([self findPath:"/DSP_Code/AllPass.lod"], &Effect, NULL);

    s_err = SNDBootDSP(dev_port, owner_port, Effect);
    if (s_err != SND_ERR_NONE) {
	fprintf(stderr,"Cannot boot dsp : %s\n", SNDSoundError(s_err));
	exit(1);
    }
    for(i=0;i<2;i++)
    {
	[sliders selectCellWithTag:1+i];
	[self sliderChange:sliders];
    }
    printf("DSP booted\n");
    return self;
}

- sliderChange:sender
{
int value;
int tag;
int DSPCommand;

    tag = [[sender selectedCell] tag] - 1;
    if(tag < 0) return self;
    DSPCommand = 20 + tag;
    switch(tag)
    {
	case 0 : value = [[sender selectedCell] intValue]; break ;
	case 1 : value = [[sender selectedCell] floatValue] * TWOPOW23 ; break;
    }
    snddriver_dsp_write(cmd_port,&value,1,sizeof(int),SNDDRIVER_HIGH_PRIORITY);
    snddriver_dsp_host_cmd(cmd_port,DSPCommand,SNDDRIVER_MED_PRIORITY);
    return self;
}


@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.