Java Array Shift shiftChroma(float[] chroma, int step)

Here you can find the source of shiftChroma(float[] chroma, int step)

Description

shift Chroma

License

Open Source License

Declaration

public static float[] shiftChroma(float[] chroma, int step) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static float[] shiftChroma(float[] chroma, int step) {
        float[] result = new float[12];
        if (step < 0) {
            step = 12 - step;/*from   ww  w. j  a  va  2s  .c  o m*/
        }
        for (int i = 0; i < 12; i++) {
            result[i] = chroma[(i + step) % 12];
        }
        return result;
    }
}

Related

  1. shiftArgs(final String[] args)
  2. shiftArgs(String[] args, int offset)
  3. shiftArray(String[] args, int shift)
  4. shiftArray(String[] array, int offset)
  5. ShiftAwayTrailingZerosTwoElements(int[] arr)
  6. shiftEnum(E current, E[] values, int delta)
  7. shiftLeft(byte[] array)
  8. shiftLeft(byte[] b1, int bytes)
  9. shiftLeft(byte[] block, byte[] output)