cuthbertLab / music21

music21 is a Toolkit for Computational Musicology
https://www.music21.org/
Other
2.13k stars 402 forks source link

can't add voices to the part ?? #1729

Closed Junny13 closed 2 months ago

Junny13 commented 2 months ago

using this code i get an empty music21 fragment when i print the score. Am I doing something wrong or is it a bug?

This is the code I used:

s = stream.Score() part= stream.Part() part.append(clef.TrebleClef()) time_signature = meter.TimeSignature("4/4") part.append(time_signature)

voice1= stream.Voice() voice2= stream.Voice()

notes= ["C4","D4",'E4','F4','G4','A4','B4','C5'] for notenames in notes: melody_note= note.Note(notenames) voice1.append(melody_note)

harmony=melody_note.transpose(+12)
voice2.append(harmony)

part.append([voice1,voice2]) s.insert(0,part)

The result of this code prints a music21 fragment with 4 empty meters.

mscuthbert commented 2 months ago

Please post to music21list for more help. This is for bugs obky. Please read the tutorials for proper stream formatting.

Junny13 commented 2 months ago

So is the code correct or not? Cause if the code is correct then there is an actual bug

Στις Δευ, 9 Σεπ 2024, 02:03 ο χρήστης Michael Scott Asato Cuthbert < @.***> έγραψε:

Closed #1729 https://github.com/cuthbertLab/music21/issues/1729 as completed.

— Reply to this email directly, view it on GitHub https://github.com/cuthbertLab/music21/issues/1729#event-14175267847, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWY26Q4EPXMJGETPJT2ST5LZVTJSNAVCNFSM6AAAAABN3KXGL2VHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJUGE3TKMRWG44DINY . You are receiving this because you authored the thread.Message ID: @.***>