Search in sources :

Example 21 with NoteList

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

the class pa method getValue.

@Override
public double[] getValue(CybilNoteList cybilNoteList) {
    NoteList nl = cybilNoteList.notes;
    int index = Integer.parseInt((String) args.get(0));
    double[] val = new double[1];
    int currentNoteIndex = cybilNoteList.index;
    Note note = cybilNoteList.notes.get(currentNoteIndex);
    val[0] = Double.parseDouble(note.getPField(index));
    return val;
}
Also used : NoteList(blue.soundObject.NoteList) Note(blue.soundObject.Note)

Example 22 with NoteList

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

the class PatternLayer method generateForCSD.

NoteList generateForCSD(CompileData compileData, double startTime, double endTime, int patternBeatsLength) throws SoundObjectException {
    NoteList notes = new NoteList();
    this.soundObject.setStartTime(0);
    // this.soundObject.setSubjectiveDuration(patternBeatsLength);
    // this.soundObject.setTimeBehavior(SoundObject.TIME_BEHAVIOR_NONE);
    NoteList tempNotes = this.soundObject.generateForCSD(compileData, -1, -1);
    int currentIndex = (int) (startTime / patternBeatsLength);
    while (currentIndex < this.patternData.getSize()) {
        if (this.patternData.isPatternSet(currentIndex)) {
            double time = currentIndex * patternBeatsLength;
            final NoteList copy = new NoteList(tempNotes);
            ScoreUtilities.setScoreStart(copy, time);
            notes.addAll(copy);
        }
        currentIndex++;
    }
    return notes;
}
Also used : NoteList(blue.soundObject.NoteList)

Example 23 with NoteList

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

the class PatternLayerTest method testGenerateForCSD.

/**
 * Test of generateForCSD method, of class PatternLayer.
 */
@Test
public void testGenerateForCSD() throws SoundObjectException {
    CompileData compileData = null;
    float startTime = 0.0F;
    float endTime = 0.0F;
    int patternBeatsLength = 4;
    PatternLayer instance = new PatternLayer();
    GenericScore score = new GenericScore();
    score.setTimeBehavior(SoundObject.TIME_BEHAVIOR_NONE);
    score.setText("i1 0 .25 1 2\ni1 1 .25 1 2");
    instance.setSoundObject(score);
    instance.getPatternData().setPattern(0, true);
    instance.getPatternData().setPattern(1, true);
    instance.getPatternData().setPattern(2, true);
    NoteList result = instance.generateForCSD(compileData, startTime, endTime, patternBeatsLength);
    System.out.println(result.toString());
    assertEquals(6, result.size());
    assertEquals("1.0", result.get(1).getPField(2));
    assertEquals("8.0", result.get(4).getPField(2));
    result = instance.generateForCSD(compileData, 4.0f, endTime, patternBeatsLength);
    assertEquals(4, result.size());
}
Also used : NoteList(blue.soundObject.NoteList) GenericScore(blue.soundObject.GenericScore) CompileData(blue.CompileData)

Example 24 with NoteList

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

the class PatternsLayerGroupTest method testGenerateForCSD.

/**
 * Test of generateForCSD method, of class PatternsLayerGroup.
 */
@Test
public void testGenerateForCSD() throws ScoreGenerationException {
    CompileData compileData = null;
    float startTime = 4.0F;
    float endTime = 0.0F;
    PatternsLayerGroup instance = new PatternsLayerGroup();
    int patternBeatsLength = 4;
    instance.newLayerAt(-1);
    PatternLayer patternLayer = instance.get(0);
    GenericScore score = new GenericScore();
    score.setTimeBehavior(SoundObject.TIME_BEHAVIOR_NONE);
    score.setText("i1 0 .25 1 2\ni1 1 .25 1 2");
    patternLayer.setSoundObject(score);
    patternLayer.getPatternData().setPattern(0, true);
    patternLayer.getPatternData().setPattern(1, true);
    patternLayer.getPatternData().setPattern(2, true);
    NoteList result = instance.generateForCSD(compileData, startTime, endTime, false);
    assertEquals(4, result.size());
    assertEquals("1.0", result.get(1).getPField(2));
    assertEquals("5.0", result.get(3).getPField(2));
}
Also used : NoteList(blue.soundObject.NoteList) GenericScore(blue.soundObject.GenericScore) CompileData(blue.CompileData)

Example 25 with NoteList

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

the class CSDRender method getGlobalDuration.

/**
 * @param globalSco
 * @return
 * @throws SoundObjectException
 */
private double getGlobalDuration(String globalSco) throws SoundObjectException {
    NoteList globalNotes;
    try {
        globalNotes = ScoreUtilities.getNotes(globalSco);
    } catch (NoteParseException e) {
        GenericScore gs = new GenericScore();
        gs.setName("Global Orchestra Text");
        throw new SoundObjectException(gs, e);
    }
    double globalDur = ScoreUtilities.getTotalDuration(globalNotes);
    return globalDur;
}
Also used : NoteList(blue.soundObject.NoteList) NoteParseException(blue.soundObject.NoteParseException) GenericScore(blue.soundObject.GenericScore) SoundObjectException(blue.soundObject.SoundObjectException)

Aggregations

NoteList (blue.soundObject.NoteList)50 NoteParseException (blue.soundObject.NoteParseException)25 Note (blue.soundObject.Note)11 CompileData (blue.CompileData)6 SoundObject (blue.soundObject.SoundObject)6 GenericScore (blue.soundObject.GenericScore)4 Arrangement (blue.Arrangement)3 GlobalOrcSco (blue.GlobalOrcSco)3 Tables (blue.Tables)3 NoteProcessorException (blue.noteProcessor.NoteProcessorException)3 SoundObjectException (blue.soundObject.SoundObjectException)3 OpcodeList (blue.udo.OpcodeList)3 ParameterNameManager (blue.automation.ParameterNameManager)2 LiveObject (blue.blueLive.LiveObject)2 LiveObjectSet (blue.blueLive.LiveObjectSet)2 LinePoint (blue.components.lines.LinePoint)2 Mixer (blue.mixer.Mixer)2 TempoMapper (blue.noteProcessor.TempoMapper)2 GenericInstrument (blue.orchestra.GenericInstrument)2 Instrument (blue.orchestra.Instrument)2