Adding Synths to support current use_synth command

#1

Hello,

I’ve been looking through the forum and have found a couple ways to add synths, but they seem to change the syntax. Is there any way to add synths to sonic-pi that would be use the use_synth command currently in place? I’ve been wanting to add instruments for some large projects and reworking them will be time consuming.

Thanks for any answers you all can provide.

0 Likes

#2

Hi @Dev_Luke,

Not quite sure what you’re after here - are you wanting to be able to have multiple different synths playing simultaneously in your composition, or one after the other, or something else again?
use_synth is designed to affect all further calls to eg play, so to play many different synths, you’d need to play one, immediately call use_synth with a different synth name, play it, call use_synth with a different name again, etc…

(Or, by ‘add synths to Sonic Pi’, do you in fact mean use synths outside of the built-in ones?)

0 Likes

#3

@ethancrawford
I mean use synths outside of the built-in ones

0 Likes

#4

Oh, sure.
Yes, you can definitely use use_synth as normal with external synths.
Say you had a custom synth (on macos for example, but you get the idea): /Users/luke/Desktop/my_synth.scsyndef

A typical workflow would be:

load_synthdefs "/Users/luke/Desktop" # place this at the top of your code for example
use_synth "my_synth"
play 60

The two key things to remember in this case are:

  • specify the name of the synth as a string, in quotes
  • make sure that you have the Preferences setting Audio > Synths and FX > Enable external synths and FX toggled on.
1 Like

#5

@ethancrawford

What is the format for the files the sonic-pi would accept?
I’m new to the computer side of music.

0 Likes

#6

Oooh right.
Well, the synth/with_synth/use_synth/play commands all expect to play synths created with the language that Sonic Pi’s sound engine, Supercollider, provides. So the solution there is either to search the Internet for so-called Supercollider ‘SynthDefs’, or build your own. (Which I am actually in the process of doing at the moment!).

However, the alternative to this is to use Sonic Pi’s communication abilities to talk to external programs that can run other virtual synthesiser plugins.
Referring to the tutorial, sections 11 and 12 (or http://sonic-pi.net/tutorial#section-11 and http://sonic-pi.net/tutorial#section-12), you’ll see that Sonic Pi has built in support for the MIDI and OSC communication protocols. Any virtual synth that accepts either of these protocols will work.
There’s probably a bunch of information floating around on the forum here about ways people have done that - search for VST, MIDI, or OSC etc. One such example which may give you an idea:
Is it possible to control via Sonic Pi an instrument in Ableton?

1 Like

#7

What kind of synths did you hope to control with Sonic Pi?

0 Likes

#8

@samaaron,

I was looking at using sonic pi to create longer pieces (I’ve already run into the character limit problem), but I would like to be able to add different instruments to the music. For the moment, I’m looking at adding some sound font instruments to sonic pi capabilities and have found a couple examples that solve problems for very specific sound fonts. Robin Newman coded an implementation for sonatina; I was going to use his ideas to help implement newer soundfonts.

The biggest issue is finding a way to add new sounds without taking away the more advanced capabilities of sonic-pi, such as envelopes (I wasn’t completely sure if using OSC would allow me to use the envelopes). Adding a new synth would allow me to use the standard commands, like play, that would make development and the code simpler in general.

0 Likes