FoscChord

Returns a FoscChord.


Description

A chord.


Attributes Summary

Instance Properties

isPitched
noteHeads Gets note-heads in chord.
noteHeads_ Sets note-heads in chord.
writtenDuration Gets written duration of chord.
writtenDuration_ Sets written duration of chord.
writtenPitches Gets written pitches in chord.
writtenPitches_ Sets written pitches in chord.

Instance Methods: Special Methods

asCompileString
storeArgs Gets new arguments.


Usage

  1. Example

    a = FoscChord("C4 E4 G4", 1/4);
    a.show;

  2. Tweak individual noteheads 1

    a = FoscChord(#[65, 70], 1/4);
    a.noteHeads[1].isCautionary_(true);
    a.show;

  3. Tweak individual noteheads 2

    a = FoscChord(#[65, 70], 1/4);
    tweak(a.noteHeads[1]).style = 'harmonic';
    a.show;

  4. Initialize from a FoscNote.

    a = FoscNote(60, 1/4);
    a.attach(FoscArticulation('>'));
    b = FoscChord(a);
    b.show;

  5. Initialize from a FoscChord.

    a = FoscChord(#[60,64,67], 1/4);
    a.attach(FoscArticulation('>'));
    b = FoscChord(a);
    b.show;


Instance Properties


isPitched


noteHeads

Gets note-heads in chord.

Returns note-head list.

  1. Example

    a = FoscChord("C4 E4 G4", 1/4);
    a.noteHeads.items.collect { |each| each.writtenPitch.ps }
    [ "\"C4\"", "\"E4\"", "\"G4\"" ]


noteHeads_

Sets note-heads in chord.

  1. Example

    a = FoscChord("C4 E4 G4", [1, 4]);
    a.noteHeads.items.collect { |each| each.writtenPitch.ps };
    [ "\"C4\"", "\"E4\"", "\"G4\"" ]
    a.noteHeads_("F#4 B4 D#5 E5");
    a.noteHeads.items.collect { |each| each.writtenPitch.ps };
    [ "\"F#4\"", "\"B4\"", "\"D#5\"", "\"E5\"" ]


writtenDuration

Gets written duration of chord.

Set duration.

Returns duration.

  1. Example

    a = FoscChord("C4 E4 G4", 1/4);
    a.writtenDuration.str;
    1/4


writtenDuration_

Sets written duration of chord.

  1. Example

    a = FoscChord("C4 E4 G4", 1/4);
    a.writtenDuration.str;
    1/4
    a.writtenDuration_(1/16);
    a.writtenDuration.str;
    1/16


writtenPitches

Gets written pitches in chord.

Returns a FoscPitchSegment.


writtenPitches_

Sets written pitches in chord.

  1. Example

    a = FoscChord("C4 E4 G4", [1, 4]);
    a.writtenPitches.ps;
    "C4 E4 G4"
    a.writtenPitches_("F#4 B4 D#5 E5");
    a.writtenPitches.ps;
    "F#4 B4 D#5 E5"


Instance Methods: Special Methods


asCompileString

  1. Example

    a = FoscChord(#[60, 64, 67], 1/4);
    a.cs;
    FoscChord("C4 E4 G4", 1/4)


storeArgs

Gets new arguments.

Returns array.

  1. Example

    a = FoscChord(#[60, 64, 67], 1/4);
    a.storeArgs;
    [ FoscPitchSegment([ FoscPitch("C4"), FoscPitch("E4"), FoscPitch("G4") ]), FoscDuration(1, 4) ]