To send midi direct from s4pd?

Skip to first unread message

Forrest Curo

Aug 12, 2021, 3:55:13 PM8/12/21
to scheme-for-max & scheme-for-pd
[I'm getting timing problems in mapping a midi key number to the frequency it would produce in a modified scale -- Not scheme-timing problems, but pd order-of-processing problems:     Note 'a' goes into the right inlet of a |pack| object, and then the frequency for 'a' goes into the left inlet but gets packed with the previous note number.]:

How could the s4pd interpreter maintain a midi-output port of its own?

Forrest Curo
San Diego

Forrest Curo

Aug 15, 2021, 3:23:55 PM8/15/21
to scheme-for-max & scheme-for-pd
Okay, I didn't need any such thing.
If I receive a midi note from | notein 1 |, supposing that's say, midi note 69 with velocity 60, run that pair through    | pack | to a message box:  ) outgrib $1 $2 |
into | s4pd | --

all I really need is a scheme procedure to send '69' and 'frequency of 69' out one outlet (sending a scoreline_i line to csound, where it sets the global value
gkFreq[69] used by instr 2 to set the pitch it generates), and to then (via sending '69 60 out the other outlet) generate a midi note to instr 2 using the original values
to output the new frequency (This line in instr 2: "ifreq = i(gkFreq, ikey)" ).

This ought to work for that:
(define outgrib (lambda (x y) (begin (out 0 (list x (* freq (rats (scale (degree (inexact->exact (modulo x 12))))) (expt 2 (floor (/ x 12)))))) (out 1 (list x y)))))

Sep 4, 2021, 11:19:01 PM9/4/21
to scheme-for-max & scheme-for-pd
Ah damn it, I keep setting tweaking these to not go to spam and it went back to spam, I didn't get any notifications on these posts.  My apologies Forrest, I will look at these tomorrow, and try to sort out why gmail thinks googles own groups are spam. (wtf google?)


Reply all
Reply to author
0 new messages