PurposeThe purpose of this paper is to address the lack of a theoretical framework for the integration of technology in music teaching and learning, and explores, within the framework of Technological Pedagogical Content Knowledge (TPCK or TPACK), the importance of affect in instructional design.Design/methodology/approachThe authors reviewed relevant literature related to the fields of music education, instructional design, and technology integration. Accordingly, they developed guidelines for designing technology-enhanced learning for the activities of music composition and listening.FindingsThe authors propose a set of design principles based on the TPCK framework through the subject matter of music focusing on the affective domain, and identify interrelations among musical content, emotions, and technology. The design guidelines were tested in an empirical investigation and the results showed statistically significant differences between the control and the experimental groups in favor of the experimental group.Research limitations/implicationsFurther investigation is necessary to test the effectiveness of the proposed design principles. Including affect in the design process is a complicated and mostly unchartered area, and, thus, further research toward this direction is fully justified.Practical implicationsThe research has practical significance, addressing a gap in the field of music education, as it provides teachers with explicit guidance about how to design music lessons with technology while incorporating affect.Originality/valueThe study extends the theoretical framework of TPCK to a design framework and proposes instructional design guidelines that address both the cognitive and the affective domains of learning, a focus that is currently missing from the existing TPCK or TPACK literature as well as the music education literature.