PortMidi 'Invalid Device ID'
I have been having this issue (maybe non-issue) for some time.
Here is my set up:
Teensy 2.0 MIDI Device
Late 2013 Macbook Pro
I am using a Teensy MIDI device in Pd.
If I connect the Teensy device, then launch Pd, I get the following error message:
could not open midi input 0 (Teensy MIDI): PortMidi: 'Invalid device ID'
could not open midi output 1 (Teensy MIDI): PortMidi: 'Invalid device ID'
Under my MIDI settings I have "Teensy MIDI" selected both as my input and output.
If I re-select "Teensy MIDI" in both dialogs of the MIDI preferences menu, and hit OK the same error message will reappear in Pd's print window.
Though I get this error, it seems to not effect the use of the device in any way.
When I connect the device to a windows machine, I don't have this PortMidi error message.
I have also connected this device to my iPhone using MobMuPlat, no issues.
Any advice would be helpful.
throbbing midi note.
I can't seem to set the midi up right. I'm sure it's a simple fix I'm missing, but I honestly did spend a lot of time with google trying to find the answer. Hopefully someone can help out a poor newb.
I'm using a Firepod interface.
Input device: PreSonus FirePod MIDI in
Output device: PreSonus FirePod MIDI out
In "testtone.pd" patch, when I click on the MIDI OUT box, I get a "throbbing" sound from my rack-mounted synth. "wah wah wah wah..." about 500 milliseconds each.
...it sounds maybe almost like a memory cutout? or something is breaking up the tone.
The hardware is all fine. If I set it up the same way with Reaper or Sonar I get a nice steady tone.
I just want PD to hold a steady pitch for MIDI out on my synth. Should be easy right? I'm on my third day trying to get it to work. Any help would be great!
MIDI Controller experiences/suggestions
@lovelovevideo Hello again.......... if your computer can talk to to the midi device then Pd will work fine. So the real question is "what usb midi devices will work with your computer".
The most future proof for you will be a usb soundcard with midi connectors, or just a usb midi card...... because then any and all midi devices will talk to it through standard 5-pin din connectors. But if a midi device will talk to your computer then it will talk to Pd.
That was a bit long winded... the question is...... "does my computer have the drivers available........ that work!........... for the device?....."
I don't use midi much nowadays as for control I use the "new midi" called osc. Pd works well with osc and you could try it if you have a tablet. I use this app http://hexler.net/software/touchosc which apart from being very reasonably priced and being available for ios and android (sounds like an advert!) will let you draw toggles buttons sliders and XY pads and more on your tablet.
Musicians still use midi for the notes (better timing) but are increasingly using osc for control....
It is far easier to understand than midi.
Usefull sends messages to pd
@heyok I have a similar question: for pd .46-7 on a raspberry pi, do you know how to open the OSS-MIDI, or MIDI settings window?
I'm having a similar issue that I've been dealing with in this thread:
the "; pd midi-properties" message opens up the ALSA-MIDI or ALSA MIDI settings window, I'm trying to open the OSS-MIDI or MIDI Settings window.
I tried "; pd midi-settings" message.
Let me know if you have any ideas.
Need help to slightly modify a PD project (Rythmboy)
Thanks a lot for your help!
I want to set the tempo completely externally using another MIDI clock, or, if that's easier, I want to sync the internal metronome to an external MIDI clock.
The patch above is not mine, I only want to modify it, and as I see the [metro] object in other parts of the sequencer as well, maybe it is easier to sync the internal metronome with the external MIDI clock.
As far as I understand, the function you postet gives out a "tick" signal for every quarter note. How can I count the time between two ticks an convert that into a BPM value? Because I think that is what I need to get my modded Rythmboy up and running.
PS: [MIDIrealtimein] works, I already tested this with Traktor MIDI clock, LoopBe1 and a simple clock patch for PD.
Need help to slightly modify a PD project (Rythmboy)
I recently stumbled upon a PuraData based step sequencer for my QuNeo MIDI controller, the so called Rythmboy:
I want to use it as a step sequencer to use with the remix decks in Traktor, so I can add drums to the tracks I play.
Unfortunately, the Rythmboy has an internal MIDI clock, so I can't sync it with an external clock. I already tried to replace the BPM rotary in the patch with "MIDIrealtimein" and the stuff that's also needed, but I can't get it to work.
I managed to do all the other stuff that is needed to work with Traktor (changing the note output, optically mirroring the rotaries, limiting the notes ranges etc.), so I tried, but I don't know how to work with an external midi clock. Another problem that may occur is that the Rhythmboy then needs two MIDI inputs, #1 is the QuNeo and #2 is the external clock (Traktor or my Xone4D mixer).
This is the part of the Rhythmboy that controls the MIDI clock:
The blue box is a tap button to tap in the tempo. This is not needed.
The red box converts a rotary MIDI input between 0 and 127 into a BPM value between 60 and 240 bpm and gives out that value. This is where the changes need to happen I think. I need something that changes the MIDI clock in into a numerical BPM value.
The green box gives output to the rotary LEDs to show the current BPM. This is also not needed.
The other stuff lets a LED blink a metronome, I think.
So, would one of you please tell me what to put in instead of the red box, to make the magic happen?
Looking for PD guru...private proj
Cool...excellent in fact. Will start with 1 issue and go 1 at a time...
Main behaviour is a single click/double click/long hold. ie For midi sustain, a quick single click enables a filter which allows only note on values to play midi notes (for sustained atmoshpheres played from a midi guitar). Anything longer than a quick click is a standard momentary sustain pedal. A double click resets the pedal action and sends an 'all notes off' to clear everything.
I was planning to use this in a browser so I used an active X timer so it would be async to the rest of the script. Hope I have added enough comments to explain;
Insert Code Here Case 64 'Case CC 64 = sustain message from floorboard 'Dat1 = Midi message type+channel 'Dat2 = message value 'default action is send cc64 to instrument out ie Dat2 = 127 and begin sustain regardless of note off filter/sustain action If Dat2>0 Then mox.OutputMidiMsg InstOut, &hB0, 64, 127 'SC is prefix: SingleClick 'Check if its the first trigger in timer sequence and timer has been fired If SCTiming = 1 then 'Test how many pedal downs have occured during timer period If Dat1 = SCOldDat1 THEN SCClkCnt = SCClkCnt+1 End If Else 'Waiting for Single Click Pedal Up If WaitForSCPU=1 Then If (SCOldDat1=Dat1 AND Dat2=0) Then 'Long Hold Action - cc64 sustain off mox.OutputMidiMsg InstOut, &hB0, 64, 0 'Clear wait flag WaitForSCPU = 0 End If Else 'fresh trigger 'sc and dc are single/double click actions that are executed as strings according to timer sc="FilterMGNoteOff = FilterMGNoteOff XOR True : mox.OutputMidiMsg InstOut, &hB0, 64, 0" ' PUREDATA NOTE: couldnt see any XOR functions? dc="mox.OutputMidiMsg InstOut, &hB0, &h7B, &h7F : FilterMGNoteOff = False : mox.OutputMidiMsg InstOut, &hB0, 64, 0" 'SCTiming is a flag to indicate timer has fired SCTiming = 1 SCTimer.enabled = true SCTimer.Duration = 400 'set the click count to 1 (ie pedal down of 127 has ocurred) SCClkCnt = 1 End If End If 'Single Click previous value used for comparison/click count SCOldDat1 = Dat1
Insert Code Here
And here is the timer sink/sub; Insert Code Here Sub SC_Timer SCTiming=0 'Do Timer results here If (SCClkCnt=3 OR SCClkCnt=4) Then 'DC Behaviour Execute(dc) Else If SCClkCnt=2 Then 'msgbox "sc" 'SC Behaviour Execute(sc) Else If SCClkCnt=1 Then 'Wait for pedal up 'msgbox "pedal up" WaitForSCPU=1 End If End If End If 'Reset ClkCnt SCClkCnt=0 SCTimer.enabled = false End Sub
Hope that helps explain
The above example is a bit parametric in that it feeds strings to the sub. This type of module is used throughout the script so Im totally open to simplifying it/modding to make it better in PD...which, from what I have seen, looks like it should be able to do.
If I can get all the previous code to translate, would like to add a control panel showing the fcb with the the current status/values of footswitches on screen, or even just just plug a tablet on the front of the controller for the future.
Filter out midi clock information
@NoDSP I think you are spot on. I tried your filtering solution in-patch to no success. Every outlet of every MIDI-in object was being triggered at "Active Sense" rate.
My temporary solution has been to set the device's MIDI clock settings to "external" so that it looks for an external signal but still outputs MIDI data. I have encountered some latency that way, although I'm not sure that has anything to do with the external clock setting as much as it does the fact that I am routing this MIDI data from pd into another program for sound generation via the built in IAC MIDI bus on OS X. When I have time I'll give midi patchbay a try.
Thanks so much for your insight!
animate image sequence with MIDI
I just started out with Pd for a vey specific project, but I'm pretty inept with computers so please be patient!
I'm trying to control and animate image sequences via MIDI, with the MIDI Clock signal (or a fraction therof) working as the framerate and using MIDI Note messages to select the animation, as well as MIDI CC messages to control visual effects (colour hue, rotation, inversion and so on).
I've managed to make a MIDI clock counter and tried using it to cycle through the images of a "pix_multiimage" object, but it won't cycle through the image sequence (only the first image of the sequence is displayed) as it is recieving a bang rather than a float.
I assume there is something missing between the clock output and the multiimage input. I've tried addind a "float" (and "float 0" and "float "1") message inbetween and the error message stops, but the image still doesn't cycle.
That's my main question for the moment, further down the line I'd also be greatful for any info on how I would go about setting up the "notein" values to select from a matrix of multiimage objects, ideally with the option to layer images when polyphonic input is recieved, and how to implement the CC controlled visual effects, but that would probably be asking too much.
Filter out midi clock information
It's usually best to first find out where the the unwanted messages are coming from and, if possible, disable them at the source. Filtering after the fact is doable but it's still a waste of control bandwidth and process cycles that can affect timing etc.
I would tend to doubt that it's coming from the Profire as there aren't too many sound cards with built in midi clock generators (thou it's not a bad idea if it's a real hardware midi clock) thou I can't confirm that as I can't find a manual for it online. More likely it's coming through the Profire's midi interface from this unnamed "drum pad" you speak of -- is this really just a dumb trigger pad, or something with a built in clock or sequencer (i.e. Roland HandSonic)?
If you really can't turn it off and you don't have a midi hardware filter handy, then there's a couple of options on the software side. The first is to use a third party app connected between the Profire and Pd (such as midi patchbay on the mac, qmidiroute on linux etc). This is the method I use to get rid of active sense messages from an old cheap MidiMan USB controller that lacks a disable option. I prefer this so Pd doesn't have to deal with any of it.
You can also use a simple patch from within Pd to do this, but as you haven't been specific about how your patch works I'm not sure where you could insert it. It sounds like you are taking raw input from a midiin object. If that's the case, you can simply connect the midiin output directly to the inlet of the patch below and connect whatever else you have to the output.