-
-
Notifications
You must be signed in to change notification settings - Fork 130
Basic syntax of pitch_bend type
Rainbow Dreamer edited this page May 15, 2023
·
5 revisions
You can use the pitch_bend type to insert into the pitch_bends
list of a chord type, which can change the pitch of the notes of a segment in real time, and can change the pitch very subtly.
When constructing the pitch_bend type, three different units can be selected using the mode parameter:
- semitone (any integer, decimal or fraction between -2 and 2, not including -2 and 2 itself)
- cent (1 semitone = 100 cents, any integer, decimal or fraction between -200 and 200, not including -200 and 200 itself, cent is the default unit)
- MIDI pitch bend value (any integer between -8192 and 8192, not including -8192 and 8192 itself)
pitch_bend(value, start_time=0, mode='cents', channel=None, track=None)
- value: the amount of pitch change of the note
- start_time: the position of the pitch change of the note in bars
- mode: mode == 'cents' selects cents as unit, default value, mode selects cents as unit if not set; mode == 'semitones' selects semitones as the unit; mode == 'values' selects MIDI pitch bend values as the unit
- channel: MIDI channel number
- track: MIDI track number
Insert the pitch_bend type into the pitch_bends
list of the chord type.
a = chord(['C5', 'D5', 'E5', 'F5', 'G5', 'A5', 'B5', 'C6']) % (1/8,1/8)
a.pitch_bends.append(pitch_bend(value=30, start_time=3/8))
play(a, 80)
# The chord type a will be played at normal pitch from the beginning to E5, and the notes after that will be played 30 cents higher (that's 0.3 semitones)
- Basic syntax of note type
- Basic syntax of chord type
- Basic syntax of scale type
- Basic syntax of piece type
- Basic syntax of track type
- Basic syntax of tempo type
- Basic syntax of pitch_bend type
- Basic syntax of pan type
- Basic syntax of volume type
- Basic syntax of drum type
- Basic syntax of rhythm type
- Musicpy composition code examples Part 1
- Musicpy composition code examples Part 2
- Musicpy composition code examples Part 3
- Introduction of musicpy algorithms module
- The algorithm to split the main melody and chords from a piece of music
- The algorithm to determine the chord type of any group of notes according to the logic of music theory
- The algorithm to analyze the chord progressions of a piece of music
- The algorithm to analyze tonality and modulations in a piece of music