Guitar Chord Music Generation Based on Melody Constraints and Transformer Generation Network
Abstract
With the in-depth application of artificial intelligence in music creation, the automatic generation of guitar chords based on deep learning still has shortcomings in melody-harmony consistency, long-term modeling, and playability. To address the aforementioned challenges, this study proposes a Melody-Constrained Bidirectional Dual-Layer Transformer for Guitar Chord Generation (MC-BidTransformer), an innovative approach that integrates melody constraints with Transformer architecture. The method incorporates melody constraints, fragment recursive training, and attention weight allocation strategies within a multi-source temporal generation adversarial network. By leveraging BidTransformers for global chord sequence modeling, it significantly enhances the coherence, structural hierarchy, and performance adaptability of generated chord sequences. Experiments show that the melodyharmony consistency of the proposed method on both types of guitar chord data sets remains above 80%, which is about 15%-25% higher than the comparative model. The chord mutation rate is controlled below 10% under long sequence generation conditions. In a variety of guitar playing scenarios, the playability rate of the chords generated by the model reaches up to 91.2%, and the main and chorus style retention is still maintained at 80% under 25% noise interference. The relevant statistical test results all meet p<0.05. The comprehensive conclusion shows that this method has advantages in generation stability and adaptability to actual performance and can provide effective technical support for an intelligent guitar accompaniment generation and computer-aided music creation.