Error Implementing Scamp 1st Time

Description:

Hello, I am excited to find a way to bridge Python and Ableton but am struggling to get my script to work. If anyone could help me figure out how to get it up and running, that would be great. I’m on a Macbook Pro and tried to import rtmidi and pynput using terminal which appeared successful. However, the error is still happening. Thank you to whoever helps!

Error printout:

WARNING:root:python-rtmidi was not found; streaming midi input / output will not be available.
WARNING:root:pynput was not found; mouse and keyboard input will not be available.```

# The full code that resulted in the error:
```python3
from scamp import *

s = Session(tempo=100)

drums = s.new_midi_part("drums", "IAC Bus 1", start_channel=1, num_channels=1)
theramin = s.new_midi_part("theramin", "IAC Bus 1", start_channel=2, num_channels=1)
bass = s.new_midi_part("bass", "IAC Bus 1", start_channel=3, num_channels=1)

while True:
    drums.play_note(38,1,1)
    theramin.play_note(80,1,1)
    bass.play_note(38,1,1)```

When you say you tried importing it on a terminal, how are you trying to run it normally?

Usually the issue is that you have multiple different python installations. So if you’re pip installing from a terminal, but say, running it in Thonny, those are different python installations.

1 Like

I tried to run the code in Thonny, but I used pip3 & Terminal to install a stem splitter into my Ableton a while back so I assumed that there was something out of place on my computer that was causing the code to not work.

But in your video you said Thonny is somewhat closed-off from the rest of my computer so I’m not sure what to do now. Any suggestions?

I’m now getting another message in front of the two I posted, altogether reading:

/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 2 leaked semaphore objects to clean up at shutdown
warnings.warn('resource_tracker: There appear to be %d ’
WARNING:root:python-rtmidi was not found; streaming midi input / output will not be available.
WARNING:root:pynput was not found; mouse and keyboard input will not be available.

To install packages in thonny, go to tools>manage packages. Or you can co to tools>Open system shell, which opens a special terminal where pip installs to the thonny python.

Don’t worry about the semaphore thing. :slight_smile:

1 Like

That makes sense :smile: I was able to get it working by adding the packages inside of Thonny. Drums aren’t playing for some reason but I’ll figure it out. Thanks for your help!