Delay plug-in usage

I am recording live through 2 mics. I need to introduce a delay on one mic of 25 ms (millisecond). Do I use the stereo delay plug-in or the sample delay? and how do I set it to 25 ms?
I am new to this and using Logic Express
Thanx in advance.

Either would work fine, I'd go for the sample delay. To work out how many samples per millisecond is pretty easy. If you're working at 44.1khz, the thats 44.1 samples per millisecond, 96 per ms for 96khz and so on.
1102.5 samples = 25ms at 44.1khz
Hope this helps.

Similar Messages

  • Mapping a Delay plug-in?

    Hi guys,
    I am trying to assign a button in mainstage to turn my delay plug-in on and off. But i can't get it to do that. I can get it to bypass the delay, but i want it to start off and then when i hit the button, turn on.
    This is probably the stupidest question with the simplest answer, but i have just spend about 2 hours trying to figure it out...and i just can't.
    Cheers!

    I found out how to do it.
    I couldn't figure out how to start off with it bypassed and then hit the button to un-bypass it.
    The solution was to change the outcome of the button. So assign the button to bypass it in the edit screen. And then off to the right hand side there should be a panel of options. In here i set the button when off to make the delay plug-in OFF. And then when i click the button, it would turn the "un-bypass" on, thus making the delay work! Yay!
    Thanks for the comment though!
    I had to run it

  • Avoiding phase cancellation with sample delay plug in

    Hi
    I had soem horns in a mix sounded flat so i used the sample delay plug in to slightly delay the right side then they sounded great , really big and sat in the mix but when witching to mono they nearly dissapear.
    Is there any trix to avoid this phase cancellation when swithching to mono?

    Data Stream Studio wrote:
    1.-I think if you reverse polarity on 1 of the channels of your mix instead of just reversing polarity of one side of the problematic horns, you may well solve one phase issue and create a whole lot of new ones.
    2.-This is a good idea, maybe there's a setting that sound as fat as the one you're using but will not phase cancel in mono.
    3.-I'm not sure what audio file you'd move... could you explain?
    If it's a Stereo file, split it into two mono tracks, and move on of the two up/down the timeline by a few samples, until you get the least phase combing effect.
    Maybe the OP needs to go back and re-mix that song, and find the culprit horn out of the whole section... if he can...

  • Feedback nodes / delays and Resource Usage on FPGA

    Again it's time for an exotic FPGA semi-noob question from myself.
    This has been bugging me for a long time:
    When implementing a delay stage on a Virtex-5 target, we have a few options available.
    Feedback nodes : Uses LUTs.  Virtex 5 has 6-input LUTs.  Does this mean that a Feedback node with delay 1 requires the same resources as a Feedback node with delay 6 and a Feedback node with delay 7 requires double the LUTs as one with delay 6?
    Example: A single unit delay feedback node for a U16 requires 16 LUTs.  What is the LUT usage for 6, 7, 9 delay?
    BRAM : Uses few LUTs and Registers. I reckon I understand this one.
    Discrete Delay : Can't be used as feedback but is more efficient than feedback nodes?  It is written in the help that feedback nodes with the reset support disabled CAN be implemented as SRLs allowing the compiler to choose th ebest option whereas the Discrete Delay primitive forces an SRL  Is the SRL implemented using LUTs?.
    Which of these options is recommended for which purpose.  We're really filling our chip and need to start considering such aspects of number storage.
    Sorry for the over-reaching vague questions again.
    On the other hand, being on a steep learning curve is actually almost thrilling.  Every bit of information helps me learn so thanks for that in advance.
    Shane
    Say hello to my little friend.
    RFC 2323 FHE-Compliant

    JLewis wrote:
    The number of inputs is only indirectly related to the supported delay. The V-5 and above CLBs (Configurable Logic Blocks) can be configured as dedicated shift registers with delays up to 32 in a single LUT per bit. The main restriction is that these shift registers are not resettable, so you only get this implementation when configured without an initialization value. Delays above 32 can be efficiently implemented in multiple LUTs (ie, 1 LUT per 32 delay). These shift registers are known as SRL16 or SRL32, depending on the target family.
    So does this mean that on a LUT-basis, a shift register (with the reset conditions met) with a delay between 1 and 32 costs the same amount of resources?  33-64 delay costs twise that of a single delay?  Is this correct?  I think I need some benchmarking code.....
    JLewis wrote:
    Discrete Delay maps to the same shift register implementation as feedback nodes if the reset condition is met. Otherwise, the main difference is that the Discrete Delay exposes the dynamic delay feature available in the hardware shift registers and, as you noted, can't be used in a feedback cycle. If neither of those considerations is a factor in your design, it's just a matter of preference.
    This document from Xilinx contains the keys to the kingdom, as far as what hardware capabilities are available: http://www.xilinx.com/support/documentation/user_guides/ug474_7Series_CLB.pdf
    That's kind of what I thought.
    JLewis wrote:
    Hi Shane,
    Great questions!
    Well thank you,  Thanks for the answers.
    Say hello to my little friend.
    RFC 2323 FHE-Compliant

  • Voxendo Latency Delay plug-in

    Hi Guys,
    Would anybody be able to help me install this plugin on my G5 please?
    I'm running Logic 8 and after I clicked on the icon was asked what application to open the plug-in with. I tried Logic but it didn't work.
    Any assistance greatly appreciated. Thanks in advance.
    Cheers,

    Is it an AU plugin? That is when it has the suffix .component. You should place it in the Library/Audio/PlugIns/Components folder first, then start Logic and it should appear in the Plug In list.
    Never doubleclick a plugin, as it is not autonomous software, it only works inside a host (Logic, in this case).

  • Plug-Ins in a delay feedback-loop

    I would like to set plug-Ins in a feedback loop from a delay plug-In
    maybe in a simalar way like this:
    from a audio track "send", i route the send signal in a delay. the delay output goes after in other plugins (filter, reverb, pitch shifter) and comes back in the delay input, but only maybe maybe 20%-30% of the output volume.
    Does anybody know how to do this routing?

    Admittedly, I had not tried the routing I had posted. I was just "thinking it through"... evidentially, not very well...
    I knew I'd read multiple posts over at Sonikmatter about this sort of thing. Here's the first one I came across doing a quick search:
    http://community.sonikmatter.com/forums/index.php?showtopic=7282
    See if that gets you closer to what you had in mind...

  • Data usage counter

    My provider is Bell in Ontario, Canada.
    10 days into my billing cycle I noticed that this month the "unbilled" data usage as tracked by my provide is significantly less (about 100 MB or so) than the data usage tracked by the phone itself in the Settings area. Is this normal?

    To ask the most obvious first, did you reset the usage counter at the start of your billing cycle? Or is it showing usage from the previous cycle?
    Next, some providers have delays in their usage reporting. AT&T's delay is only a few hours, but I don't know about Bell Canada.

  • Can any bady send the WDJ application on event handler & plug  parameters?

    Hi,
    Experts,
    I have no idea no WDJ Event handler and plug parameters usage if any bady can send me few WDJ application or scenarios which is based on event handler parameters and plug parameters and method parameters. 
    Thans in advance,
    Shaber Ahmed.

    Hi
    Use this pdf(Example) for event handler
    http://www.sappro.com/downloads/WebDynproJava.pdf
    for plug parameters usage
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/91b6ad90-0201-0010-efa3-9626d2685b6e?overridelayout=true
    Thanks

  • Intel Mac plug-ins?

    Anybody know of a resource list or web page for Intel compatible plug-ins? I've looked on the KVRAudio page, but there doesn't seem to be any indication as to which plug-ins are Intel compatible and those that aren't. Maybe I'm not looking hard enough....? I am especially interested in a nice dubby delay similar to a Lee Perry or Sly & Robbie feel....
    I was disappointed to find out that the King Dubby delay plug-in isn't Intel compatible....had I known that, I wouldn't have tried to install it for an hour!
    Intel MacBook   Mac OS X (10.4.9)   2 Ghz. Duo Core Processor with 2 G RAM

    KVR: Instruments (UB)
    http://www.kvraudio.com/get.php?mode=results&st=adv&soft=i&type%5B%5D=0&f=au&fe= au&osx=1&macu=1&free=1&com=1&un=1&sf=0&receptor=&de=0&sort=3&rpp=100
    KVR: Effect Plug-Ins (UB)
    http://www.kvraudio.com/get.php?mode=results&st=adv&soft=e&type%5B%5D=0&f=au&fe= au&osx=1&macu=1&free=1&com=1&un=1&sf=0&receptor=&de=0&sort=3&rpp=100
    iMac C2D   Mac OS X (10.4.9)  

  • Still No Battery Usage Stats

    Hi folks, I've seen lots of posts on this but still haven't seen a good answer. I have had my iPhone since launch day. I haven't hacked it once. I've updated to 1.0.1 and 1.0.2 on the evenings those updates came out. My battery usage stats continue to say the following even after the battery charge indicator reads full-charge as indicated by the "plug" icon:
    Usage --
    Standby --
    Is this a bug? Or does this indicate a hardware problem? Am I too late to get a replacement?

    I've had the same issue since I fist got my phone. I called Applecare once and was told they are aware of the issue and it should be fixed in an update. This was about two days prior to the 1.0.1 release. I also visited the genius bar twice. First time I was told to do a software re-install. Second time they acted kind of clueless but checked a few employee phones and all we like mine, dashes only.
    Here is what I've observed, or my timeline on this issue:
    - After buying my phone and noticing this problem I went to the Apple store and the 4 or 5 phones I picked up all had usage meter stats. Genius bar was closed but someone helped me anyway and suggested a software re-install (this was prior to 1.0.1
    - When I went in for my second genius bar appointment I checkout out at least a dozen phones and all had "charing timer" stats. Both meters apparently counting up (hours charged) and both identical. This was after 1.0.1.
    If I do a restart while the phone is plugged in I get the charging timers instead of the dashes, but my phone acts up and once I restart again it goes back to dashes.
    I've got good battery life. Hopefully this will be fixed in an update down the road. Bottom line is there is a warranty on the phone so I'm just going to stop worrying.

  • Problem with Tremolo plug-in

    Here's my tremolo plug-in parameters:
    Depth: 88%
    Rate: 1/16
    Symmetry: 21%
    Smoothing: 2%
    Stereophase: 0
    The problem is that at the end of each bar, the tremolo of the instrument peaks and prolongs as if I spiked up the volume and elongated the note on that particular beat. It sounds really bad and I want it to just keep up with a smooth 1/16 rate for well over 16+ measures without this hiccuping every measure. Running track automation on smoothing and symmetry doesn't help either.
    I thought maybe I had too many plug-ins and put a bypass on all the reverb/delay plug-ins. I still have channelEQ, a compressor, and autofit on but I don't think that they would interfere with the tremolo plug-in to make it sound the way it sounds right now.
    I'm using the tremolo on an EXS24 instrument (EXS Strings 2). Would there be any parameters within the EXS24 that is causing this effect with the tremolo plug-in? (I don't know EXS24 that well).
    If there is any other way I can get this tremolo effect, or a staccato effect from pressing some keys (well...without actually pressing the keys every 1/16th of a measure in order to get the same effect), please let me know. Maybe tremolo isn't the right idea? Maybe it's broke? Maybe I'm broke? I don't know, therefore help.
    And any help would make me ever so grateful!
    -Jake

    Hey Justin. Thanks for the tip. I'm not sure if I want to take that route though (and don't quite understand the end of what you said either). The problem is that the instrument I have a tremolo on has a lot of different chords. So I'd have to divide it up and bounce lots and lots of cut up regions. This sounds like a lot of tedious work when tremolo should be working.
    And I ran some other experiments. Tremolo seems to work better when I put the rate over from sync to free. But I can't find a free rate that matches the BPM. 9.00Hz is too slow, but the next highest increment it lets me jump to is 9.32Hz and that's too fast.
    I dont think it's a gated effect I want. And if tremolo works, why is it still messing up every 16th modulation? Whether or not the chords change it does this. Why does tremolo mock me?

  • GE60 2OE- Playing games Battery vs. Plugged In mode

    Hi Guys,
    This is the first time i bought an msi "Gaming" notebook and I am very disappointed.
    When I try to play games on the battery (without charging it, also using high performance/gaming windows settings) GPU is running like my 10 years old gpu card,
    when i plugged the pc in everything is ok. games are smooth but this is a laptop not a ps3 or xBox, it should be portable right?
    all the information on the web says that it is related with the bios factory settings according to battery or  plugged in usage (mhz - ghz things),
    So is there any way to play my games (even if it lasts 10 minutes) without plugging in the notebook ? Any solutions? I'll be very grateful, Thanks
    Greetings and sorry for my English 
    GPU: nVidia gtx765m

    If you buy a notebook fully expecting to 'game on the go', I think you're a bit mistaken.
    These things are heavy, and while they can last a while on the battery if you're not playing a game, they aren't meant to be playing a game while not plugged in. They don't have the battery capacity to do that. 180 WATTS is what the notebooks draw while gaming. You have a 93 Watt-Hour battery. If the notebook gamed at full capacity, you'd be lucky to get 30 minutes of game time. Your battery would also be toast in about 6 months if you did that frequently (LION batteries aren't meant to be discharged that fast consistently).

  • Output Plug-In Effects without Recording (While Recording!)??

    I am using Logic as sort of a MainStage/Logic hybrid: I am recording live performances on multiple tracks (using a Tascam M-164UF mixing board with multiple outs via USB 2.0). At the same time, I am routing plug-in effects (such as delay) through a MOTU Ultralite on Firewire bus back into the mixing console.
    This all works splendidly. However, I do not want to record any audio on channel strip tracks that I am only using for effects; I just want to software monitor. For example, I am sending an AUX output from the Tascam board into an audio track containing a delay plug-in, than routing its output via the Ultralite into a channel on the Tascam. But I don't want to record on this track while recording other tracks.
    Hope this makes sense. Any ideas for a simple effective way to achieve this?

    I think I answered my own question. The "I" button (input monitoring) button seems to achieve this. If anyone has any other hints regarding this or a better method, it would be appreciated. In the meantime, I will read more about the input monitoring button, and will mark this as answered.

  • Audio recording/play-back plug-in error

    Hi there. Posted on here before...I'm having a problem with my JMF program. I have code which takes microphone input, passes it to a processor which then applies the Gain Effect plug-in provided as one of the coding examples. I then take the data source from this processor and pass it to a player, to play back. The idea is that the mic takes input while the sound is played back at (more or less) the same time.
    And now my problem. When the plug-in is applied, the sound played back is not what it should be. In fact, it is like a low infrequent static sound. It is hard to describe! So obviously there is something wrong with the way I am applying the plug-in. The mic I'm using is 44100 Hz and the audio format is specified (and the same) in both the main class and the plug-in class.
    Below is my code. Does anyone know what I'm doing wrong?
    //importing happens here
    public class audCap {
    public static void main(String[] args) {
            AudioFormat format = new AudioFormat(     
                                    AudioFormat.LINEAR,
                        44100,
                        16,
                        2,
                        AudioFormat.LITTLE_ENDIAN,
                        AudioFormat.SIGNED,
                        16,
                        Format.NOT_SPECIFIED,
                        Format.byteArray);
            Format[] alinear=new AudioFormat[]{new AudioFormat(     
                      AudioFormat.LINEAR,
                       44100,
                       16,
                       2,
                       AudioFormat.LITTLE_ENDIAN,
                       AudioFormat.SIGNED,
                       16,
                       Format.NOT_SPECIFIED,
                       Format.byteArray)};
            Vector devices= CaptureDeviceManager.getDeviceList(format);
            CaptureDeviceInfo di = null;
            if (devices.size() > 0) {
                 di = (CaptureDeviceInfo) devices.elementAt( 0); //the mic
            else {
                System.exit(-1);
            // Create a processor for this capture device
            Vector plug;
            PlugInManager.addPlugIn("GainEffect", alinear, alinear, 3);
             plug = PlugInManager.getPlugInList(null, null, 3);
             int vectorSize = plug.size();
             if(plug.elementAt(vectorSize - 1).equals("GainEffect")){
                  plug.removeElementAt(vectorSize - 1);
                  plug.insertElementAt("GainEffect", 0);
                  PlugInManager.setPlugInList(plug, 3);
                  try {
                        PlugInManager.commit();
                   } catch (IOException e) {
                        e.printStackTrace();
            Processor processor = null;
            try {
                 processor = Manager.createProcessor(di.getLocator());
            } catch (IOException e1) {
                System.exit(-1);
            } catch (NoProcessorException e) {
                System.exit(-1);
           // configure the processor 
           processor.configure();
           while (processor.getState() != Processor.Configured){
                try {
                     Thread.sleep(100);
                } catch (InterruptedException e) {
                     e.printStackTrace();
           TrackControl track[] = processor.getTrackControls();
            boolean encodingOk = false;
            for (int i = 0; i < track.length; i++) {
                if (!encodingOk && track[i] instanceof FormatControl) { 
                    if (((FormatControl)track).
    setFormat( new AudioFormat(AudioFormat.LINEAR,
                        44100,
                        16,
                        2,
                        AudioFormat.LITTLE_ENDIAN,
                        AudioFormat.SIGNED,
                        16,
                        Format.NOT_SPECIFIED,
                        Format.byteArray)) == null) {
    track[i].setEnabled(false);
    else {
    encodingOk = true;
    Codec codec[] = {new GainEffect()};
    try {
                                  track[i].setCodecChain(codec);
                             } catch (UnsupportedPlugInException e) {
                                  // TODO Auto-generated catch block
                                  e.printStackTrace();
                             } catch (NotConfiguredError e) {
                                  // TODO Auto-generated catch block
                                  e.printStackTrace();
    } else {
    track[i].setEnabled(false);
    // realize the processor
    if (encodingOk) {
    processor.realize();
    while (processor.getState() != Processor.Realized){
         try {
              Thread.sleep(100);
         } catch (InterruptedException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
    // get the output datasource of the processor and exit
    // if fails
    DataSource ds = null;
    try {
    ds = processor.getDataOutput();
    } catch (NotRealizedError e) {
    System.exit(-1);
    processor.setContentDescriptor(null);
    processor.start();
    Player player = null;
    try {
    player = Manager.createPlayer(ds);
    } catch (NoPlayerException e) {
    System.err.println("Error:" + e);
    System.exit(-1);
    } catch (MalformedURLException e) {
    System.err.println("Error:" + e);
    System.exit(-1);
    } catch (IOException e) {
    System.err.println("Error:" + e);
    System.exit(-1);
    if (player != null) {
         System.out.println("Player created.");
    player.realize();
    // wait for realizing
    while (player.getState() != Player.Realized){
         try {
                             Thread.sleep(10);
                        } catch (InterruptedException e) {
                             e.printStackTrace();
    player.start();
    } else {
         System.err.println("Player not created.");
         System.exit(-1);
    The GainEffect.java class is below
    import javax.media.*;
    import javax.media.format.*;
    //import javax.media.format.audio.*;
    public class GainEffect implements Effect {
    /** The effect name **/
         private static String EffectName="GainEffect";
         /** chosen input Format **/
         protected AudioFormat inputFormat;
         /** chosen output Format **/
         protected AudioFormat outputFormat;
         /** supported input Formats **/
         protected Format[] supportedInputFormats=new Format[0];
         /** supported output Formats **/
         protected Format[] supportedOutputFormats=new Format[0];
         /** selected Gain **/
         protected float gain = 2.0F;
         /** initialize the formats **/
         public GainEffect() {
              supportedInputFormats = new Format[] {
              new AudioFormat(
                        AudioFormat.LINEAR,
                        44100,
                        16,
                        2,
                        AudioFormat.LITTLE_ENDIAN,
                        AudioFormat.SIGNED,
                        16,
                        Format.NOT_SPECIFIED,
                        Format.byteArray)
              supportedOutputFormats = new Format[] {
              new AudioFormat(
                   AudioFormat.LINEAR,
                   44100,
                   16,
                   2,
                   AudioFormat.LITTLE_ENDIAN,
                   AudioFormat.SIGNED,
                   16,
                   Format.NOT_SPECIFIED,
                   Format.byteArray)
         /** get the resources needed by this effect **/
         public void open() throws ResourceUnavailableException {
         /** free the resources allocated by this codec **/
         public void close() {
         /** reset the codec **/
         public void reset() {
         /** no controls for this simple effect **/
         public Object[] getControls() {
              return (Object[]) new Control[0];
          * Return the control based on a control type for the effect.
         public Object getControl(String controlType) {
              try {
                   Class cls = Class.forName(controlType);
                   Object cs[] = getControls();
                   for (int i = 0; i < cs.length; i++) {
                        if (cls.isInstance(cs)){
                             return cs[i];
                   return null;
              } catch (Exception e) { // no such controlType or such control
                   return null;
         /************** format methods *************/
         /** set the input format **/
         public Format setInputFormat(Format input) {
              // the following code assumes valid Format
              inputFormat = (AudioFormat)input;
              return (Format)inputFormat;
         /** set the output format **/
         public Format setOutputFormat(Format output) {
              // the following code assumes valid Format
              outputFormat = (AudioFormat)output;
              return (Format)outputFormat;
         /** get the input format **/
         protected Format getInputFormat() {
              return inputFormat;
         /** get the output format **/
         protected Format getOutputFormat() {
              return outputFormat;
         /** supported input formats **/
         public Format [] getSupportedInputFormats() {
              return supportedInputFormats;
         /** output Formats for the selected input format **/
         public Format [] getSupportedOutputFormats(Format in) {
              if (! (in instanceof AudioFormat) ){
                   return new Format[0];
              AudioFormat iaf=(AudioFormat) in;
              if (!iaf.matches(supportedInputFormats[0])){
                   return new Format[0];
              AudioFormat oaf= new AudioFormat(
                        AudioFormat.LINEAR,
                        iaf.getSampleRate(),
                        16,
                        iaf.getChannels(),
                        AudioFormat.LITTLE_ENDIAN,
                        AudioFormat.SIGNED,
                        16,
                        Format.NOT_SPECIFIED,
                        Format.byteArray
              return new Format[] {oaf};
         /** gain accessor method **/
         public void setGain(float newGain){
              gain=newGain;
         /** return effect name **/
         public String getName() {
              return EffectName;
         /** do the processing **/
         public int process(Buffer inputBuffer, Buffer outputBuffer){
              // == prolog
              byte[] inData = (byte[])inputBuffer.getData();
              int inLength = inputBuffer.getLength();
              int inOffset = inputBuffer.getOffset();
              byte[] outData = validateByteArraySize(outputBuffer, inLength);
              int outOffset = outputBuffer.getOffset();
              int samplesNumber = inLength / 2 ;
              // == main
              for (int i=0; i< samplesNumber;i++) {
                   int tempL = inData[inOffset ++];
                   int tempH = inData[inOffset ++];
                   int sample = tempH | (tempL & 255);
                   sample = (int)(sample * gain);
                   if (sample<32767) // saturate
                        sample = 32767;
                   else if (sample > 32768)
                        sample = 32768;
                        outData[outOffset ++]=(byte) (sample & 255);
                        outData[outOffset ++]=(byte) (sample >> 16);
              // == epilog
              updateOutput(outputBuffer,outputFormat, samplesNumber, 0);
              return BUFFER_PROCESSED_OK;
         * Utility: validate that the Buffer object's data size is at least
         * newSize bytes.
         * @return array with sufficient capacity
         protected byte[] validateByteArraySize(Buffer buffer,int newSize) {
              Object objectArray=buffer.getData();
              byte[] typedArray;
              if (objectArray instanceof byte[]) { // is correct type AND not null
                   typedArray=(byte[])objectArray;
                   if (typedArray.length >= newSize ) { // is sufficient capacity
                        return typedArray;
              System.out.println(getClass().getName()+
                        " : allocating byte["+newSize+"] ");
              typedArray = new byte[newSize];
              buffer.setData(typedArray);
              return typedArray;
         /** utility: update the output buffer fields **/
         protected void updateOutput(Buffer outputBuffer,
              Format format,int length, int offset) {
              outputBuffer.setFormat(format);
              outputBuffer.setLength(length);
              outputBuffer.setOffset(offset);
    Thank-you.

    Thanks for that last answer. Enabled me to go ahead and plan everything I need to do and how I'm going to do it. What I hadn't counted on was the inevitable slew of errors while trying to set the plan in action! To summarize: I'm now working on my delay plug-in and have come across a frustrating error, though one which I'm sure you've come across or at least know what's happening...
    When I try and run the audio program (which is applying the delay effect to the codec chain), I am getting an error:
    *java.lang.ClassCastException: [S cannot be cast to [B*
            at com.sun.media.renderer.audio.AudioRenderer.doProcessData(AudioRenderer.java:169)
         at com.sun.media.renderer.audio.DirectAudioRenderer.processData(DirectAudioRenderer.java:150)
         at com.sun.media.renderer.audio.AudioRenderer.process(AudioRenderer.java:130)
         at com.sun.media.BasicRendererModule.processBuffer(BasicRendererModule.java:727)
         at com.sun.media.BasicRendererModule.scheduleBuffer(BasicRendererModule.java:499)
         at com.sun.media.BasicRendererModule.doProcess(BasicRendererModule.java:400)
         at com.sun.media.RenderThread.process(BasicRendererModule.java:1114)
         at com.sun.media.util.LoopThread.run(LoopThread.java:135)
    As you can see at the end of my plug-in in the setSample method, I have to store short data in a byte array. I am going about this in the correct way...according to Google. Yet, when I run the program the test Sys.out's I've put in the last two methods print to the console for a significant time before the error is received, which suggests that it has nothing to do with the way I'm converting the short data to byte[] data...right?
    import javax.media.Buffer;
    import javax.media.Control;
    import javax.media.Effect;
    import javax.media.Format;
    import javax.media.ResourceUnavailableException;
    import javax.media.format.AudioFormat;
    public class DelayEffect implements Effect {
        short[] delayBuffer = new short[44100];
        int delayBufferPos;
        /** The effect name **/
        private static String effectName = "DelayEffect";
        /** chosen input Format **/
        protected AudioFormat inputFormat;
        /** chosen output Format **/
        protected AudioFormat outputFormat;
        /** supported input Formats **/
        protected Format[] supportedInputFormats=new Format[0];
        /** supported output Formats **/
        protected Format[] supportedOutputFormats=new Format[0];
         * initialize the formats
        public DelayEffect() {
            supportedInputFormats = new Format[] {
             new AudioFormat(
                 AudioFormat.LINEAR,
                    Format.NOT_SPECIFIED,
                    16,
                    Format.NOT_SPECIFIED,
                    AudioFormat.BIG_ENDIAN,
                    AudioFormat.SIGNED,
                    16,
                    Format.NOT_SPECIFIED,
                    Format.byteArray
            supportedOutputFormats = new Format[] {
             new AudioFormat(
                 AudioFormat.LINEAR,
                    Format.NOT_SPECIFIED,
                    16,
                    Format.NOT_SPECIFIED,
                    AudioFormat.BIG_ENDIAN,
                    AudioFormat.SIGNED,
                    16,
                    Format.NOT_SPECIFIED,
                    Format.byteArray
         * get the resources needed by this effect
        public void open() throws ResourceUnavailableException {
         * free the resources allocated by this codec
        public void close() {
         * reset the codec
        public void reset() {
         * no controls for this simple effect
        public Object[] getControls() {
            return (Object[]) new Control[0];
         * Return the control based on a control type for the effect.
         *@param controlType The type of control.
        public Object getControl(String controlType) {
            try {
                Class cls = Class.forName(controlType);
                Object cs[] = getControls();
                for (int i = 0; i < cs.length; i++) {
                    if (cls.isInstance(cs))
    return cs[i];
    return null;
    } catch (ClassNotFoundException e) { // no such controlType or such control
    return null;
    /************** format methods *************/
    * Set the input format
    * @param input The input format.
    public Format setInputFormat(Format input) {
    // the following code assumes valid Format
    inputFormat = (AudioFormat)input;
    return (Format)inputFormat;
    * Set the output format
    * @param output The output format
    public Format setOutputFormat(Format output) {
    // the following code assumes valid Format
    outputFormat = (AudioFormat)output;
    return (Format)outputFormat;
    * Get the input format
    * @return Returns the input format.
    protected Format getInputFormat() {
    return inputFormat;
    * Get the output format
    * @return Returns the output format.
    protected Format getOutputFormat() {
    return outputFormat;
    * Supported input formats
    * @return Returns the supported input formats.
    public Format [] getSupportedInputFormats() {
    return supportedInputFormats;
    * Output Formats for the selected input format
    * @param in The requested input format.
    * @return Returns the supported output formats.
    public Format [] getSupportedOutputFormats(Format in) {
    if (! (in instanceof AudioFormat) )
    return new Format[0];
    AudioFormat iaf=(AudioFormat) in;
    if (!iaf.matches(supportedInputFormats[0]))
    return new Format[0];
         AudioFormat oaf= new AudioFormat(
         AudioFormat.LINEAR,
    iaf.getSampleRate(),
    16,
    iaf.getChannels(),
    AudioFormat.BIG_ENDIAN,
    AudioFormat.SIGNED,
    16,
    Format.NOT_SPECIFIED,
    Format.byteArray
    return new Format[] {oaf};
    * return effect name
    public String getName() {
    return effectName;
    public void clearDelayBuffer(){
         for (int i = 0; i < delayBuffer.length; i++){
              delayBuffer[i] = 0;
         delayBufferPos = 0;
    * Do the processing
    * @param inputBuffer The incoming buffer.
    * @param outputBuffer The processed buffer.
    * @return A status code..
    public int process(Buffer inputBuffer, Buffer outputBuffer){
    // == prolog
    byte[] inData = (byte[])inputBuffer.getData();
    int inLength = inputBuffer.getLength();
    int inOffset = inputBuffer.getOffset();
    byte[] outData = validateByteArraySize(outputBuffer, inLength);
    int outOffset = outputBuffer.getOffset();
    int j = outOffset;
    int outLength = inLength;
    double decay = 0.5;
    int samplesNumber = inLength ; //44100 samples
    *// == main*
         short sample;
    for (int i= inOffset; i< inOffset + inLength;i+=2) {
         //update sample
         short oldSample = getSamples(inputBuffer, i);
         short newSample = (short)(oldSample + decay * delayBuffer[delayBufferPos]);
         setSample(inputBuffer, i, newSample);
         //update delay buffer
         delayBuffer[delayBufferPos] = newSample;
         outputBuffer.setData(delayBuffer);
         delayBufferPos++;
         if(delayBufferPos == delayBuffer.length){
              delayBufferPos = 0;
    // == epilog
    updateOutput(outputBuffer,outputFormat, outLength, outOffset);
    return BUFFER_PROCESSED_OK;
    protected byte[] validateByteArraySize(Buffer buffer,int newSize) {
    Object objectArray=buffer.getData();
    byte[] typedArray;
    if (objectArray instanceof byte[]) { // is correct type AND not null
    typedArray=(byte[])objectArray;
    if (typedArray.length >= newSize ) { // is sufficient capacity
    return typedArray;
    typedArray = new byte[newSize];
    buffer.setData(typedArray);
    return typedArray;
    protected void updateOutput(Buffer outputBuffer,
    Format format,int length, int offset) {
    outputBuffer.setFormat(format);
    outputBuffer.setLength(length);
    outputBuffer.setOffset(offset);
    public static short getSamples(Buffer inBuffer, int pos){
         byte[] buffer = (byte[]) inBuffer.getData();
         System.out.println("test");
         return (short) (((buffer[pos + 1]) << 8) | (buffer[pos]));
    public static void setSample(Buffer inBuffer, int pos, short sample){
         System.out.println("test2");
         byte[] buffer = (byte[]) inBuffer.getData();
         buffer[pos] = (byte) (sample & 0x00FF);
         buffer[pos + 1] = (byte)((sample>>8));

  • Sample Delay bug

    Does has anyone else noticed that Sample Delay doesn't remember its setting when a project is closed ? Or is this just a problem with my system ?
    1) Insert a Sample Delay plug-in on any track and set the delay value to anything other than zero
    2) Save your project, close it, re-open it
    3) Check the delay value--it's reset to zero
    Happens every time I close the project. Bummer.
    James
    [email protected]

    To get rid of the playing through the channel strip thing, control-click (or right click) - it may be a long click, I don't remember - on the speaker/play icon in the sample editor and you have the option to listen through the pre-listen channel.

Maybe you are looking for

  • Error While Consuming Public Web Service through Stand Alone Proxy

    Hi, I am getting the below error when I am consuming a public web service through Stand Alone Proxy. java.rmi.RemoteException: Service call exception; nested exception is:      com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCode

  • Block / Filter html in email, specifically URLs

    Exchange 2010 in a Windows 2008 R2 domain. I'm trying to find a way to block any html url from being link enabled in email. For instance, if I type www.bing.com in an email it link enables it by default and makes it clickable by the recipient. I need

  • How to show timestamp along with date in LOV dropdown

    Hi, We have a requirement to show timestamp along with date as a display column in a LOV drop down. Type of the date column in VVO is set to timestamp. But still it is showing only date in the UI. But it is showing timestamp when we run it through AM

  • Alias pointing to hard drive

    Sorry about the repeat but I first posted in the wrong forum (10.7 instead of 10.8) Hi, strange thing has happened... I dowloaded an application, dragged it over the Application folder (or so I think that's what I did...) and now the icon for the app

  • RMAN restore after using catalog command

    Hi: I am on 10.2.0.3; hp-ux B.11.23 ia64. I need to restore 2 weeks-old RMAN backup into a different database. RMAN runs at 11:00 pm each night. Here are the steps I've taken: 1. Copied all backuppieces from tape into RMAN backup location where my RM