Search in sources :

Example 1 with Note

use of blue.soundObject.Note in project blue by kunstmusik.

the class PchAddProcessor method processNotes.

@Override
public final void processNotes(NoteList in) throws NoteProcessorException {
    Note temp;
    String val;
    for (int i = 0; i < in.size(); i++) {
        temp = in.get(i);
        try {
            val = temp.getPField(pfield).trim();
            Double.parseDouble(val);
        } catch (NumberFormatException ex) {
            throw new NoteProcessorException(this, BlueSystem.getString("noteProcessorException.pfieldNotDouble"), pfield);
        } catch (Exception ex) {
            throw new NoteProcessorException(this, BlueSystem.getString("noteProcessorException.missingPfield"), pfield);
        }
        double baseTen = blue.utility.ScoreUtilities.getBaseTen(val);
        baseTen += value;
        int octave = (int) (baseTen / 12);
        double strPch = (baseTen % 12) / 100;
        temp.setPField(Double.toString(octave + strPch), pfield);
    }
}
Also used : Note(blue.soundObject.Note) NoteParseException(blue.soundObject.NoteParseException)

Example 2 with Note

use of blue.soundObject.Note in project blue by kunstmusik.

the class RandomMultiplyProcessor method processNotes.

@Override
public final void processNotes(NoteList in) throws NoteProcessorException {
    Note temp;
    double range = max - min;
    double fieldVal = 0f;
    Random r = seedUsed ? new Random(seed) : new Random();
    for (int i = 0; i < in.size(); i++) {
        temp = in.get(i);
        try {
            fieldVal = Double.parseDouble(temp.getPField(pfield));
        } catch (NumberFormatException ex) {
            throw new NoteProcessorException(this, BlueSystem.getString("noteProcessorException.pfieldNotDouble"), pfield);
        } catch (Exception ex) {
            throw new NoteProcessorException(this, BlueSystem.getString("noteProcessorException.missingPfield"), pfield);
        }
        double randVal = (double) ((r.nextDouble() * range) + min);
        temp.setPField(Double.toString(fieldVal * randVal), pfield);
    }
}
Also used : Random(java.util.Random) Note(blue.soundObject.Note) NoteParseException(blue.soundObject.NoteParseException)

Example 3 with Note

use of blue.soundObject.Note in project blue by kunstmusik.

the class AddProcessor method processNotes.

@Override
public final void processNotes(NoteList in) throws NoteProcessorException {
    Note temp;
    double fieldVal = 0.0;
    for (int i = 0; i < in.size(); i++) {
        temp = in.get(i);
        try {
            fieldVal = Double.parseDouble(temp.getPField(pfield));
        } catch (NumberFormatException ex) {
            throw new NoteProcessorException(this, BlueSystem.getString("noteProcessorException.pfieldNotDouble"), pfield);
        } catch (Exception ex) {
            throw new NoteProcessorException(this, BlueSystem.getString("noteProcessorException.missingPfield"), pfield);
        }
        temp.setPField(Double.toString(fieldVal + value), pfield);
    }
}
Also used : Note(blue.soundObject.Note) NoteParseException(blue.soundObject.NoteParseException)

Example 4 with Note

use of blue.soundObject.Note in project blue by kunstmusik.

the class InversionProcessor method processNotes.

@Override
public final void processNotes(NoteList in) throws NoteProcessorException {
    Note temp;
    for (int i = 0; i < in.size(); i++) {
        temp = in.get(i);
        try {
            double fieldVal = Double.parseDouble(temp.getPField(pfield));
            double addVal = -1 * (fieldVal - this.value);
            temp.setPField(Double.toString(this.value + addVal), pfield);
        } catch (NumberFormatException ex) {
            throw new NoteProcessorException(this, BlueSystem.getString("noteProcessorException.pfieldNotDouble"), pfield);
        } catch (Exception ex) {
            throw new NoteProcessorException(this, BlueSystem.getString("noteProcessorException.missingPfield"), pfield);
        }
    }
}
Also used : Note(blue.soundObject.Note) NoteParseException(blue.soundObject.NoteParseException)

Example 5 with Note

use of blue.soundObject.Note in project blue by kunstmusik.

the class PchInversionProcessor method processNotes.

@Override
public final void processNotes(NoteList in) throws NoteProcessorException {
    Note temp;
    String val;
    for (int i = 0; i < in.size(); i++) {
        temp = in.get(i);
        try {
            val = temp.getPField(pfield).trim();
            Double.parseDouble(val);
        } catch (NumberFormatException ex) {
            throw new NoteProcessorException(this, BlueSystem.getString("noteProcessorException.pfieldNotDouble"), pfield);
        } catch (Exception ex) {
            throw new NoteProcessorException(this, BlueSystem.getString("noteProcessorException.missingPfield"), pfield);
        }
        double baseTen = blue.utility.ScoreUtilities.getBaseTen(val);
        double baseTenAxis = blue.utility.ScoreUtilities.getBaseTen(this.getVal());
        double addVal = -1 * (baseTen - baseTenAxis);
        baseTen = baseTenAxis + addVal;
        int octave = (int) (baseTen / 12);
        double strPch = (baseTen % 12) / 100;
        temp.setPField(Double.toString(octave + strPch), pfield);
    }
}
Also used : Note(blue.soundObject.Note) NoteParseException(blue.soundObject.NoteParseException)

Aggregations

Note (blue.soundObject.Note)30 NoteParseException (blue.soundObject.NoteParseException)14 NoteList (blue.soundObject.NoteList)11 Iterator (java.util.Iterator)2 Random (java.util.Random)2 Arrangement (blue.Arrangement)1 CompileData (blue.CompileData)1 GlobalOrcSco (blue.GlobalOrcSco)1 Tables (blue.Tables)1 ParameterNameManager (blue.automation.ParameterNameManager)1 LinePoint (blue.components.lines.LinePoint)1 Mixer (blue.mixer.Mixer)1 TempoMapper (blue.noteProcessor.TempoMapper)1 GenericInstrument (blue.orchestra.GenericInstrument)1 Instrument (blue.orchestra.Instrument)1 StringChannel (blue.orchestra.blueSynthBuilder.StringChannel)1 StringChannelNameManager (blue.orchestra.blueSynthBuilder.StringChannelNameManager)1 ScoreGenerationException (blue.score.ScoreGenerationException)1 ScoreObject (blue.score.ScoreObject)1 Tempo (blue.score.tempo.Tempo)1