overtone

diego.videco 2024-04-30T02:08:13.090939Z

@joakim just posted the referenced message last week, which should work for what you want. However I use o/pitch-shift to transpose down all the time. In the docs, the third parameter is pitchRatio : https://doc.sccode.org/Classes/PitchShift.html. So every number under 1 is a lower pitch. For example 1/2 is one octave down, 1/4 is two octaves down. 2/3 a fifth down, and so on. I like just intonation so I mostly use ratios for my pitches, but you may want to convert from ratios to midi so you can use o/midiratio for that (0 is a unison, e.g. ratio 1; -12 is 0.5, etc.)

Joakim Verona 2024-04-30T07:16:09.780629Z

thanks very much @diego.vid.eco I will try both your suggestion with pitchshift, and also loading the ugen

Joakim Verona 2024-04-30T07:17:45.034369Z

I think I find pitchshift confusing, because I tried this code and it never piches down: (definst pitcher [] (pitch-shift:ar (sound-in:ar [0 1]) 0.1 (mouse-x:kr -2 2) 0 0.004) )

Joakim Verona 2024-04-30T07:18:13.166639Z

originally the -2 in the mouse-x was from 0, not -2

diego.videco 2024-04-30T13:16:51.992939Z

Right now I don’t have a mic available, but this works for me:

(o/definst pitcher []
    (o/pitch-shift:ar (o/sin-osc [100 200])
                      0.1
                      (o/mouse-x:kr 0 2)
                      0
                      0.004))

Joakim Verona 2024-04-30T15:21:17.300119Z

thanks, but this pitches only up for me not down

Joakim Verona 2024-04-30T15:21:25.017939Z

same as with my other tries

diego.videco 2024-05-01T03:57:08.365399Z

wow, that’s weird. Have you tried it directly on the SC IDE?

diego.videco 2024-04-30T02:15:42.459009Z

The above is sort of a escape hatch that let’s you define your synthdefs in SuperCollider and use them in Overtone, not ideal, but better than nothing and can allow you to use SynthDefs from other people or code examples that you see around. But you can also modify Overtone directly, this is an example, although this case Overtone is not compiling as expected. Has similar issues with the DX7 UGen from the SCPlugins. But sometimes it does work, the procedure is very much what’s done on the trig.clj file, but you’ll just need to find a more appropriate file: https://github.com/overtone/overtone/commit/5db278b82984ca44d78ffd1b3c7c02c193166e37 (edited)

Joakim Verona 2024-05-01T11:25:48.682619Z

no, I'm not familiar with how to use it, I guess I can learn of course

Joakim Verona 2024-05-01T11:33:49.627119Z

ok, I tried removing the mouse-x altogehter and replacing with a constant, like 0.5, as you suggested. Now the pitch goes down!

Joakim Verona 2024-05-01T11:35:12.540629Z

So, I guess for some reason in my case mouse-x doesnt go below 1 then? anyway, thats no big deal, since I was going to modulate the samples with a sequence anyway.

Joakim Verona 2024-05-01T11:35:19.009659Z

tnx for all the help!

diego.videco 2024-05-01T14:40:05.458319Z

welcome