ideoforms / AbletonOSC

Control Ableton Live 11 via Open Sound Control (OSC)
MIT License
406 stars 68 forks source link

pylive? Live? and port 11000 just disappeared! #125

Open mindexxx opened 5 months ago

mindexxx commented 5 months ago

I'm trying to follow the way you didi in the video "How to Connect ChatGPT to Ableton for Automatic AI Music Making" to generate some AI midi notes, I downloaded the master branch of AbletonOSC and followed the installation steps in the README file, referring to the code in the video to send messages to port 11000. I encountered the following error:

(2024-04-18 19:08:06,082) [ERROR] AbletonOSC: Error handling OSC message: 'NoneType' object has no attribute 'add_new_notes' (2024-04-18 19:08:06,083) [WARNING] AbletonOSC: Traceback (most recent call last):

The error originates from the code in the project file ../abletonosc/clip.py on the line clip.add_newnotes(tuple(notes)). The log output also indicates that the clip object is of NoneType. Additionally, I've installed several versions of pylive (0.4.0, 0.3.0, etc.), and PyCharm is showing an "import Live" error (class not found). After changing Live to lowercase, and adjusting the method corresponding to clip.add**_notes to match the correct syntax without errors, I tried running Live, but then the listener port 11000 would not start. Could you tell me which Python package Live refers to? Is it pylive, live, or another Python library associated with it?

Anyone encountered same issues?

ideoforms commented 5 months ago

Hi there @mindexxx,

First to quickly say that that video was created by a third party, so I can't 100% vouch for its contents, but can help with pylive/AbletonOSC.

The first error most likely happened because you're calling add_new_notes on a clip that doesn't exist. Make sure that, when you specify a track index and clip index in your args, an empty MIDI clip already exists in that slot (remembering that track/clip indices number from 0, so if you have one clip in your set in Track 2 Clip 1, you will need to address it as track 1 clip 0 within your OSC commands.)

Secondly, regarding import Live: you shouldn't be trying to run the AbletonOSC code within PyCharm or any other IDE. The Live module (capital L) is an Ableton Live internal namespace that can only be accessed when AbletonOSC is running within Live itself. You shouldn't need to make any modifications to the module to get it to work.

I recommend always running the very latest version of pylive/AbletonOSC. Hope that helps!

mindexxx commented 5 months ago

hi Daniel,  really appreciate your reply, helped a lot! I have already solved the problem and successfully ran the program, once again, thank you Daniel!

Mindex @.***

 

------------------ 原始邮件 ------------------ 发件人: "ideoforms/AbletonOSC" @.>; 发送时间: 2024年4月18日(星期四) 晚上10:29 @.>; @.**@.>; 主题: Re: [ideoforms/AbletonOSC] pylive? Live? and port 11000 just disappeared! (Issue #125)

Hi there @mindexxx,

First to quickly say that that video was created by a third party, so I can't 100% vouch for its contents, but can help with pylive/AbletonOSC.

The first error most likely happened because you're calling add_new_notes on a clip that doesn't exist. Make sure that, when you specify a track index and clip index in your args, an empty MIDI clip already exists in that slot (remembering that track/clip indices number from 0, so if you have one clip in your set in Track 2 Clip 1, you will need to address it as track 1 clip 0 within your OSC commands.)

Secondly, regarding import Live: you shouldn't be trying to run the AbletonOSC code within PyCharm or any other IDE. The Live module (capital L) is an Ableton Live internal namespace that can only be accessed when AbletonOSC is running within Live itself. You shouldn't need to make any modifications to the module to get it to work.

I recommend always running the very latest version of pylive/AbletonOSC. Hope that helps!

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>