rotary encoder

I found a gain knob on a trash circuit turns nice and has 3 pins. Will that work as a rotary knob to control volume in MIDI....? Teensy midi project....thanks

Lets see a good image of the device.

And a better description. Does it turn continuously without limit (rotary encoder), or have end stops (potentiometer)? Does it have detents (clicks)?

its small for a good pic ....
it has a left stop and a right stop, it turns about 3/4 total.
wouldn't either one work for a DAW track control???? 1-127..?I don't need any better the that..
here is pics

OK, that's a tiny "trimpot".

It is not intended to be adjusted routinely. It is something you adjust once when setting up your equipment, and not again. Any more often and it will wear out.

That's a trim pot indeed. Those may not even have a variable resistance over the full range; my stack of cheap trim pots actually has only 180° where the resistance changes, the first and last 45° don't do anything...

You also need to know the resistance of the thing, too high or too low and it will give you issues with your intended application.

For volume control, get a proper pot, 5-20k is probably fine. You may even need a logarithmic one for volume control.

"rotary encoder"
apples and oranges
Rotary Encoder Definition