rename last_cc to ccIn

This commit is contained in:
2024-01-15 21:37:25 +01:00
parent b4b507b2d6
commit 61051c9e42
2 changed files with 47 additions and 47 deletions

View File

@ -619,7 +619,7 @@ export class UserAPI {
return note ? note.note : 60;
};
public last_cc = (control: number, channel?: number): number => {
public ccIn = (control: number, channel?: number): number => {
/**
* @returns Returns last received cc
*/

View File

@ -80,12 +80,12 @@ ${makeExample(
Midi CC messages can be used to control any value in Topos. MIDI input can be defined in Settings and last received CC message can be used to control any numeric value within Topos.
Currently supported methods for CC input are:
* <ic>last_cc(control: number, channel?: number)</ic>: Returns last received CC value for given control number (and optional channel). By default last CC value is last value from ANY channel or 64 if no CC messages have been received.
* <ic>ccIn(control: number, channel?: number)</ic>: Returns last received CC value for given control number (and optional channel). By default last CC value is last value from ANY channel or 64 if no CC messages have been received.
${makeExample(
"Play notes with cc",
`
beat(0.5) && sound('arp').note(last_cc(74)).out()
beat(0.5) && sound('arp').note(ccin(74)).out()
`,
true,
)}
@ -94,15 +94,15 @@ ${makeExample(
"Control everything with CCs",
`
beat(0.5) :: sound('sine')
.freq(last_cc(75)*3)
.cutoff(last_cc(76)*2*usine())
.freq(ccIn(75)*3)
.cutoff(ccIn(76)*2*usine())
.sustain(1.0)
.out()
beat(last_cc(74)/127*.5) :: sound('sine')
.freq(last_cc(75)*6)
.cutoff(last_cc(76)*3*usine())
.sustain(last_cc(74)/127*.25)
beat(ccIn(74)/127*.5) :: sound('sine')
.freq(ccIn(75)*6)
.cutoff(ccIn(76)*3*usine())
.sustain(ccIn(74)/127*.25)
.out()
`,
false,