gogins / csound-ac

A C++ library for algorithmic composition, designed to be used with Csound, with both C++ and Python interfaces.
GNU Lesser General Public License v2.1
6 stars 0 forks source link

Add nonchord tones to Chord and/or ChordSpaceGroup #30

Closed gogins closed 1 week ago

gogins commented 2 months ago

The idea is to generate melodies and counterpoints that fit into generated chord progressions. Possible implementations:

gogins commented 2 weeks ago

The basic idea is for a note to be conformable to a Chord that is a degree of a Scale, with an optional number of voices. if the Chord has more voices than the preceding Chord, the note could be conformed to a pitch that does belong to the current Chord with the preceding number of voices. With the right number of voices, the Chord simply becomes a mode of the Scale. An additional parameter supports altered tones.

        /**
         * Moves the pitch (MIDI key number in 12TET) of the event to the 
         * nearest pitch-class of the chord implied by the scale degree, 
         * number of voices, and interval in semitones between chord tones 
         * (defaulting to 3). If the alteration parameter is used, the pitch of 
         * the event is first moved to the nearest pitch-class of the chord 
         * implied by the scale degree, number of voices, and interval; this tone 
         * is then altered (plus or minus) by the number of semitones specified 
         * by the alteration parameter (default 0). All operations are performed under 
         * octave equivalence.
         */
       virtual void Scale::conform_with_alteration(Event &event, int scale_degree, int voices, int interval, int alteration) const;
       virtual void Scale::conform_with_interval(Event &event, int scale_degree, int voices, int interval) const;
       virtual void Scale::conform(Event &event, int scale_degree, int voices) const;

This kind of conformance is not relevant to the PITV group, because that is defined only for a fixed number of voices, and does not involve a concept of scale.

gogins commented 2 weeks ago

Now a problem with multiple overloads in embind. May be caused by operator <. Not sure why this has become a problem now.

gogins commented 1 week ago

It builds now. Closing until I run into problems in use.