Juce / Teensy communication

Status
Not open for further replies.

mtiger

Well-known member
Hi,

I would like to develop a GUI for a teensy project with the Juce Framework. I've been learning this new framework and wondering how I would be able to communicate between the two.

As a simple test project, I would like to simply design a knob or input text box, choose a value, then send that value over to Teensy to store and upload to the device.

I've looked around however haven't come across anything that is a simplistic as what I'm asking. Does anyone have any recommendations or references I could look into.

Thanks :)
 
Surprised you haven't heard of juce. A very popular framework for DSP.

I want to create an application, that can store / retrieve values from Teensy. The juce application directly communicates with the teensy (assuming via serial port) through USB. Technically, an interface for Teensy.
 
FWIW, I've never heard of Juce either. But then I don't do smartphone app development, which appears to be Juce's focus as nearly as I can tell from a quick look at the very slick website.

I did quickly glance at their list of tutorials & documentation subjects list. Juce's scope is so broad, and your question so generic, that it's hard to narrow the focus to figuring out how you'll communicate from Teensy to whatever hardware (not clear if a phone or Mac or something else) that runs Juce. But I do see quite a lot of stuff about MIDI. Maybe Teensy's USB MIDI device features are a good place to start?

If you need more specific help on the Teensy side, we can probably help you more if you can give more detail and some context about what you're trying to do. But if you have Juce-specific questions, or need answers that require knowledge of Juce, I'm afraid this forum probably isn't going to be really fulfilling when it comes to Juce. I'm sure it's wonderful, but it doesn't run on Teensy and like Defragster, until this thread I'd never heard of Juce either.
 
Ok, well then if you are unaware of the Juce framework I'll move away from asking of those specific questions. FWIW, Juce is primarily used for Audio DSP plugins, software applications.

More specifically with Teensy, how would I use the serial ports to communicate with other serial communication devices?
 
how would I use the serial ports to communicate with other serial communication devices?

Well, the answer depends on what types of devices.

Hardware-wise, if those devices are TTL-level and if you're using a 5V tolerant Teensy (3.2 or 3.5) then you would just wire each TX pin to the other side's RX pin, and of course connect the grounds. If using a 3.3V only Teensy (LC or 3.6) then you'd also want to make sure the other device isn't sending 5V signals. If the device uses RS232 levels, or some other sign type, then usually circuitry is needed to adapt to the TTL level signals.

Software-wise, if the device speaks a commonly used protocol like MIDI or NMEA0183 (GPS data) then you would normally use one of the libraries which does those protocols. But if you want to directly transmit and receive bytes, writing your own code for whatever protocol & data format your mystery device uses, then you would use Serial1, Serial2, etc as documented here:

https://www.pjrc.com/teensy/td_uart.html

If your device is actually USB, and is actually a "device" in USB lingo (has a USB B-type connector - the kind of thing you plug into a PC) then you would need Teensy 3.6, which is currently the only Teensy with USB host port capable having USB devices plugged in. There, you would use USBHost_t36 and probably this cable.

But if you mean having Teensy be a USB serial device (where to Windows it's a COM port, or to Mac a /dev/cu... device), which is it's default and main usage mode, then you'd use the normal Arduino Serial function. Teensy-specific documentation is here:

https://www.pjrc.com/teensy/td_serial.html

I hope you can see something here, beyond the answer. When you ask this sort of very generic question, without any details and without context to understand what you're trying to actually accomplish, we have to guess what sort of answer you need. Normally I don't write out several cases like this, spending extra time to cover all the bases, only because it's impossible to get a clear idea of what type of device. But I had an extra few moments just now, and spent them on this broad answer rather than an answer that would have focused much more on whatever your situation needs.

Please, help us to help you. Try to give details and context. It saves every time and in the end we can help you much better.
 
Well, as mentioned in my first post, and second post... I'm learning the Juce framework, and want to write an application that can communicate with Teensy (via serial, I assume)

In the simplest form, I want to create a software application that can send information (a string or int value for example) over to the Teensy to then store and upload to Teensy live.

So basically, I want to manipulate some values stored on the Teensy, by creating a software interface that can interact and change values.

The Teensy would be connected via USB to the computer, and the communication (as assumed) would be via the serial protocol.

I've come across this website: https://omohmproductions.com/?page_id=145

The juce4 module download is what I'm referring to as I believe this is a way to implement serial with the Juce framework.
 
Looks like that should work. Use Window 10. All pre-10 versions of Windows have painful bugs in their serial drivers. Arduino works around those issues when you use only the serial monitor, but when you put other software in the mix... it's not much fun. Linux and Macintosh also work great. The problems are only with Windows 7, 8 & XP.

Juce also appears to have pretty substantial support for MIDI, so you might also try programming Teensy to be a USB MIDI device and have it respond to certain MIDI messages, maybe also sysex if you need more complex messages.

If you go the MIDI route, you can select "MIDI + Serial" in Arduino's Tools > USB Type menu. That's really helpful, because you have have it do serial communication with the Arduino Serial Monitor while it's also doing MIDI communication with Juce or other non-Arduino software.
 
I've used JUCE to interact with my Teensy. I've released an application for it and posted about it on this forum here.

The application has nothing in it specific to Teensy, it's just a graphical MIDI controller. It sends MIDI CCs out to any class compliant USB-MIDI device. The Teensy is a MIDI class compliant device when setup as Paul mentioned.

Several of the effects in my BALibrary support MIDI control using the Teensy USB MIDI library. There is nothing specific about JUCE in these Teensy programs. The link between them is they both talk MIDI. Nothing more complicated than that required.

Here are some examples where I've built MIDI control into my effects demos for use with the BAMidiTester (or any other MIDI control source).
AnalogDelayDemo
SoundOnSoundDemo
TremoloDemo

@mtiger JUCE has great MIDI integration. I've not used their serial support (if any) so I can't comment on that. I suggest you send data between JUCE and the Teensy using MIDI. If necessary, send general purpose data as MIDI SYSEX messages.
 
Looks like that should work. Use Window 10. All pre-10 versions of Windows have painful bugs in their serial drivers. Arduino works around those issues when you use only the serial monitor, but when you put other software in the mix... it's not much fun. Linux and Macintosh also work great. The problems are only with Windows 7, 8 & XP.

Juce also appears to have pretty substantial support for MIDI, so you might also try programming Teensy to be a USB MIDI device and have it respond to certain MIDI messages, maybe also sysex if you need more complex messages.

If you go the MIDI route, you can select "MIDI + Serial" in Arduino's Tools > USB Type menu. That's really helpful, because you have have it do serial communication with the Arduino Serial Monitor while it's also doing MIDI communication with Juce or other non-Arduino software.

Good day Paul. I am new to the diy world as a whole and was researching good boards to start with as a beginner. I saw the teensy 4 for a good price and the aforemntioned juce was also recommended a s a good audio development tool. Now this is a broad amateurish question. from the Teensy end, how do I get started with the board, and narrow my focus to only audio applications. I guess what I'm trying to say is I dont want to explore every facet of the tool yet, just audio related functions. So please if its possible I would like to know what to narrow my focus on. Thank you
 
wow thank you for this reply. I am trying to use the juce api also as a GUI and maybe some daw type functions. However, I intend to use the teensy 4.0 as the audio synthesis engine. Please whats are your advice
 
Status
Not open for further replies.
Back
Top