컴퓨터 음악



코드를 MIDI로

MIDI 음표 조합을 생성하기 위해 코드를 입력하는 소프트웨어에는 여러 가지 유형이 있습니다. 널리 사용되는 일부 도구는 다음과 같습니다.
  • Captain Chords(믹스 인 키): 코드 진행을 생성하고 이를 MIDI 노트로 변환하는 데 도움이 되는 전문 코드 진행 생성기입니다. 일반적으로 Ableton Live, FL Studio 등과 같은 플러그인으로 디지털 오디오 워크스테이션(DAW)에 통합됩니다.
  • Scaler 2: 이는 다양한 변형과 ​​코드 조합을 탐색하는 데 사용할 수 있는 강력한 코드 진행 생성 도구입니다. Scaler 2는 생성된 코드를 MIDI로 변환하는 기능도 지원합니다.
  • Orb Composer: 인공 지능 요소가 포함된 코드 생성 소프트웨어입니다. 사용자 선택에 따라 새로운 코드 진행과 멜로디를 생성하고 이를 MIDI 파일로 내보낼 수 있습니다.
  • RapidComposer: 코드, 멜로디, 반주를 생성하는 데 사용할 수 있는 음악 제작 도구입니다. 직관적인 사용자 인터페이스를 갖추고 있으며 MIDI 내보내기를 지원합니다.
  • Cthulhu(Xfer Records 제작): 다양한 디지털 오디오 워크스테이션에 통합할 수 있는 VST 플러그인으로 설계된 MIDI 코드 생성기입니다. 강력한 코드 진행 생성 및 편집 기능이 있습니다.
  • MIDIculous: 주로 악기 연주를 배우기 위한 소프트웨어이지만 코드 진행을 빠르게 생성하는 데 사용할 수 있는 일부 코드 생성 기능도 있습니다.

    음성을 MIDI로

    Speech-to-MIDI 기술은 음성의 오디오 신호를 MIDI 노트와 데이터로 변환합니다. 이를 통해 멜로디를 노래하거나 흥얼거리고 실시간으로 음표로 변환할 수 있으며, 이를 편집하거나 디지털 방식으로 악기를 연주하는 데 사용할 수 있습니다.
  • MIDI에 음성을 사용하는 이유는 무엇입니까? 창의적인 입력: 아이디어를 표현하는 것이 악기로 연주하는 것보다 빠릅니다. 특히 숙련된 악기 연주자가 아닌 경우에는 더욱 그렇습니다. 즉흥 연주: 노래나 복화술을 통해 아이디어를 빠르게 포착하고 이를 사용 가능한 MIDI 데이터로 변환합니다. 가상 악기 제어: 음성을 사용하여 신디사이저, 드럼 또는 MIDI 데이터를 수신할 수 있는 모든 악기를 제어하세요.
  • 어떻게 작동하나요? 오디오 입력: 시스템에 오디오 신호(음성)를 제공합니다. 음조 감지: 소프트웨어 또는 플러그인이 음성의 음조를 감지합니다. MIDI 변환: 감지된 피치와 리듬을 해당 MIDI 노트로 변환합니다. 출력: MIDI 데이터는 가상 신디사이저 또는 샘플러와 같은 모든 MIDI 호환 악기를 트리거할 수 있습니다.
  • 음성-MIDI용 도구 및 소프트웨어 다음은 이 프로세스에 도움이 될 수 있는 몇 가지 인기 있는 도구입니다. Ableton Live(Max for Live Devices): Ableton은 일부 피치-MIDI 플러그인을 제공합니다. Audio to MIDI와 같은 Max for Live 장치는 보컬이나 오디오를 MIDI로 변환할 수 있습니다. Melodyne: 오디오 파일에서 MIDI 데이터를 내보낼 수도 있는 강력한 피치 교정 도구입니다. Antares Auto-Tune: 이 유명한 피치 교정 도구에는 일부 MIDI 내보내기 기능이 있습니다. WIDI 오디오를 MIDI VST로: 모든 오디오 입력을 즉시 MIDI로 변환합니다. Reaper(플러그인 포함): Reaper DAW를 사용하면 ReaTune과 같은 플러그인을 사용하여 즉각적인 피치 추적 및 변환이 가능합니다.
  • 기본 설정 마이크: 음성을 캡처할 마이크를 설정합니다. 오디오 인터페이스: 인터페이스를 사용하여 오디오 신호를 DAW(Digital Audio Workstation)에 도입합니다. Speech-to-MIDI 소프트웨어: 오디오 입력을 MIDI로 변환할 수 있는 도구를 선택하세요. 들어오는 메시지를 분석하기 위해 플러그인이나 소프트웨어를 구성합니다. 가상 악기: MIDI 출력을 라우팅하여 가상 악기를 제어합니다.
  • DAW에서 MIDI에 음성을 사용하는 단계 목소리를 녹음하거나 입력하세요. 마이크에 대고 노래하거나 흥얼거리세요. 오디오 분석: 음성-MIDI 플러그인 또는 소프트웨어를 사용하여 오디오를 분석합니다. 그러면 MIDI 신호로 변환됩니다. MIDI 데이터 편집: 변환 후 DAW의 다른 MIDI처럼 MIDI 데이터를 편집할 수 있습니다. 타이밍을 수정하거나, 음표를 변경하거나, 변조를 추가할 수 있습니다. 악기 트리거: MIDI를 사용하여 DAW에서 가상 악기를 연주합니다.
  • 도전 정확성: 음성을 MIDI로 변환하는 것이 항상 100% 정확하지는 않습니다. 특히 복잡한 사운드 입력의 경우 피치나 리듬에 대한 오해가 발생할 수 있습니다. 지연: 설정에 따라 노래를 부를 때와 MIDI 음표가 생성될 때 사이에 약간의 지연(지연)이 있을 수 있습니다. 피치 범위: 일부 소프트웨어는 매우 높거나 낮은 톤을 감지하는 데 어려움을 겪을 수 있습니다. 더 나은 결과를 위한 팁 노래를 부르거나 흥얼거릴 때 명확하고 독특한 음조를 사용하세요. 단일 음 멜로디를 변환하는 경우 음표 간의 혼동을 피하기 위해 모노 모드에서 작업하십시오. 비트박서 또는 타악기 연주자는 보컬을 특정 드럼 사운드에 매핑하는 MIDI 전환을 설정하여 자신의 목소리를 사용하여 드럼 사운드를 트리거할 수 있습니다. 리장 - 2024/10/14

    voice-to-MIDI converter using Python

    1. **Capture Audio Input**: We'll use a microphone to record the voice input.
    2. **Analyze Audio**: The audio needs to be analyzed for its frequency (pitch detection).
    3. **Convert Frequency to MIDI Notes**: The detected frequency can be mapped to MIDI notes.
    4. **Create MIDI File**: After converting the frequencies to MIDI notes, we can save them in a `.mid` file.
    
    We'll need some Python libraries to accomplish this:
    
    - `sounddevice`: For recording the audio.
    - `numpy` and `scipy`: For working with and analyzing audio signals.
    - `mido`: To create MIDI files.
    - `aubio`: For pitch detection (aubio specializes in audio-to-note detection).
    
    ### Step-by-Step Process
    
    #### Step 1: Install the Required Libraries
    First, we need to install the necessary Python libraries:
    
    ```bash
    pip install sounddevice numpy scipy mido python-rtmidi aubio
    ```
    
    #### Step 2: Capture Audio Input
    
    Here’s how you can capture audio input using `sounddevice`:
    
    ```python
    import sounddevice as sd
    import numpy as np
    
    def record_audio(duration, sample_rate=44100):
        print("Recording...")
        audio = sd.rec(int(duration * sample_rate), samplerate=sample_rate, channels=1, dtype='float32')
        sd.wait()  # Wait until recording is finished
        print("Recording finished.")
        return audio.flatten()
    ```
    
    This function records audio from the microphone for a specified duration.
    
    #### Step 3: Analyze Audio for Pitch (Using `aubio`)
    
    Now, let's detect the pitch of the recorded audio using the `aubio` library:
    
    ```python
    import aubio
    
    def detect_pitch(audio, sample_rate=44100):
        pitch_detector = aubio.pitch("default", 2048, 512, sample_rate)
        pitch_detector.set_unit("Hz")
        pitch_detector.set_silence(-40)  # Adjust silence threshold if needed
        
        pitches = []
        for i in range(0, len(audio), 512):
            sample = audio[i:i + 512]
            pitch = pitch_detector(sample)[0]
            if pitch > 0:  # Only consider non-zero pitch values
                pitches.append(pitch)
        return pitches
    ```
    
    This function processes the audio and detects the pitch at regular intervals.
    
    #### Step 4: Convert Pitch to MIDI Notes
    
    MIDI notes correspond to specific frequencies. We can map detected frequencies to their nearest MIDI note numbers:
    
    ```python
    def frequency_to_midi(frequency):
        if frequency <= 0:
            return None
        midi_note = 69 + 12 * np.log2(frequency / 440.0)  # A4 = 440Hz corresponds to MIDI note 69
        return round(midi_note)
    ```
    
    #### Step 5: Create a MIDI File
    
    We can now convert the detected MIDI notes into a MIDI file using the `mido` library:
    
    ```python
    from mido import MidiFile, MidiTrack, Message
    
    def create_midi_from_pitches(pitches):
        midi_file = MidiFile()
        track = MidiTrack()
        midi_file.tracks.append(track)
        
        # Add some basic track information
        track.append(Message('program_change', program=12, time=0))
        
        # Convert each pitch to a MIDI note and add to the track
        for pitch in pitches:
            midi_note = frequency_to_midi(pitch)
            if midi_note is not None:
                track.append(Message('note_on', note=midi_note, velocity=64, time=100))
                track.append(Message('note_off', note=midi_note, velocity=64, time=200))
        
        return midi_file
    ```
    
    This function takes the detected pitches, converts them to MIDI notes, and creates a MIDI file. The `note_on` and `note_off` events are added to simulate playing and releasing the note.
    
    #### Step 6: Putting It All Together
    
    Now, we can record audio, detect the pitch, convert it to MIDI notes, and save it as a `.mid` file:
    
    ```python
    def voice_to_midi(duration):
        # Step 1: Record audio
        audio = record_audio(duration)
        
        # Step 2: Detect pitch from the recorded audio
        pitches = detect_pitch(audio)
        
        # Step 3: Create a MIDI file from the detected pitches
        midi_file = create_midi_from_pitches(pitches)
        
        # Step 4: Save the MIDI file
        midi_file.save('output.mid')
        print("MIDI file saved as 'output.mid'")
    
    # Record and convert voice to MIDI for 5 seconds
    voice_to_midi(5)
    ```
    
    ### Explanation:
    - **Step 1**: Records audio from your microphone for the given duration.
    - **Step 2**: The recorded audio is split into frames, and each frame is analyzed for its pitch.
    - **Step 3**: The detected pitch is converted to a MIDI note.
    - **Step 4**: A MIDI file is created with `note_on` and `note_off` events for each detected note.
    
    ### Notes:
    - The code is designed for monophonic melodies (i.e., one note at a time). For polyphonic melodies (multiple notes at once), more advanced techniques are required.
    - **Noise sensitivity**: Ensure that the environment is relatively quiet, as background noise can interfere with pitch detection.
    
    This script should give you a basic starting point for voice-to-MIDI conversion in Python.
    

    離蒄-柔音美景@Youtube
    . email: [email protected]
    
    T:0000
    資訊與搜尋 | 回music首頁
    email: Yan Sa [email protected] Line: 阿央
    電話: 02-27566655 ,03-5924828