Package com.music.model

Examples of com.music.model.Scale


        double measureOffset = Chance.test(5) ? 0.15 : 0;

        for (Phrase phrase : mainPart.getPhraseArray()) {
            Phrase accompanimentPhrase = new Phrase();
            accompanimentPhrase.setTitle("Accompaniment phrase");
            Scale currentScale = ((ExtendedPhrase) phrase).getScale();
            // get copies of the static ones, so that we can shuffle them without affecting the original
            List<Chord> scaleChords = new ArrayList<Chord>(ChordUtils.chords.get(currentScale));
            List<Chord> scaleSeventhChords = new ArrayList<Chord>(ChordUtils.seventhChords.get(currentScale));
            List<Chord> scaleOtherChords = new ArrayList<Chord>(ChordUtils.otherChords.get(currentScale));
View Full Code Here


        return meta;
    }

    public TimelineMusic getUserTimelinePiece(List<Tweet> tweets) {
        TimelineMusic meta = new TimelineMusic();
        Scale scale = getScale(tweets, meta);
        meta.setScale(scale);

        Tempo tempo = getTempo(tweets, meta);
        meta.setTempo(tempo);
View Full Code Here

                }
            }

            Phrase arpeggioPhrase = new Phrase();
            arpeggioPhrase.setTitle("Arpeggio phrase");
            Scale currentScale = ((ExtendedPhrase) phrase).getScale();
            // get copies of the static ones, so that we can shuffle them without affecting the original
            List<Chord> scaleChords = new ArrayList<Chord>(ChordUtils.chords.get(currentScale));
            Collections.shuffle(scaleChords, random);
            Note[] notes = phrase.getNoteArray();
            List<ToneType> firstToneTypes = new ArrayList<>();
View Full Code Here

    //private int[] MINOR_SCALE_PERCENTAGES = new int[] {0,45,24,7,14,0,0,0,0,0,0,0,10};

    @Override
    public void handleScore(Score score, ScoreContext ctx) {
        ctx.setScale(getScale());
        Scale alternativescale = getScale();
        while (alternativescale == ctx.getScale()) {
            alternativescale = getScale();
        }
        ctx.setAlternativeScale(alternativescale);
View Full Code Here

        double durationModifier = Chance.test(30) ? SpecialNoteType.STACCATO.getValue() : 0;

        for (Phrase phrase : phrases) {
            ExtendedPhrase extPhrase = ((ExtendedPhrase) phrase);
            Scale currentScale = extPhrase.getScale();
            if (currentScale.getDefinition().length != 7) { //no bass for irregular scales, for now
                continue;
            }
            Phrase bassPhrase = new Phrase();
            for (int i = 0; i < extPhrase.getMeasures(); i++) {
                for (int k = 0; k < 2; k++) {
                    if (Chance.test(70)) {
                        int degreeIdx = 0;
                        if (dullBass) {
                            degreeIdx = Chance.choose(dullBassPercentages);
                        } else {
                            degreeIdx = Chance.choose(degreePercentages);
                        }
                        Note note = NoteFactory.createNote(JMC.C3 + ctx.getKeyNote() + currentScale.getDefinition()[degreeIdx], ctx.getNormalizedMeasureSize() / 2);
                        note.setDynamic(InstrumentGroups.getInstrumentSpecificDynamics(60 + random.nextInt(15), bassPart.getInstrument()));
                        if (durationModifier > 0) {
                            note.setDuration(note.getRhythmValue() * durationModifier);
                        }
                        bassPhrase.addNote(note);
View Full Code Here

TOP

Related Classes of com.music.model.Scale

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.